PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Software Engineering Fundamentals/Asana

Design a 2048 Game

Last updated: May 23, 2026

Quick Overview

This question evaluates object-oriented design, state management, and algorithmic logic for implementing game mechanics such as tile movement, merging rules, score tracking, spawning behavior, and win/game-over detection.

  • medium
  • Asana
  • Software Engineering Fundamentals
  • Software Engineer

Design a 2048 Game

Company: Asana

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Onsite

Design the object model and core logic for a 2048 game on an `N x N` grid. Requirements: - Initialize a board with two random tiles. - Support moves in four directions: up, down, left, and right. - Implement the standard slide and merge rules. - Update the score when tiles merge. - Spawn a new tile only after a valid move changes the board. - Detect win and game-over states. - Keep UI concerns separate from game logic. Optional extensions: support undo, custom board sizes, deterministic tests, and configurable tile-spawn probabilities.

Quick Answer: This question evaluates object-oriented design, state management, and algorithmic logic for implementing game mechanics such as tile movement, merging rules, score tracking, spawning behavior, and win/game-over detection.

Related Interview Questions

  • Explain code complexity and design two games - Asana (medium)
  • Design a jigsaw puzzle (OOD) - Asana (medium)
  • Find frequent IPs from a huge file - Asana (medium)
Asana logo
Asana
Apr 2, 2026, 12:00 AM
Software Engineer
Onsite
Software Engineering Fundamentals
0
0

Design the object model and core logic for a 2048 game on an N x N grid.

Requirements:

  • Initialize a board with two random tiles.
  • Support moves in four directions: up, down, left, and right.
  • Implement the standard slide and merge rules.
  • Update the score when tiles merge.
  • Spawn a new tile only after a valid move changes the board.
  • Detect win and game-over states.
  • Keep UI concerns separate from game logic.

Optional extensions: support undo, custom board sizes, deterministic tests, and configurable tile-spawn probabilities.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Asana•More Software Engineer•Asana Software Engineer•Asana Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

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