Question
Design the core dispatch/matching service of a ride-hailing platform that pairs a ride request with the best driver. Requests and drivers are geographically distributed across many cities; a city at peak handles ~10k requests/minute. A match must be made in a few seconds, a driver must never be double-booked, and matching should consider ETA-to-pickup, driver acceptance likelihood, and global efficiency (not just greedy nearest). Describe the regional sharding, the candidate-selection and matching logic, the concurrency control that prevents double-booking, and the trade-off between instant greedy matching and short batched matching windows.
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.