Skip to content
Backend system design · about 45 minutes

Ride matching service

Design the service that finds a near driver for each rider. Drivers send their location every few seconds. A rider asks for a ride and gets a driver in a few seconds, and then the two phones follow the trip to its end. A driver must never get two riders at the same time, and the busiest hour of a large city must not slow the match.

Ask first

  • How many drivers are online at one time, and how often does each driver send a location?
  • How many ride requests come in a day, and how fast must a rider get a driver?
  • Does the nearest driver get the ride, or the driver with the shortest time of arrival?
  • How long can a driver think about an offer, and what happens after a refusal?
  • Are the price, the payment and the route on the map in scope, or only the match and the trip state?

The outline

Write your own outline for each part first.

The strong answer, the pitfalls and the follow-ups opens with a year in the app. What a year includes