← Qualcomm Interview Insights

Qualcomm·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jul 2026

Summary

Qualcomm Software Engineer interview with a coding round focused on graph traversal and pathfinding. The problem was meatier than typical leetcode fare, asking for a full A* implementation with path reconstruction and complexity analysis.

Questions Asked (1)

Q1

Implement A* search in C++ to find the shortest path through a 2D grid maze from a start cell S to a target cell T, where walls are marked with '#' and open cells with '.'. Return the minimum distance and the actual path as coordinates. Handle the case where no path exists.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This one took me a minute to settle into.

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. Discuss trade-offs such as heuristic admissibility, memory usage, and handling of no-path cases.

Pro tip: Mention that you would use a consistent heuristic (e.g., Manhattan distance for 4-directional movement) to guarantee optimality and avoid reopening nodes, and that you would test with edge cases like start == target and unreachable target.

1. Clarify requirements and constraints

Ask about grid dimensions, allowed moves (4 or 8 directions), whether diagonal moves have cost sqrt(2), and if the grid can be modified. This ensures you design the correct solution.

2. Choose data structures and heuristic

Use a priority queue for the open set, a 2D array for g-scores, and a parent map for path reconstruction. Select an admissible heuristic like Manhattan or Euclidean distance based on movement rules.

3. Implement A* search

Initialize open set with start node, g(start)=0, f(start)=h(start). While open set not empty, pop node with lowest f; if it's the target, reconstruct path; otherwise, expand neighbors, update g and f if a better path is found, and push to open set.

4. Handle no-path and reconstruct path

If open set empties without reaching target, return no path. Otherwise, backtrack from target using parent pointers to build the path as a list of coordinates.

5. Analyze complexity and trade-offs

Discuss time and space complexity (O(b^d) worst-case, but better with good heuristic), and compare A* to BFS/Dijkstra. Mention memory optimizations like using a binary heap or bidirectional search.

Key Points to Mention

  • Admissible and consistent heuristic (e.g., Manhattan distance for 4-directional movement) ensures optimality.
  • Use of priority queue (min-heap) for efficient selection of the next node to expand.
  • Path reconstruction via parent pointers and handling of no-path scenario.
  • Time and space complexity analysis, including best and worst cases.
  • Trade-offs: A* vs BFS/Dijkstra, memory usage, and heuristic impact on performance.
  • Edge cases: start equals target, unreachable target, and large grids.

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