PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Liftoff

Design and implement core Tetris game logic

Last updated: Mar 29, 2026

Quick Overview

This question evaluates practical implementation skills in game logic, real-time state and event management, piece rotation and movement handling, line-clearing algorithms, and clean, testable code organization.

  • medium
  • Liftoff
  • Software Engineering Fundamentals
  • Software Engineer

Design and implement core Tetris game logic

Company: Liftoff

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

Implement the core logic of the Tetris game in a way that can run in a terminal (no graphical UI required). Requirements: - Board/grid: standard size `width = 10`, `height = 20`. - Pieces: the 7 tetrominoes `I, O, T, S, Z, J, L`. - Support piece rotation, left/right movement, soft drop, hard drop. - Gravity: the active piece moves down periodically; when it can’t move down, it locks into the board. - Line clears: when a row is full, remove it and shift rows above down. - End condition: game over when a new piece cannot be spawned. Deliverable: - A cleanly structured implementation with a simple terminal loop (text rendering is fine) or an API that a terminal loop can call. - Emphasis on correctness and code organization (testability), not fancy UI. Clarifications you may decide and document: - Rotation system (e.g., simple wall kicks vs none) - Scoring rules (can be simplified) - Random piece generation (e.g., 7-bag vs uniform random)

Quick Answer: This question evaluates practical implementation skills in game logic, real-time state and event management, piece rotation and movement handling, line-clearing algorithms, and clean, testable code organization.

Liftoff logo
Liftoff
Feb 26, 2026, 12:00 AM
Software Engineer
Onsite
Software Engineering Fundamentals
2
0

Implement the core logic of the Tetris game in a way that can run in a terminal (no graphical UI required).

Requirements:

  • Board/grid: standard size width = 10 , height = 20 .
  • Pieces: the 7 tetrominoes I, O, T, S, Z, J, L .
  • Support piece rotation, left/right movement, soft drop, hard drop.
  • Gravity: the active piece moves down periodically; when it can’t move down, it locks into the board.
  • Line clears: when a row is full, remove it and shift rows above down.
  • End condition: game over when a new piece cannot be spawned.

Deliverable:

  • A cleanly structured implementation with a simple terminal loop (text rendering is fine) or an API that a terminal loop can call.
  • Emphasis on correctness and code organization (testability), not fancy UI.

Clarifications you may decide and document:

  • Rotation system (e.g., simple wall kicks vs none)
  • Scoring rules (can be simplified)
  • Random piece generation (e.g., 7-bag vs uniform random)

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Liftoff•More Software Engineer•Liftoff Software Engineer•Liftoff Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 8,500+ 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.