System design interview question
Design Snake Game
A Snake game engine: the snake modelled as a deque for O(1) head-add and tail-remove, food generated on cells that exclude the snake body, self-collision detection via a hashed set, a game-state machine (RUNNING / PAUSED / GAME_OVER), scoring, configurable difficulty (tick rate), and wraparound vs walled boundary modes. Implemented in TypeScript, Java, and C++.
Practice this question step by step with an AI interviewer that reviews your requirements, your architecture and your trade-offs, and scores the design.