← Asana Interview Insights

Asana·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Asana software engineering interview with a puzzle assembly problem that felt more involved than I expected. The core challenge was about spatial reasoning and graph-like matching, not just raw coding speed.

Questions Asked (1)

Q1

Given a set of 2D jigsaw puzzle pieces where each piece has edge descriptors for its four sides, assemble them into a valid grid so that all adjacent edges match correctly.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

My first instinct was to treat it like a graph problem and I spent too long thinking about it that way before realizing a hash map keyed on edge descriptors was way cleaner.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem constraints (e.g., grid dimensions, edge descriptor types, uniqueness of pieces) and then propose a backtracking algorithm that places pieces one by one, checking edge compatibility with already placed neighbors. Discuss how to optimize with pruning, memoization, or constraint propagation, and analyze time/space complexity.

Pro tip: Demonstrate awareness of real-world trade-offs by mentioning that while backtracking is straightforward, it can be exponential; propose heuristics like most-constrained-first or using a hash map for edge matching to improve performance.

1. Clarify requirements and constraints

Ask about grid size, edge descriptor format (e.g., colors, shapes), whether pieces can be rotated, and if a unique solution exists. This ensures you understand the problem scope.

2. Choose an algorithmic approach

Propose backtracking as a baseline, explaining how to recursively place pieces and check compatibility with left and top neighbors. Mention alternative approaches like constraint satisfaction or exact cover if applicable.

3. Optimize with data structures and pruning

Suggest using a hash map to index pieces by edge descriptors for O(1) lookups, and apply pruning by placing pieces with fewer compatible options first (most-constrained-first heuristic).

4. Analyze complexity and trade-offs

Discuss worst-case time complexity (e.g., O(N! * 4^N) for N pieces) and space complexity, and compare with alternative algorithms like SAT solvers or dynamic programming if the grid is small.

5. Test and validate

Outline how to test the solution with small cases, edge cases (e.g., no solution), and verify correctness by checking all adjacent edges after assembly.

Key Points to Mention

  • Backtracking with recursive placement and edge compatibility checks
  • Use of hash maps to quickly find matching pieces by edge descriptors
  • Pruning strategies like most-constrained-first to reduce search space
  • Time and space complexity analysis, including worst-case exponential behavior
  • Handling rotations if pieces can be rotated (multiply edge descriptors)
  • Comparison with alternative approaches (e.g., constraint satisfaction, exact cover)

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