ProblemReal-time and messaging
Ride dispatch
Match riders with nearby drivers in seconds while every driver on the road reports where they are.
The brief
Ride-hailing app · suggested for Senior
Design ride dispatch for a ride-hailing app
Design the dispatch core of an Uber-style ride-hailing app: track drivers’ positions, match each ride request to a nearby driver, and follow the trip to drop-off.
A ride-hailing app runs in about 300 cities, served from six cloud regions, two in each of the Americas, Europe and Asia-Pacific. Drivers go online in the driver app, which sends the phone’s position every 4 seconds while they are online. A rider sets a pickup and a destination, sees a price and an estimated pickup time, and requests a ride. A nearby driver gets the offer and has 15 seconds to accept or decline it. Once a driver accepts, the rider watches the car approach on a map; the driver marks arrival, starts the trip at pickup and ends it at drop-off, and the rider’s saved card is charged. Road ETAs and routes come from an existing maps service, and card payments go through an existing payments service. Design the dispatch system, from a driver’s position updates to a matched, tracked and paid trip.
Functional requirements
- CoreDrivers go online and offline in the driver app; while online, the app sends the phone’s position every 4 seconds.
- CoreA rider sets a pickup and a destination, sees a price and an estimated pickup time, and requests a ride. Prices may rise in an area while riders there outnumber drivers.
- CoreEach request is offered to a nearby available driver, who has 15 seconds to accept or decline it.
- CoreOnce a driver accepts, the rider sees the driver’s position on a map until pickup; the driver marks arrival, starts the trip and ends it at drop-off. Either side can cancel before pickup.
- CoreWhen the trip ends, the rider’s saved card is charged the quoted price through the existing payments service.
Non-functional requirements
- ConsistencyA driver is never on two trips at once, and a trip never has two drivers.
- LatencyMost riders see a driver accept within about 30 seconds of requesting; finding candidate drivers takes well under a second.
- LatencyThe rider’s map shows the driver’s position no more than a few seconds old.
- ConsistencyDrivers who close the app or lose signal are not offered trips.
- DurabilityTrips in progress, and what riders are charged, are never lost.
- AvailabilityA problem in one city or region doesn’t stop ride requests elsewhere, and a region going down stops requests in its cities for minutes at most.
Scale
- ScaleAbout 1 million drivers online at the busiest hour worldwide; the busiest city has about 60,000.
- ScaleAbout 20 million trips a day, and about 1,000 ride requests a second at the global peak.
- ScaleAbout 300 cities, served from six regions: two in each of the Americas, Europe and Asia-Pacific.
- ScaleAfter a big concert, about 8,000 ride requests arrive within 20 minutes from around one stadium, with about 1,000 drivers nearby.
Nice to mention (below the line)
- Below the linePooled rides, where riders share a car.
- Below the lineRides booked in advance.
- Below the lineRatings and tips.
- Below the lineEmailed receipts.
Out of scope
- Out of scopeMaps, routing and turn-by-turn navigation: the maps service returns road ETAs and routes.
- Out of scopeThe payments service’s internals, and paying drivers.
- Out of scopeDriver sign-up, documents and ratings.
- Out of scopeFraud and safety checks.
- Out of scopeHow prices, and their rises in busy areas, are calculated.
The variant
One fully specified brief, with the level it suits best. You can practise it at any level.
- Ride-hailing appSuggested for Senior
A ride-hailing app in about 300 cities: riders request, nearby drivers get offers, and the trip is followed live to drop-off.
9 steps · 7 must-pass · about 46 min at Senior
What each level is graded on
Ride-hailing app, step by step. A result at a level needs its must-pass steps answered, and only the steps you answer count. Going up a level adds steps or holds them to a stricter bar.
| Step | Entry level | Mid-level | Your levelSenior | Staff |
|---|---|---|---|---|
| The numbers that shape the design (optional) | Graded | Graded | Graded | Graded |
| Drivers, riders and the life of a trip | Graded | Must-pass | Must-pass | Must-pass |
| From request to drop-off: the API | Graded | Graded | Graded | Graded |
| The system, end to end | Graded | Must-pass | Must-pass | Must-pass |
| Finding drivers near a pickup | Must-pass | Must-pass | Must-pass | Must-pass |
| Two riders, one driver | Must-passcan block | Must-passcan block | Must-passcan block | Must-passcan block |
| The driver who doesn’t answer | Must-pass | Must-pass | Must-pass | Must-pass |
| A phone in a tunnel | — | Must-pass | Must-pass | Must-pass |
| Everyone leaves the stadium at once | — | — | Must-pass | Must-pass |
| A region goes down on a Friday night | — | — | — | Must-pass |
| At this level | 7 steps 3 must-pass about 35 min | 8 steps 6 must-pass about 40 min | 9 steps 7 must-pass about 46 min | 10 steps 8 must-pass about 52 min |
Entry level7 steps · 3 must-pass · about 35 min
- The numbers that shape the design (optional)Graded
- Drivers, riders and the life of a tripGraded
- From request to drop-off: the APIGraded
- The system, end to endGraded
- Finding drivers near a pickupMust-pass
- Two riders, one driverMust-passcan block
- The driver who doesn’t answerMust-pass
Mid-level8 steps · 6 must-pass · about 40 min
- The numbers that shape the design (optional)Graded
- Drivers, riders and the life of a tripMust-pass
- From request to drop-off: the APIGraded
- The system, end to endMust-pass
- Finding drivers near a pickupMust-pass
- Two riders, one driverMust-passcan block
- The driver who doesn’t answerMust-pass
- A phone in a tunnelMust-pass
SeniorYour level9 steps · 7 must-pass · about 46 min
- The numbers that shape the design (optional)Graded
- Drivers, riders and the life of a tripMust-pass
- From request to drop-off: the APIGraded
- The system, end to endMust-pass
- Finding drivers near a pickupMust-pass
- Two riders, one driverMust-passcan block
- The driver who doesn’t answerMust-pass
- A phone in a tunnelMust-pass
- Everyone leaves the stadium at onceMust-pass
Staff10 steps · 8 must-pass · about 52 min
- The numbers that shape the design (optional)Graded
- Drivers, riders and the life of a tripMust-pass
- From request to drop-off: the APIGraded
- The system, end to endMust-pass
- Finding drivers near a pickupMust-pass
- Two riders, one driverMust-passcan block
- The driver who doesn’t answerMust-pass
- A phone in a tunnelMust-pass
- Everyone leaves the stadium at onceMust-pass
- A region goes down on a Friday nightMust-pass
- Must-pass
- a result at that level needs this step answered.
- Can block
- a miss there is a Blocking issue at that level.
Going up a level
- Mid-level
- “Drivers, riders and the life of a trip” becomes must-pass.“The system, end to end” becomes must-pass.Adds “A phone in a tunnel”, must-pass.
- Senior
- Adds “Everyone leaves the stadium at once”, must-pass.
- Staff
- Adds “A region goes down on a Friday night”, must-pass.
Skills this problem practises
Your coach tracks readiness per skill across every problem you practise. Each links to the lesson that teaches it.
- Capacity estimation
- API design
- Idempotency and retries
- Data modelling
- Choosing storage
- Indexing
- Sharding and partitioning
- High-level architecture
- Queues and async messaging
- Networking and protocols
- Traffic surges and backpressure
- Consistency and concurrency
- Replication and durability
- Failure modes and recovery
Worked solution
Try it first: practise a variant, then read the walkthrough and compare it with your own design. Reading it first makes the practice much less useful.
Learn: Design UberYour history
Sign in to see your sessions on this problem.