Design a ride-sharing app
A ride-sharing backend is two systems with opposite needs, a firehose of disposable driver locations and a small number of trips that must never be lost or double-booked. This works it in interview order, sizes the location stream, builds the grid search that finds nearby drivers, and makes matching safe with one offer at a time and a short lock per driver.
What you'll be able to do
- Size the driver location stream and argue from the numbers that it belongs in memory, not in a durable database
- Implement a grid-based nearest-driver search and state the stopping rule that makes it exact
- Design matching that offers a ride to one driver at a time and cannot assign a driver twice
- Persist the trip as a state machine with conditional transitions, separate from the location data
- Explain how the system is partitioned by geography and what goes wrong at the edges
Before this: proximity-search, contention-and-locking
Log in to read the rest of this lesson
A ride-sharing backend is two systems with opposite needs, a firehose of disposable driver locations and a small number of trips that must never be lost or double-booked. This works it in interview order, sizes the location stream, builds the grid search that finds nearby drivers, and makes matching safe with one offer at a time and a short lock per driver. This walkthrough runs about 28 minutes, with runnable code you can edit and re-run as you read. A new account gets 7 days of Pro free, no card required.
Log in to continueThe first module of every track is free to read on the web: see what's open in System design.