← 返回博客列表
Waymo

Waymo VO Problem: When Does Road Coverage First Become Complete?

2026-04-07

Waymo Interview Recap

Waymo interview problems often have a very recognizable pattern: the surface statement does not look too intimidating, but if you follow the first intuitive idea too literally, you can end up building a solution that feels locally reasonable and globally unsafe.

This problem is a good example.

A more Waymo-style way to describe it is:

the system monitors a target stretch of road represented by a closed interval [roadStart, roadEnd].
Meanwhile, it receives a sequence of observed road segments, each also represented as a closed interval [segmentStart, segmentEnd].

These segments arrive one by one, in fixed order, and cannot be reordered.

The question is:

after which segment does the union of all observed coverage inside the target road fully contain the entire target interval for the first time?

If the target road is never fully covered, return -1.


The easiest way to misread the problem

A very common first instinct is:

That certainly works in principle, but once the number of intervals grows, repeatedly re-merging everything becomes too expensive.

And in an interview, this is exactly where you are likely to get asked:

can we do better than re-merging everything after every new segment?

The most important complication is not interval merging by itself. It is this:

the arrival order is fixed, so sorting is not allowed.

That immediately kills many otherwise natural offline ideas.


The right clarification questions matter

This problem is especially good for early clarification, because a few small details have a big effect on the solution model.

Typical useful questions are:

The crucial clarification is usually:

segments may extend outside the target road, and only the intersection with the target interval matters.

That means the part outside the road is irrelevant. Only the overlap with [roadStart, roadEnd] contributes to the answer.

Once that is established, the state you maintain becomes much cleaner.


Why “just keep extending the current right boundary” is not robust

A tempting lighter-weight idea is:

This works on nicely ordered inputs, but it has a structural weakness:

it assumes useful intervals arrive in an order that supports one-directional extension.

In reality, the order is fixed and may be messy.

For example:

If you only track a single currently extendable boundary, the first segment looks useless from the left edge, the second only gets you to 10, and only the third suddenly closes the gap.

That tells you something important:

Therefore this is not a one-boundary greedy problem.


The stable model: maintain the merged covered intervals dynamically

The robust way to think about the problem is as an online dynamic interval-merging task.

Every time a new segment arrives:

  1. clip it to the target road
  2. merge it into the current set of already covered disjoint intervals

The key is that you do not maintain all historical raw intervals. You maintain:

the current disjoint merged intervals representing actual covered portions of the target road

That solves the ordering issue, because:

So the maintained state is the merged result, not the raw input history.


Why clipping first matters

This step is easy to gloss over, but it is worth stating explicitly in an interview.

If an incoming segment lies:

then the only relevant part is its intersection with the target road.

So for each segment, you can compute:

If the clipped left side is greater than the clipped right side, that segment contributes nothing and can be ignored.

This keeps every later operation focused only on meaningful coverage.


The core of dynamic merging

Assume the current covered state is stored as a set of disjoint intervals ordered by start.

When a new effective segment arrives, you want to:

Because the intervals are closed, endpoint-touching intervals should count as connected coverage. For example:

already form continuous coverage and should merge.

That is why the merge condition is not just strict overlap, but overlap-or-touch.

This is what makes the problem feel more like an online systems problem than a textbook offline merge-intervals exercise.


When can we return the answer?

The problem asks:

at what index does complete coverage happen for the first time?

So after each insertion and merge, the only thing you need to check is whether there exists a merged interval whose:

Once that happens, the current segment index is the answer.

There is no need to compute total covered length.

Even if the total length appears sufficient, there may still be gaps. What matters is whether the merged state now contains one continuous block spanning the whole target interval.


Why this is better than full re-merge every time

If you sort and merge all historical intervals after every new segment, the cost grows quickly.

If instead you maintain:

then each new segment only interacts with nearby intervals in the ordered structure.

That is the real optimization: you keep the state in compressed merged form at all times.

A natural implementation vehicle is:

In an interview, the exact library choice matters less than making the state-maintenance idea completely clear.


Typical follow-up directions

Follow-up 1: what if there are millions of incoming segments?

This is usually checking whether your method still depends on full recomputation.

If you have already switched to maintaining merged disjoint intervals, the answer becomes natural:

Follow-up 2: what if reordering were allowed?

Then the problem collapses into a classic interval coverage problem.

Once sorting is allowed, you can:

with complexity around O(n log n).

Follow-up 3: what if the problem becomes two-dimensional?

This is a common pressure question.

Once intervals become rectangles, the problem is no longer simple interval merging. Complexity grows significantly.

A natural extension direction would be:

In other words, reduce the 2D coverage logic into a 1D dynamic maintenance problem during the sweep.

You do not need to fully solve the 2D version, but you should show that you understand why the 1D solution does not transfer directly.


What Waymo is really testing here

This looks like an interval problem, but it is really testing whether you know how to maintain evolving state online.

The core is not:

The core is:

That is a very common shape for Waymo-style questions:

So this is not about who has memorized more problems. It is about who can recognize that this is an online coverage problem, not a static interval problem.


Final Takeaway

The most important thing to remember is not just “which segment finally covers the road,” but the structure underneath it:

Once that is recognized, the stable solution is no longer a single-boundary greedy extension. It becomes:

If you are preparing for Waymo or similar VO rounds, this category of “online interval-state maintenance” is very worth practicing. It exposes very quickly whether someone is applying templates or actually understanding the problem structure.


🚀 oavoservice: Stable Support for Your Waymo VO

If you have upcoming Waymo, Google, Apple, LinkedIn, or Amazon VO rounds, practicing these real question patterns and follow-up structures in advance can make a huge difference.

We provide:

Real-time big tech VO support — coding, BQ, and system design assistance throughout
Real-question mock sessions — as close as possible to actual interview pacing
High-pressure follow-up training — not just the first answer, but staying stable under pushback
Long-form modeling practice — helping you quickly translate business-flavored statements into solvable structures

If you want feedback that feels close to the real interview environment, feel free to reach out.

👉 Add WeChat now: Coding0201

Telegram: @OAVOProxy
Gmail: [email protected]