← Asana Interview Insights

Asana·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Jun 2026

Summary

Asana system design round for a software engineer role, focused entirely on object-oriented design for a jigsaw puzzle game. Pretty deep dive, more than I expected from what sounds like a toy problem.

Questions Asked (4)

Q1

Design the core classes for a jigsaw puzzle game. Walk through Puzzle, Piece, Edge/Side, and Board, including how pieces represent their four sides and how the assembled board is structured.

System DesignData ModelingTechnical Trade-offs
Author's notes

I started with Piece and worked outward, which felt natural but I think I spent too long on the class hierarchy before touching the board structure.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints (e.g., puzzle size, rotation, snapping behavior) before diving into class design. Then define the core classes with their responsibilities and relationships, focusing on how pieces represent their four sides and how the board manages placement. Finally, discuss trade-offs and potential extensions to show depth.

Pro tip: Emphasize immutability and value objects for edges/sides to simplify equality and hashing, which is crucial for matching pieces. Also, consider using a coordinate system for the board that allows efficient neighbor lookup.

1. Clarify Requirements and Assumptions

Ask about puzzle size, whether pieces can rotate, if the game is physical or digital, and any performance constraints. State your assumptions clearly.

2. Define Core Classes and Responsibilities

Identify Puzzle, Piece, Edge/Side, and Board. Describe what each class represents and its main responsibilities, keeping single responsibility principle in mind.

3. Model Piece Sides and Matching Logic

Explain how each piece has four sides (top, right, bottom, left), each represented by an Edge object that encodes shape (tab/blank/flat) and possibly color/pattern. Describe how matching works between adjacent edges.

4. Design Board Structure and Placement

Describe how the board is structured (e.g., 2D grid) and how pieces are placed, including how to check for valid placement and detect completion.

5. Discuss Trade-offs and Extensions

Talk about design trade-offs (e.g., immutability vs mutability, memory vs speed) and potential extensions like rotation, hints, or saving state.

Key Points to Mention

  • Edge/Side as a value object with type (flat, tab, blank) and possibly a unique identifier for matching.
  • Piece has four edges and an orientation (if rotation allowed), and may store its current position on the board.
  • Board as a 2D grid or sparse map of positions to pieces, with methods to place, remove, and check completion.
  • Matching logic: adjacent edges must be complementary (tab fits blank) and of the same pattern/color.
  • Immutability of edges and pieces to simplify equality and hashing, enabling efficient matching.
  • Trade-offs: using a matrix vs sparse representation for the board; handling rotation; performance considerations for large puzzles.

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

Q2

How would you determine if two puzzle pieces are compatible with each other? What does that compatibility check look like in code?

Algorithms & Data StructuresSystem Design
Author's notes

This is where I fumbled a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the puzzle piece representation and compatibility criteria (e.g., edge shapes, colors, orientation). Then describe a systematic check that compares the relevant attributes, and finally outline the code structure for that check, emphasizing efficiency and edge cases.

Pro tip: Mention that compatibility is often not just binary but can be a score or probability, and that precomputing compatibility between all pairs can trade memory for speed in solving algorithms.

1. Clarify assumptions and representation

Ask or state how puzzle pieces are represented (e.g., edges as integers, colors, shapes) and what defines compatibility (e.g., matching edges, complementary shapes).

2. Define compatibility criteria

Specify the exact conditions for two pieces to be compatible, such as edge types matching (tab/hole) and colors aligning, and whether orientation matters.

3. Design the algorithm

Outline a step-by-step procedure to check compatibility, including iterating over edges, comparing attributes, and handling rotations if needed.

4. Write pseudocode or code

Provide a clear code snippet (in a language like Python) that implements the compatibility check, using appropriate data structures and control flow.

5. Discuss complexity and optimizations

Analyze time and space complexity, and mention potential optimizations like precomputation, caching, or indexing by edge type.

Key Points to Mention

  • Data representation of puzzle pieces (e.g., edges as enums, colors as integers)
  • Orientation handling: pieces may need rotation, so compatibility must consider all orientations
  • Edge matching logic: complementary shapes (tab/hole) and color equality
  • Efficiency considerations: O(1) per pair check if edges stored in arrays, or O(k) for k edges
  • Precomputation of compatibility matrix for all pairs to speed up solving
  • Edge cases: boundary pieces with flat edges, missing edges, or wildcard matches

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

