← Waymo Interview Insights

Waymo·Data Scientist·Technical Phone Screen·Senior

SeniorPrefer not to say
May 2026

Summary

Waymo data scientist interview with a pretty heavy computational geometry problem. Not what I expected going in, felt more like a physics/algorithms hybrid than anything data-sciency.

Questions Asked (4)

Q1

Given n cars on a 1D road, each with an initial position, velocity, constant acceleration, and a physical radius, determine whether any two cars collide for t >= 0. If a collision exists, return the earliest collision time and the pair involved.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The math itself isn't too bad once you set it up.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model each car's position as a quadratic function of time and reduce the collision condition to solving a quadratic inequality for each pair. Use a sweep-line or priority queue to efficiently find the earliest collision among all pairs, leveraging the fact that collisions can only occur between adjacent cars in sorted order of position.

Pro tip: Emphasize that in real-world autonomous driving, collision detection must handle numerical precision and edge cases like simultaneous collisions; mentioning robust interval arithmetic or exact rational arithmetic shows depth.

1. Define position functions

For each car i, write its position as x_i(t) = p_i + v_i t + 0.5 a_i t^2, and note that a collision occurs when |x_i(t) - x_j(t)| <= r_i + r_j for some t >= 0.

2. Reduce to pairwise quadratic inequalities

For each pair (i, j), form the relative position d(t) = x_i(t) - x_j(t) and solve the quadratic inequality |d(t)| <= r_i + r_j, which yields at most two time intervals; find the earliest t >= 0 where any interval is non-empty.

3. Optimize with spatial ordering

Sort cars by initial position and argue that collisions can only occur between cars that become adjacent in the sorted order; use a sweep-line or priority queue to process events (collisions) in time order, updating neighbors as needed.

4. Handle edge cases and complexity

Discuss cases like zero acceleration, identical trajectories, and simultaneous collisions; analyze time complexity (e.g., O(n log n) with sweep-line) and space complexity, and mention numerical stability considerations.

5. Return earliest collision

Track the minimum collision time and the corresponding pair; if no collision exists, return null or an appropriate indicator.

Key Points to Mention

  • Quadratic position functions and solving for collision times
  • Sweep-line or priority queue for efficient earliest collision detection
  • Adjacency property: only neighboring cars in sorted order can collide
  • Time complexity O(n log n) vs naive O(n^2)
  • Numerical precision and robustness in real-world systems
  • Edge cases: simultaneous collisions, zero acceleration, overlapping initial positions

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

Q2

Extend the collision detection to 2D: each car moves on a flat plane with a 2D position, velocity, and acceleration vector, plus a radius. Find the earliest collision time across all pairs.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

Same quadratic structure as the 1D case, which I was relieved about.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model each car's motion as a quadratic function of time for both x and y coordinates, then for each pair solve for the earliest time when the distance between centers equals the sum of radii. Use a sweep-line or priority queue to efficiently find the global minimum collision time across all pairs.

Pro tip: Mention that you can prune pairs using spatial partitioning (e.g., grid or k-d tree) and that you must handle edge cases like zero relative acceleration and simultaneous collisions.

1. Model motion equations

For each car, express position as a function of time: p(t) = p0 + v0*t + 0.5*a*t^2, separately for x and y.

2. Formulate collision condition

For a pair of cars, the collision occurs when |p_i(t) - p_j(t)| = r_i + r_j. This leads to a quartic equation in t, but can be simplified by considering relative motion.

3. Solve for earliest time per pair

Solve the quartic (or quadratic if acceleration is zero) for t >= 0, and take the smallest valid root. If no real root, no collision.

4. Find global minimum efficiently

Use a priority queue of candidate collision times or a sweep-line over time, updating as cars move, to avoid checking all pairs naively.

5. Handle edge cases and complexity

Discuss numerical stability, simultaneous collisions, and the trade-off between O(n^2) brute force and spatial partitioning for large n.

Key Points to Mention

  • Relative motion: reduce to one car moving relative to another, simplifying the equation.
  • Quartic equation solving: use numerical methods or analytic solutions, and check for multiple roots.
  • Spatial partitioning: use grids, k-d trees, or bounding volume hierarchies to prune pairs.
  • Time complexity: O(n^2) naive vs. O(n log n) with sweep-line and spatial indexing.
  • Edge cases: zero relative acceleration, tangential collisions, and simultaneous collisions.
  • Numerical precision: use epsilon for root finding and avoid floating-point errors.

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

