PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Amplitude

Implement Employee Validation and Snake

Last updated: Apr 12, 2026

Quick Overview

This question evaluates recursion, graph traversal and cycle-detection concepts for hierarchical employee validation alongside state management, event-driven input handling and collision detection for a grid-based Snake game.

  • medium
  • Amplitude
  • Coding & Algorithms
  • Software Engineer

Implement Employee Validation and Snake

Company: Amplitude

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

This interview covered two coding tasks: 1. **Employee validation** - Implement a function that validates a collection of employees against a set of business rules. - Each employee can have direct reports, so validation must recursively process all descendants. - Follow-up: extend the validation so it detects cycles in the reporting structure, for example when employee A indirectly reports back to employee A. 2. **Snake game** - Implement a simplified Snake game on a 2D grid. - The game should handle keyboard input for up, down, left, and right movement. - It should detect wall collisions. - When the snake eats an apple, its length should increase by 1.

Quick Answer: This question evaluates recursion, graph traversal and cycle-detection concepts for hierarchical employee validation alongside state management, event-driven input handling and collision detection for a grid-based Snake game.

Related Interview Questions

  • Implement lossless dictionary encoding and decoding - Amplitude (medium)
  • Swap kth-from-end node with head - Amplitude (medium)
Amplitude logo
Amplitude
Mar 3, 2026, 12:00 AM
Software Engineer
Onsite
Coding & Algorithms
2
0

This interview covered two coding tasks:

  1. Employee validation
    • Implement a function that validates a collection of employees against a set of business rules.
    • Each employee can have direct reports, so validation must recursively process all descendants.
    • Follow-up: extend the validation so it detects cycles in the reporting structure, for example when employee A indirectly reports back to employee A.
  2. Snake game
    • Implement a simplified Snake game on a 2D grid.
    • The game should handle keyboard input for up, down, left, and right movement.
    • It should detect wall collisions.
    • When the snake eats an apple, its length should increase by 1.

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Amplitude•More Software Engineer•Amplitude Software Engineer•Amplitude Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.