← Qualcomm Interview Insights

Qualcomm·Software Engineer·Technical Phone Screen·Senior

SeniorPrefer not to say
May 2026

Summary

Qualcomm GPU Engineer interview had at least one algorithmic problem that went deeper than I expected. They wanted a full A* implementation on a grid maze, not just pseudocode, and the follow-up questions on heuristic correctness caught me a bit flat-footed.

Questions Asked (1)

Q1

Implement A* search to find the shortest path through a 2D grid maze, where some cells are walls. Return the path as a list of cells, or indicate that no path exists.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I started fine with the priority queue and g/h/f setup, but fumbled a bit when they asked me to justify why Manhattan distance is admissible for 4-connected movement specifically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem constraints (grid size, movement allowed, heuristic choice) and then outline the A* algorithm: maintain open and closed sets, use a priority queue ordered by f = g + h, and reconstruct the path via parent pointers. Emphasize the importance of an admissible heuristic (e.g., Manhattan distance for 4-directional movement) and discuss trade-offs like memory usage and performance.

Pro tip: Mention that for large grids, using a binary heap for the open set and a hash set for the closed set optimizes performance, and consider bidirectional A* if the search space is huge. Also, note that A* is optimal only if the heuristic is admissible and consistent.

1. Clarify requirements and constraints

Ask about grid size, movement directions (4 or 8), whether diagonal moves have different costs, and if the heuristic must be admissible. Confirm the output format (list of cells or null).

2. Define data structures and heuristic

Choose a priority queue (min-heap) for the open set, a set for closed nodes, and a dictionary for g-scores and parent pointers. Select an appropriate heuristic (e.g., Manhattan distance for 4-directional, Euclidean or Chebyshev for 8-directional).

3. Implement the A* loop

While the open set is not empty, pop the node with lowest f-score. If it's the goal, reconstruct and return the path. Otherwise, for each valid neighbor, compute tentative g-score and update if better than existing.

4. Handle edge cases and reconstruct path

If the open set empties without reaching the goal, return no path. Reconstruct the path by following parent pointers from the goal back to the start, then reverse it.

5. Analyze complexity and trade-offs

Discuss time and space complexity (O(b^d) worst-case, but often much better with a good heuristic). Mention alternatives like BFS for unweighted grids or Dijkstra's algorithm, and when A* is preferable.

Key Points to Mention

  • Admissible and consistent heuristic (e.g., Manhattan distance for 4-directional movement)
  • Priority queue implementation (binary heap) and efficient membership checks (hash set)
  • Path reconstruction using parent pointers
  • Handling of edge cases: start equals goal, no path exists, invalid inputs
  • Time and space complexity analysis, and comparison with BFS/Dijkstra
  • Optimizations: bidirectional search, tie-breaking in priority queue, memory management

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