def eta(edges, source, targets, directed=True):
Two first-hand phone-screen reports. In one, the interviewer described some semantic-map nodes and asked how to compute the ETA between two given points. The question was vague on purpose: the candidate had to talk it through with the interviewer, make it concrete, then implement it. They read it as a shortest-path problem and wrote Dijkstra, which the interviewer seemed to agree with. The other report calls it a classic Dijkstra question: a start node, some target nodes, the distances between nodes; find the shortest path. That candidate likened it to LeetCode 743 (Network Delay Time).
Part 1 — Travel time between map nodes
Write eta(edges, source, targets, directed=True) -> dict.
edges is a list of (u, v, travel_time) tuples, with travel_time >= 0.targets is a list of nodes. Return {target: shortest travel time} for each one, as a float, or None when the target cannot be reached.directed=True means an edge runs from u to v only (a one-way road); directed=False makes every edge two-way.The function name, the input shapes, None for unreachable and the directed flag are our setup; the reports leave them to the conversation. Settle them with your interviewer first (the clarifications below list the questions).
Two Waymo phone-screen reports. In one, the interviewer gave semantic-map nodes and asked for the ETA between two points, keeping the question vague on purpose; the candidate talked it through, made it concrete, then wrote Dijkstra, which the interviewer seemed to agree with. That candidate passed the screen at a lower level than they applied for. The other report calls it a classic Dijkstra question with a start node and several targets, like LeetCode 743. Neither report describes follow-up questions.
Two first-hand phone-screen reports. In one, the interviewer described some semantic-map nodes and asked how to compute the ETA between two given points. The question was vague on purpose: the candidate had to talk it through with the interviewer, make it concrete, then implement it. They read it as a shortest-path problem and wrote Dijkstra, which the interviewer seemed to agree with. The other report calls it a classic Dijkstra question: a start node, some target nodes, the distances between nodes; find the shortest path. That candidate likened it to LeetCode 743 (Network Delay Time).
Part 1 — Travel time between map nodes
Write eta(edges, source, targets, directed=True) -> dict.
edges is a list of (u, v, travel_time) tuples, with travel_time >= 0.targets is a list of nodes. Return {target: shortest travel time} for each one, as a float, or None when the target cannot be reached.directed=True means an edge runs from u to v only (a one-way road); directed=False makes every edge two-way.The function name, the input shapes, None for unreachable and the directed flag are our setup; the reports leave them to the conversation. Settle them with your interviewer first (the clarifications below list the questions).
| Approach | Notes |
|---|---|
| Bellman-Ford | Handles negative edge weights but runs in O(VE), much slower than Dijkstra for typical non-negative map edge weights. |
| A* Search | Uses a heuristic (e.g., Euclidean distance) to guide search toward a single target faster than Dijkstra, but more complex to implement and heuristic must be admissible. |
| BFS (unweighted graph) | Optimal and simpler if all edges have equal weight, but inapplicable when edges have varying distances/times. |
Interviewer hints: The question is vague on purpose: the candidate has to talk it through with the interviewer and make it concrete before implementing.
What passers do: One candidate talked the deliberately vague prompt through with the interviewer to make it concrete, then wrote Dijkstra, which the interviewer seemed to agree with; they passed the screen, at a lower level than they applied for.
If you have had this round, tell us how close this page was. It is how we keep the pages accurate.