← Intuit Interview Insights

Intuit·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Intuit SWE interview with a grid pathfinding problem that sounds approachable until you actually think about it. The safeness factor framing tripped me up a bit before I got the right direction.

Questions Asked (1)

Q1

Given an n x n grid where some cells contain thieves, find a path from the top-left to the bottom-right corner that maximizes the minimum Manhattan distance from any cell on the path to any thief.

Algorithms & Data Structures
Author's notes

My first instinct was pure BFS and I wasted a few minutes going down that road before realizing I needed to think about this differently.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize this as a maximin path problem and solve it using binary search on the answer combined with BFS/DFS reachability. For a candidate distance D, treat cells with distance to nearest thief < D as blocked and check if a path exists from start to end. Precompute distances to nearest thief using multi-source BFS.

Pro tip: Mention that you would first clarify edge cases (e.g., start or end is a thief, no thieves, multiple thieves) and discuss trade-offs between binary search + BFS and a modified Dijkstra approach. This shows thoroughness and practical engineering judgment.

1. Clarify and Define

Confirm the problem constraints: grid size, thief positions, movement allowed (4-directional?), and what 'distance' means (Manhattan). Ask about edge cases like start/end being thieves or no thieves present.

2. Precompute Thief Distances

Use multi-source BFS from all thief cells to compute the Manhattan distance from every cell to the nearest thief. This gives a distance map in O(n^2) time.

3. Binary Search on Answer

Binary search the maximum possible minimum distance D. For each D, check if there is a path from start to end using only cells with distance >= D.

4. Reachability Check

For a given D, perform BFS/DFS from start to end, only moving through cells with distance >= D. If reachable, D is feasible; otherwise, not.

5. Analyze Complexity and Optimize

Discuss time complexity: O(n^2 log n) for binary search over distances (max distance O(n)) with O(n^2) BFS each. Mention possible optimizations like using union-find or sorting cells by distance.

Key Points to Mention

  • Multi-source BFS to compute distance to nearest thief for all cells.
  • Binary search on the answer (maximin value) with monotonic feasibility.
  • Reachability check using BFS/DFS on cells with distance >= threshold.
  • Time and space complexity analysis: O(n^2 log n) time, O(n^2) space.
  • Edge cases: start/end are thieves, no thieves, multiple thieves, grid boundaries.
  • Alternative approaches: modified Dijkstra (maximize minimum distance) or union-find with sorted cells.

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