deck-of-card Audi technical questions
As a magician, I can shuffle, draw and sort a deck of playing cards so that I can perform magic tricks.
- I can shuffle the deck of cards.
- I can draw any given number of cards from the deck, with the cards being removed from the original deck.
- I can draw any given number of cards from the deck and then sort the drawn cards, with the cards being removed from the original deck.
- Sorted cards are sorted by suit: Clubs, Spades, Hearts, Diamonds; then by value: Ace is high.
- At Audi we work with React so ideally, we would like this to be written in React and Redux where you feel it is appropriate.
- We pride ourselves on creating simple, effective User Experiences so we would like you to show off what you can do.
- We like our code to be as beautiful as our UI so bear this in mind and use industry best practices.
- We’re all about testing, so ensure your code is well tested.
- The codebase should be delivered using GitHub (IBM GitHub or github.com, we don’t mind)
Please provide us with build, test & run instructions as well as the code.
We wouldn't ask anyone to do a coding puzzle that we haven't done ourselves, so the people looking at your code understand the problem we're asking to be solved.
We are keen to see how much you think is enough, and how much would go into a Minimum Viable Product.
As a guide, elegant and simple wins over feature rich every time.
We want to see that you are familiar and able to create a build process for your code that means it is easy to build, test and run.
Bonus points are given to those who spend time ensuring their code is continuously analyzed by appropriate build tooling to ensure code quality.
We also consider the extensibility of the code produced. Well-factored code should be relatively easily extended.
-
I can shuffle the deck of cards. ✓
-
I can draw any given number of cards from the deck, with the cards being removed from the original deck. ✓
-
I can draw any given number of cards from the deck and then sort the drawn cards, with the cards being removed from the original deck. ✓
-
Sorted cards are sorted by suit: Clubs, Spades, Hearts, Diamonds; then by value: Ace is high. ✓
-
Updated Readme with running flow ✓
-
Completed Unit Tests ✓
-
Completed Cypress Tests ✓
You need node and npm to run this locally. Go to https://nodejs.org to install the latest stable version.
Once installed, navigate to the deck-of-card directory and run:
npm install
npm run start
To run unit tests
npm run test
To run cypress tests
cd deck-of-card/e2e-test-cypress
npm install && npm run open
- Sorted cards are sorted by suit: Clubs, Spades, Hearts, Diamonds; then by value: Ace is high.