Let's play tic-tac-toe.
This test should serve as a basis for the technical evaluation of a candidate
Here's a typical breakdown of how much time should be spent on each skill we are probing for.
Skill | Time |
---|---|
Unit testing | 25% |
Design patterns | 25% |
Data structures | 20% |
Web semantics | 15% |
React | 15% |
- You can only play in a empty square (~10min)
- You can't play when the game has ended
- You can only place a single Ω piece per game
- You can't play when the AI is thinking
- Winning end-game test (programatic/property-based testing) (~20min)
For a board of M×M size, there are 2+2*M possible solutions But how do you test the rest?
Q&A: Is this exhaustive?
- AI should play randomly (requires mocking
random
)
- seed works
-
Implement a move recorder (encoding) with chess notation 123,abc (~15-30min)
-
Implement a new piece behavior
-
Implement a parametric board size
-
Q&A to test for the patterns that existed in the codebase
- AI Implementation (visitor)
- Creating the board (factory)
- Pick your AI implementation (strategy)
- Undo feature (memento)
- De-duplicating the board state (flyweight)
- Board structure
- Piece definition (x)
- Piece behavior
- Game state (x)
Proper usage of HTML landmarks
<img alt />
attributes for images<p />
<section />
- Implement the UI design (~15min)
- Implement a11y features usage of ARIA/fallback attributes (~15min)
- Tab index for all the cells (x)
- Screen reader feedback for focusing a cell
- Screen reader feedback for piece placement
Implement the rendering logic
- Rendering elements
- Game state/reset
- User interactions
- Async components (AI thinking…)
- Implement AI thinking behavior (code) (~30min)
- Implement error messages handling (code)