Questions

Ride hailing system design

Design the back end of a ride app for one city.

Play

The problem

A ride app shows the free cars near a rider and sends each ride request to a nearby driver.

Apps that find restaurants or shops near you search the map the same way.

Questions to ask the interviewer

How many riders?

About 100 map views a second. Each shows the free cars near the rider.

How many drivers?

About 3,000 online. Each phone sends its location once a minute.

How many rides?

About 30 ride requests a second.

Must the rider wait while we ask a driver?

No. Answer 'Finding your driver' at once. The offer reaches the driver's phone about a second later.

How fast must the map be?

Under 200 ms.

What is the budget?

About $105 a month.

Want to try it yourself first? Play, then come back for the approach.

Play

The design in short

A ride app answers one question over and over: which free cars are close to this rider? Then it hands each ride request to one of those drivers. The map question runs far more often than anything else, so it shapes the design.

Near is the hard word. A table of drivers sorted by id cannot tell you who is near a street corner. If every map view reads every driver, the work grows with the size of the fleet, not with the size of the answer. A rider only cares about a few blocks around them. Ask how the data can be laid out so a view touches only the drivers close by, and how many reads that takes.

Two kinds of traffic meet here. Riders look at the map and wait for the answer. Driver phones send where they are, and nobody waits for that. Ride requests sit in between: the rider gets "Finding your driver" at once, and the offer reaches a driver a moment later. Decide which work belongs in the reply and which can happen after it.

Things to place on the whiteboard:

  • the app servers that answer map views, and how many the view rate calls for
  • where driver locations are kept, and how a map view finds the ones nearby
  • the path a ride request takes from the rider to a driver's phone
  • what the rider sees while that path runs

Work out the reads first. Take the drivers online and the rows one read returns. Multiply by the map views a second. Compare that total with what a single database can serve, and the need for a smarter layout shows up on its own.

Keep the city in mind. The brief covers a single city. That limit keeps the map small and the numbers easy to check, so use it. Payments, prices and ratings are real parts of a ride app, but they are not this interview.

Try the layout on the GonnaCrash board and watch the map views reach the drivers, or fail to.

Play

Last updated 22 October 2026