advanced practice · system design prompt
Ride-sharing dispatch
Design driver-rider matching: rider requests, dispatch finds the nearest available driver, ETA + price quoted, ride lifecycle. Address geo-indexing and surge.
The mechanism
Geo systems need a spatial index (geohash, S2, quadtree) to answer "nearest" queries quickly. Driver-location updates are write-heavy, so the storage has to handle that. Remember: nearest in distance is not always best in ETA — match on the metric that actually matters.
Expected evidence
Geo index choice (geohash / S2 / quadtree) + the dispatch decision loop.
Try this drill in the practice workspace →
Hints when you need them
- Nearest is rarely best — factor ETA, not just distance.
- Driver state updates are write-heavy; pick a store that handles that.