← Asana Interview Insights

Asana·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Asana SWE interview with a system design twist. The puzzle solver problem was deceptively open-ended and I spent way too long trying to figure out the grid dimensions before actually writing anything useful.

Questions Asked (1)

Q1

Design a jigsaw puzzle solver. You're given a match(e1, e2) function that tells you whether two edges fit together. The number of rows and columns is unknown. Implement the solve function.

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

The match function being a black box was fine, what tripped me up was not knowing the grid dimensions.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by modeling the puzzle as a graph where each piece has four edges, and use the match function to determine adjacency. Then, build the grid incrementally by finding corner pieces (with two unmatched edges) and extending row by row, using backtracking to handle ambiguities. Finally, analyze time and space complexity and discuss trade-offs between different strategies.

Pro tip: Clarify with the interviewer whether pieces can be rotated and whether the match function is symmetric and transitive; these assumptions drastically affect the algorithm's complexity and correctness.

1. Clarify assumptions and constraints

Ask about rotation, match function properties (symmetric, transitive), piece uniqueness, and input format. This ensures you solve the correct problem and avoids wasted effort.

2. Model the problem as a graph

Represent each piece as a node with four labeled edges (top, right, bottom, left). Use the match function to define compatibility between edges, forming a graph where edges represent possible connections.

3. Identify corners and boundaries

Find pieces with two unmatched edges (corners) and pieces with one unmatched edge (edges). Use these to anchor the grid and determine its dimensions by counting pieces or extending from corners.

4. Build the grid incrementally with backtracking

Start from a corner, place pieces row by row, using match to find compatible neighbors. If multiple candidates exist, use backtracking to explore possibilities until a consistent grid is formed.

5. Analyze complexity and discuss optimizations

Evaluate time and space complexity, considering worst-case scenarios. Discuss optimizations like caching match results, using heuristics to prioritize candidates, or parallelizing the search.

Key Points to Mention

  • Graph representation of pieces and edges
  • Handling unknown dimensions by detecting corners and boundaries
  • Backtracking for ambiguous matches
  • Time and space complexity analysis
  • Trade-offs between greedy placement and exhaustive search
  • Assumptions about rotation and match function properties

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