Implement Employee Validation and Snake
Employee Validation
Implement a function to validate a collection of employees against a set of predefined business rules. Each employee can have direct reports, and the validation process must recursively apply to all descendants within the reporting structure.
Follow-up
Extend the validation mechanism to detect and handle cycles in the reporting structure. For example, if employee A indirectly reports back to employee A, this should be identified.
Snake Game
Implement a simplified version of the classic Snake game on a 2D grid. The game should incorporate the following features:
- Movement: Handle keyboard input for controlling the snake's movement (up, down, left, right).
- Collision Detection: Detect when the snake collides with the boundaries of the 2D grid (walls).
- Growth Mechanic: When the snake consumes an apple, its length should increase by one segment.
AI interview prep
Core dilemma
Demonstrating versatility in applying appropriate data structures and algorithms for distinct problem domains: graph traversal and cycle detection for hierarchical data, and robust state management for real-time interactive systems.
3 tradeoffs and 2 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Implement Employee Validation and Snake
Employee Validation
Implement a function to validate a collection of employees against a set of predefined business rules. Each employee can have direct reports, and the validation process must recursively apply to all descendants within the reporting structure.
Follow-up
Extend the validation mechanism to detect and handle cycles in the reporting structure. For example, if employee A indirectly reports back to employee A, this should be identified.
Snake Game
Implement a simplified version of the classic Snake game on a 2D grid. The game should incorporate the following features:
- Movement: Handle keyboard input for controlling the snake's movement (up, down, left, right).
- Collision Detection: Detect when the snake collides with the boundaries of the 2D grid (walls).
- Growth Mechanic: When the snake consumes an apple, its length should increase by one segment.