← Liftoff Interview Insights

Liftoff·Software Engineer·Take-home Assignment·Intermediate

Intermediate
Jun 2026

Summary

Take-home assignment for a Software Engineer role at Liftoff. The task was to build a fully functional Tetris clone from scratch, no GUI needed, just working game logic in the terminal.

Questions Asked (1)

Q1

Implement a terminal-based Tetris game from scratch, covering all standard mechanics: the full set of tetrominoes, piece spawning and gravity, movement and rotation controls, soft and hard drop, line clears, scoring, level progression with speed increases, and game-over detection.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

This is a lot more scope than it looks on paper.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints, then outline a modular design separating game state, rendering, and input handling. Walk through the core mechanics (tetromino representation, rotation, collision detection, line clearing, scoring, level progression) and discuss trade-offs in data structures and algorithms.

Pro tip: Emphasize testability and separation of concerns: propose a pure game logic module that can be unit-tested independently of the terminal UI. This shows maturity and makes the implementation more robust.

1. Clarify Requirements and Constraints

Ask about terminal environment, language preferences, and any specific mechanics (e.g., wall kicks, hold piece). Confirm the scope to avoid over-engineering.

2. Design Data Structures

Define representations for the board (2D array), tetrominoes (rotation states as coordinate offsets), and game state (current piece, next queue, score, level, etc.).

3. Implement Core Mechanics

Code collision detection, piece movement (left/right/down), rotation with wall kicks, soft/hard drop, line clearing, scoring, and level progression with speed increase.

4. Handle Input and Rendering

Use a terminal library or raw mode for non-blocking input, and render the board and pieces using ASCII characters. Ensure smooth updates with a game loop.

5. Test and Refine

Write unit tests for game logic, manually test edge cases (e.g., piece locking, game over), and optimize performance if needed.

Key Points to Mention

  • Tetromino representation: use rotation states as coordinate offsets or matrices, and implement wall kicks for rotation near walls.
  • Collision detection: check boundaries and occupied cells before moving or rotating a piece.
  • Line clearing: scan for full rows, remove them, and shift rows down; update score based on number of lines cleared.
  • Scoring and level progression: implement standard scoring (e.g., 40/100/300/1200 for 1-4 lines) and increase speed by reducing gravity interval per level.
  • Game loop: separate input handling, game state update, and rendering; use a timer for gravity and handle user input asynchronously.
  • Trade-offs: discuss using a simple 2D array vs. more complex structures, and the impact on performance and code clarity.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.