Case study: design a ride-hailing service
Interview question: design a ride-hailing app. A rider taps a button and a nearby driver arrives within minutes, while a million drivers' phones report where they are every few seconds. How do you find the right driver, fast, without ever giving one driver two trips?
In this lesson you'll learn to
- Turn the ride-hailing question into requirements and numbers, and see that location writes dominate the load.
- Ingest location updates at scale into an in-memory geospatial index of cells, sharded by city, and explain why that state can be lost.
- Match riders to drivers by searching nearby cells and ranking by ETA, claim drivers atomically, and price surge per cell with a quote.
- Keep trip state strongly consistent with a state machine and conditional updates, while location data stays eventually consistent.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.