Skip to content

Design Uber: How Does a Ride Find a Driver?

What the video says

You tap Request on Uber. How does one car out of thousands find you?

If I were designing this in an interview, I’d start with the drivers. Every few seconds, each driver’s phone reports where it is. Split the city into cells and file each car under the cell it’s in. Now a request only checks the cells around the rider.

Why hexagons? Circles leave gaps. Squares have corner neighbors that sit farther away than the side ones. But a hexagon has 6 neighbors, all the same distance, so a ring of cells is close to a real radius.

But the closest car isn’t always the fastest. This one is right across the river, and the bridge is a long way around. So rank the nearby cars by how long the drive takes.

Then offer the ride to the best car. Once it accepts, the ride is locked, so no second driver can take it.

Uber has published two pieces of this. Its open source grid divides the map into hexagons. And it says arrival time estimates help match riders to drivers.

So that’s the design I’d explain. Track the cars, search nearby cells, rank by drive time, and give each ride to one driver.

Follow for the next system. Next time, what happens to a WhatsApp message when your friend is offline?

Sources

Every fact in the video was checked against these when it was made.

Your address is used only for this newsletter. Unsubscribe in one click.