Q3

The naive approach checks all pairs in O(n^2). How would you optimize collision detection for large n, say up to 10^5 cars?

Algorithms & Data StructuresSystem Design
Author's notes

This is where I felt most out of my depth.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem constraints and assumptions (e.g., car shapes, motion model, collision definition). Then, propose spatial partitioning techniques like sweep line, spatial hashing, or quadtree to reduce the number of pairwise checks, achieving O(n log n) or O(n) average time. Finally, discuss trade-offs and potential edge cases.

Pro tip: Mention that in practice, you'd combine broad-phase (spatial partitioning) with narrow-phase (exact collision check) and consider temporal coherence for moving cars, which is crucial for real-time systems like autonomous driving.

1. Clarify problem and constraints

Ask about car representation (bounding boxes, circles), motion (static or moving), and collision definition (overlap, distance threshold). This ensures you optimize for the right scenario.

2. Choose a spatial partitioning method

Select an appropriate data structure: sweep line for static axis-aligned boxes, spatial hashing for uniform distribution, or quadtree/octree for dynamic scenes. Explain why it reduces comparisons.

3. Analyze complexity and scalability

Derive time and space complexity. For sweep line, O(n log n) sorting plus O(n + k) where k is number of intersecting pairs. For spatial hashing, average O(n) but worst-case O(n^2).

4. Address moving cars and temporal aspects

For moving cars, discuss using bounding volume hierarchies (BVH) or spatial partitioning updated per frame, and leveraging temporal coherence to avoid full rebuilds.

5. Discuss trade-offs and practical considerations

Compare methods: sweep line is simple but static; spatial hashing is fast for uniform density but sensitive to cell size; quadtree adapts to density but has overhead. Mention parallelization and GPU acceleration if relevant.

Key Points to Mention

  • Sweep line algorithm for static collision detection
  • Spatial hashing with appropriate cell size
  • Quadtree/octree for non-uniform distributions
  • Broad-phase vs narrow-phase collision detection
  • Temporal coherence for moving objects
  • Complexity analysis: O(n log n) vs O(n) average vs O(n^2) worst-case

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

Q4

How do you handle the edge case where two cars have identical trajectories and overlap for an entire time interval rather than a single point?

Algorithms & Data Structures
Author's notes

Blanked on this for a second.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the problem: two cars with identical trajectories overlapping for an entire interval means their paths are identical over a continuous range of time, not just a single point. Then discuss how to detect and handle such overlaps, focusing on robust algorithms and safety-critical decision-making.

Pro tip: Emphasize that in autonomous driving, overlapping trajectories for an interval indicate a fundamental ambiguity that must be resolved by considering additional context (e.g., sensor data, map priors) and that safety requires conservative assumptions.

1. Clarify the scenario

Define what it means for two cars to have identical trajectories over an interval: their position, velocity, and heading are the same for all times in that interval. This implies they are effectively occupying the same space-time volume.

2. Detect the overlap

Explain how to computationally detect such an overlap: compare trajectory representations (e.g., polynomials, splines) and check for equality over an interval, not just at discrete points. Use interval arithmetic or symbolic comparison.

3. Assess implications

Discuss why this is problematic: it violates the assumption of distinct objects, leads to undefined relative positioning, and can cause collisions or planning failures. In safety-critical systems, this must be flagged as an anomaly.

4. Resolve the ambiguity

Propose solutions: use additional sensor data (e.g., LiDAR, camera) to disambiguate, apply map priors (e.g., lane assignments), or assume worst-case (e.g., treat as a single obstacle) and plan conservatively.

5. Implement safeguards

Suggest algorithmic safeguards: maintain a small epsilon tolerance for trajectory equality, use robust tracking with unique IDs, and incorporate redundancy in perception to prevent such overlaps from occurring.

Key Points to Mention

  • Trajectory representation: parametric curves, time-parameterized paths, and how to compare them.
  • Interval overlap detection: methods like interval arithmetic, polynomial equality, or sampling with bounds.
  • Safety-critical implications: need for conservative planning and anomaly detection.
  • Sensor fusion and tracking: using multiple modalities to maintain distinct object identities.
  • Map priors and contextual information: lane geometry, traffic rules to infer correct behavior.
  • Robustness: epsilon tolerance, handling numerical precision issues, and fallback strategies.

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