Waymo Software Engineer Onsite Coding Questions
14+ questions from real Waymo Software Engineer Onsite Coding rounds, reported by candidates who interviewed there.
What does the Waymo Onsite Coding round test?
The Waymo onsite coding round is the core technical evaluation. Software Engineer candidates typically see 2-3 algorithm and data structure problems. Problems range from medium to hard difficulty, and interviewers evaluate both correctness and code quality.
Top Topics in This Round
Waymo Software Engineer Onsite Coding Questions
Waymo Fulltime Engineering Onsite Interview Experience and Questions
At the end of August, I applied to many micro-enterprises, and then the HR contacted me saying that several hiring managers were interested. I followed up with the group that best matched my backgroun
LeetCode #871: Minimum Number of Refueling Stops. Difficulty: Hard. Topics: Array, Dynamic Programming, Greedy, Heap (Priority Queue). Asked at Waymo in the last 6 months.
LeetCode #1944: Number of Visible People in a Queue. Difficulty: Hard. Topics: Array, Stack, Monotonic Stack. Asked at Waymo in the last 6 months.
#359 Logger Rate Limiter
LeetCode #359: Logger Rate Limiter. Difficulty: Easy. Topics: Hash Table, Design, Data Stream. Asked at Waymo in the last 6 months.
#528 Random Pick with Weight
LeetCode #528: Random Pick with Weight. Difficulty: Medium. Topics: Array, Math, Binary Search, Prefix Sum, Randomized. Asked at Waymo in the last 6 months.
Hi everyone, I have an upcoming onsite interview for a Product Data Scientist role at Waymo. I’d love to hear your thoughts on what my high-level interview strategy should be, key areas to focus on, a
## Problem A "good number" is a positive integer of exactly N digits (no leading zeros) whose digit sum equals a given target S. Count how many such numbers exist. ```python def count_good_numbers(n: int, s: int) -> int: # n: number of digits (1 <= n <= 15) # s: required digit sum (0 <= s <= 9*n) # returns: count of n-digit numbers with digit sum == s pass ``` **Example:** ``` count_good_numbers(2, 5) # Valid: 14, 23, 32, 41, 50 -> 5 count_good_numbers(1, 0) -> 0 # no leading-zero single digit ``` ## Follow-ups 1. What is the recurrence relation for a dynamic programming solution? What is the state? 2. How does the first-digit constraint (no leading zeros) change the DP boundary condition? 3. Can you extend this to count numbers where each digit appears at most once? 4. How would you enumerate (not just count) all good numbers in sorted order efficiently?
Waymo SWE Onsite - Knight Dialer
## Problem Count distinct phone numbers a knight can dial in N moves on a phone keypad, using dynamic programming over valid knight moves. ## Likely LeetCode equivalent LeetCode 935 - Knight Dialer. ## Tags dynamic_programming,math,recursion,swe
## Problem Given a bipartite graph where left nodes are workers and right nodes are tasks, and each edge means a worker can perform that task, find the maximum number of tasks that can be assigned (one task per worker, one worker per task). ```python def max_matching(n: int, m: int, edges: list[tuple[int,int]]) -> int: # n: number of workers (0..n-1) # m: number of tasks (0..m-1) # edges: list of (worker, task) indicating compatibility # returns: size of maximum matching pass def find_matching(n: int, m: int, edges: list[tuple[int,int]]) -> dict[int,int]: # returns: dict mapping worker -> assigned task (only matched workers) pass ``` **Example:** ``` edges = [(0,0),(0,1),(1,1),(2,2)] max_matching(3, 3, edges) -> 3 find_matching(3, 3, edges) -> {0: 0, 1: 1, 2: 2} ``` ## Follow-ups 1. Walk through the augmenting path algorithm. What is its time complexity? 2. How does Hopcroft-Karp improve on the naive augmenting path approach? 3. How would you model task scheduling with deadlines as a maximum matching problem? 4. When might a minimum vertex cover be more useful than maximum matching?
## Problem Find the minimum cost to connect all nodes in a graph, likely a minimum spanning tree problem. ## Likely LeetCode equivalent LC 1584 (Min Cost to Connect All Points) is closely related. ## Tags graph, greedy, minimum-spanning-tree
Waymo SWE Onsite - Next Right Nodes
## Problem Populate each tree node's next pointer to point to the next right node on the same level. ## Likely LeetCode equivalent LC 116 (Populating Next Right Pointers in Each Node) or LC 117. ## Tags binary_tree, BFS, level-order
Rabbit Inbreeding: Model Population Growth Under Constrained Inbreeding Rules
## Problem A rabbit colony starts with one breeding pair. Each month, every mature pair produces one new pair. However, to prevent inbreeding, a pair may not breed with any pair that shares a common ancestor within K generations. Compute the population (number of pairs) after M months. ```python def rabbit_population(months: int, k: int) -> int: # months: total simulation months # k: inbreeding constraint (pairs sharing ancestor within k gens cannot breed) # returns: total number of pairs alive at end of month M pass ``` **Example:** ``` rabbit_population(6, 0) -> 8 # standard Fibonacci (no constraint) rabbit_population(6, 1) -> ? # pairs can't breed with their own offspring ``` ## Follow-ups 1. Without the inbreeding constraint (k=0), what is the recurrence relation and why does it match Fibonacci? 2. How does the inbreeding constraint change the recurrence? 3. How would you represent the ancestry graph to efficiently check whether two pairs share a common ancestor within K generations? 4. At what value of K does the constraint have no further effect on population growth?
## Problem You are given a finite state machine (FSM) defined by a set of states, an alphabet, a transition table, a start state, and a set of accepting states. Given an input string, determine whether the FSM accepts it. Also implement a method that returns all states reachable from the start state. ```python class FSM: def __init__(self, states: set[str], alphabet: set[str], transitions: dict[tuple[str,str], str], # (state, symbol) -> state start: str, accepting: set[str]): ... def accepts(self, input_str: str) -> bool: ... def reachable_states(self) -> set[str]: ... ``` **Example:** ``` # FSM that accepts strings ending in 'b' transitions = {('q0','a'):'q0', ('q0','b'):'q1', ('q1','a'):'q0', ('q1','b'):'q1'} fsm = FSM({'q0','q1'}, {'a','b'}, transitions, 'q0', {'q1'}) fsm.accepts("aab") -> True fsm.accepts("aba") -> False ``` ## Follow-ups 1. How would you convert this DFA to an NFA that accepts the complement language? 2. How do you detect unreachable states and why is removing them useful? 3. How would you implement DFA minimization (merging equivalent states)? 4. What changes are needed to support epsilon transitions (NFA with epsilon)?
Waymo SWE Onsite - Words Filling
## Problem Fit words into lines of a given width, justifying text so words fill each row evenly. ## Likely LeetCode equivalent LC 68 (Text Justification) is closely related. ## Tags strings, greedy, simulation
See All 14 Questions from This Round
Full question text, answer context, and frequency data for subscribers.
Get Access