Q3

Define the API for the puzzle board: placePiece, removePiece, isComplete, and getNeighbors. What are the method signatures and what does each return?

API & IntegrationsSystem Design
Author's notes

Went fine.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the puzzle domain and constraints (e.g., piece types, board shape, neighbor definition) before defining signatures. Then propose clear, typed method signatures with return values and error handling, explaining the reasoning behind each. Finally, discuss edge cases and how the API supports the overall system design.

Pro tip: Mention that you'd design the API to be idempotent where possible and return rich result objects (e.g., success/failure with reason) rather than just booleans, to make integration and debugging easier.

1. Clarify requirements and domain

Ask questions to understand the puzzle type, board representation, piece constraints, and what 'neighbors' means (e.g., adjacency by edges or corners).

2. Define method signatures

For each method, specify parameters, return types, and any exceptions or error states. Use consistent naming and types (e.g., Piece, Position, boolean).

3. Explain return values and semantics

Describe what each method returns and under what conditions, including success/failure cases and side effects.

4. Discuss edge cases and error handling

Cover scenarios like invalid positions, duplicate placements, removing non-existent pieces, and how the API handles them.

5. Consider extensibility and integration

Mention how the API might evolve (e.g., adding rotation, different board shapes) and how it integrates with other components.

Key Points to Mention

  • Method signatures should use clear types (e.g., boolean placePiece(Piece piece, Position pos)) and return values that indicate success or failure.
  • isComplete should return a boolean indicating whether the puzzle is solved, possibly with a reason if not.
  • getNeighbors should return a collection (e.g., List<Position>) of adjacent positions, considering board boundaries.
  • Error handling: throw exceptions for invalid arguments or return error codes/objects for recoverable failures.
  • Idempotency: placePiece and removePiece should be safe to call multiple times with the same arguments.
  • Thread safety: consider whether the API needs to be thread-safe for concurrent access.

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

Q4

How would you extend this design to support arbitrary puzzle shapes, a hint or auto-solve feature, and multi-player collaborative solving?

System DesignTechnical Trade-offsAdaptability & Ambiguity
Author's notes

The multi-player part caught me a bit flat-footed.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the current design's assumptions and constraints, then systematically address each extension (arbitrary shapes, hint/auto-solve, multi-player) by identifying required abstractions and trade-offs. Propose a modular architecture that separates puzzle representation, solving logic, and collaboration layer, and discuss how to evolve the design incrementally.

Pro tip: Emphasize extensibility and separation of concerns: show how a pluggable shape system and a solver interface can be added without rewriting core logic, and highlight the importance of real-time sync and conflict resolution for multi-player.

1. Clarify Requirements and Constraints

Ask questions to understand the current design, expected scale, latency requirements, and what 'arbitrary shapes' entails (e.g., 2D polygons, 3D, irregular grids).

2. Abstract Puzzle Representation

Propose a generic data model for shapes (e.g., graph-based or polygon mesh) and a pluggable shape registry to decouple puzzle logic from specific geometries.

3. Design Hint and Auto-Solve Features

Outline a solver service with algorithms (e.g., backtracking, constraint propagation) and a hint API that returns partial solutions, considering performance and incremental solving.

4. Enable Multi-Player Collaboration

Introduce a real-time collaboration layer using WebSockets or CRDTs for state sync, with conflict resolution and presence awareness, ensuring consistency across players.

5. Address Trade-offs and Scalability

Discuss trade-offs between generality and performance, and how to scale each component (e.g., sharding solver requests, using pub/sub for collaboration).

Key Points to Mention

  • Use of abstract data types (e.g., graphs) to represent arbitrary shapes and enable generic algorithms.
  • Pluggable architecture with interfaces for shape providers and solvers to allow future extensions.
  • Solver design: choose algorithms based on puzzle type, consider caching and incremental solving for hints.
  • Real-time collaboration: WebSocket vs. polling, CRDTs for conflict-free merging, and operational transforms.
  • Trade-offs: generality vs. performance, consistency vs. availability in multi-player, and cost of auto-solve.
  • Incremental delivery: how to roll out features without disrupting existing users, using feature flags and backward compatibility.

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