Design a Ride-Sharing Service
A full case study of an Uber-style service, covering high-rate location updates, geospatial indexes, driver matching and the trip state machine.
Requirements
A ride-sharing service connects a rider who needs a trip with a nearby available driver.
Functional:
- Drivers go online and send their location continuously.
- A rider requests a ride from A to B and sees nearby drivers and a fare estimate.
- The system matches the request to a driver, who accepts or declines.
- Both sides track the trip live; payment happens at the end.
Non-functional:
- Matching in seconds; location shown with a delay of a few seconds at most.
- No driver is assigned to two riders, and no rider gets two drivers.
- Available in busy cities during peaks.
Out of scope: payment internals (see the payment lesson), maps and routing engines, pooling.
1 of 11