← Waymo Interview Insights

Waymo·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Waymo SWE interview with a shortest path graph problem. Pretty standard stuff if you've done any LeetCode graph prep, but still worth knowing cold.

Questions Asked (1)

Q1

Given a start node, a set of target nodes, and weighted edges between nodes, find the shortest path from the start to each target.

Algorithms & Data Structures
Author's notes

Classic Dijkstra setup.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints (e.g., graph size, edge weights, whether targets are known upfront) and then propose Dijkstra's algorithm with a priority queue to compute shortest paths from the start node. After computing distances, extract the shortest path to each target, and discuss optimizations like early termination when all targets are reached.

Pro tip: Mention that for multiple targets, you can stop Dijkstra as soon as all targets are settled, and if the graph is static and queries are frequent, precomputing all-pairs shortest paths or using A* with a target-specific heuristic might be more efficient.

1. Clarify requirements and constraints

Ask about graph size, edge weight properties (non-negative?), number of targets, and whether paths need to be reconstructed. This determines algorithm choice and optimizations.

2. Choose the right algorithm

For non-negative weights, Dijkstra with a min-heap is optimal. If weights can be negative, Bellman-Ford is needed. For unweighted graphs, BFS suffices.

3. Implement Dijkstra with early termination

Use a priority queue to explore nodes in increasing distance order. Stop when all target nodes have been finalized to save computation.

4. Reconstruct and return paths

Maintain a predecessor map during Dijkstra to reconstruct the actual path from start to each target, not just the distance.

5. Analyze complexity and discuss trade-offs

State time complexity O((V+E) log V) and space O(V). Discuss alternatives like A* for single target or Floyd-Warshall for dense graphs with many queries.

Key Points to Mention

  • Dijkstra's algorithm with a priority queue (min-heap) for efficiency
  • Early termination when all target nodes are settled
  • Handling non-negative edge weights; negative weights require Bellman-Ford
  • Path reconstruction using a predecessor array
  • Time complexity O((V+E) log V) and space complexity O(V)
  • Alternative approaches: A* with heuristic, bidirectional search, or precomputation for multiple queries

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