PracHub
QuestionsCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Asana

Design an Extensible Animal-Chess Game Engine

Last updated: Jul 18, 2026

Quick Overview

Design an extensible object-oriented engine for a turn-based animal-chess game whose concrete rules arrive separately. Separate immutable state, move validation, rule components, turn orchestration, persistence, concurrency, and deterministic replay.

  • medium
  • Asana
  • Software Engineering Fundamentals
  • Software Engineer

Design an Extensible Animal-Chess Game Engine

Company: Asana

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Technical Screen

# Design an Extensible Animal-Chess Game Engine Design an object-oriented engine for a two-player, turn-based animal-chess game. The interviewer will supply the concrete board layout and rule table: piece ranks, legal movement, captures, terrain effects, and terminal conditions. Your engine must represent a game, validate and apply moves, expose immutable board state to callers, and make it possible to add or revise rules without rewriting storage or turn management. Pseudocode is sufficient. Explain the responsibilities of the main classes and walk through one move from request to committed state. ### Constraints & Assumptions - A move must be validated against one consistent game-state version. - Invalid moves do not mutate state or advance the turn. - Callers must not be able to modify internal board data through a returned object. - Concrete animal abilities should be data or rule components rather than a large switch spread across the codebase. ### Clarifying Questions to Ask - Is local play enough, or must the design persist multiple concurrent games? - Are undo, replay, clocks, or spectators required? - Which rules depend on terrain, piece type, or recent move history? - Must the engine support variants with different boards or win conditions? ### What a Strong Answer Covers - Clear separation among game state, rule evaluation, move orchestration, and persistence - Invariants for turns, occupancy, captures, and terminal games - Extensibility without making every piece responsible for global rules - Safe state exposure, test seams, and deterministic replay - Appropriate data structures and complexity for move validation ### Follow-up Questions - How would you add a piece whose move spans several squares? - How would you make two simultaneous move requests safe? - What belongs in a `Piece` class versus a rule service? - How would you reconstruct a game for debugging?

Quick Answer: Design an extensible object-oriented engine for a turn-based animal-chess game whose concrete rules arrive separately. Separate immutable state, move validation, rule components, turn orchestration, persistence, concurrency, and deterministic replay.

Related Interview Questions

  • Model and Solve a Rectangular Jigsaw Puzzle - Asana (medium)
  • Design a Testable 2048 Game Engine - Asana (medium)
  • Design and Solve a Rotatable Jigsaw Puzzle - Asana (medium)
  • Design a 2048 Game - Asana (medium)
|Home/Software Engineering Fundamentals/Asana

Design an Extensible Animal-Chess Game Engine

Asana logo
Asana
Jul 16, 2026, 12:00 AM
mediumSoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
2
0

Design an Extensible Animal-Chess Game Engine

Design an object-oriented engine for a two-player, turn-based animal-chess game. The interviewer will supply the concrete board layout and rule table: piece ranks, legal movement, captures, terrain effects, and terminal conditions. Your engine must represent a game, validate and apply moves, expose immutable board state to callers, and make it possible to add or revise rules without rewriting storage or turn management.

Pseudocode is sufficient. Explain the responsibilities of the main classes and walk through one move from request to committed state.

Constraints & Assumptions

  • A move must be validated against one consistent game-state version.
  • Invalid moves do not mutate state or advance the turn.
  • Callers must not be able to modify internal board data through a returned object.
  • Concrete animal abilities should be data or rule components rather than a large switch spread across the codebase.

Clarifying Questions to Ask

  • Is local play enough, or must the design persist multiple concurrent games?
  • Are undo, replay, clocks, or spectators required?
  • Which rules depend on terrain, piece type, or recent move history?
  • Must the engine support variants with different boards or win conditions?

What a Strong Answer Covers

  • Clear separation among game state, rule evaluation, move orchestration, and persistence
  • Invariants for turns, occupancy, captures, and terminal games
  • Extensibility without making every piece responsible for global rules
  • Safe state exposure, test seams, and deterministic replay
  • Appropriate data structures and complexity for move validation

Follow-up Questions

  • How would you add a piece whose move spans several squares?
  • How would you make two simultaneous move requests safe?
  • What belongs in a Piece class versus a rule service?
  • How would you reconstruct a game for debugging?
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

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding 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.