InterviewDB Question

Closest Bus Stop: Find the Nearest Bus Stop to a Query Point Using Spatial Data

Question Details

Problem Given a list of bus stops with (latitude, longitude) coordinates and a query point, return the ID of the nearest bus stop. Optimize for repeated queries over the same stop dataset. Example: Use Euclidean distance as an approximation (haversine not required). Follow-ups What data structure would you use to answer nearest-neighbor queries sub-linearly? Walk through a k-d tree insertion. When does Euclidean distance fail for geographic coordinates, and how does haversine fix it? If stops ar…

Full Details

🔒

Unlock all Waymo questions

Full insider details, leaked discussions, and candidate experiences.

or every company, $100/year →

About This Question

This is a reported interview question from a waymo interview during the phone round.

It covers the following topics: Coding, Phone .