Design Uber

Problem Statement:


Step-1: What is Uber ?


Step-2: Requirements and Goals of the System

Typical Workflow


Step-3: Capacity Estimation and Constraints


Step-4: Basic System Design and Algorithm

Do we need to modify our QuadTree every time a driver reports their location ?
How much memory we need for DriverLocationHT ?
How much bandwidth our service will consume to receive location updates from all drivers ?
Do we need to distribute DriverLocationHT onto multiple servers ?
How can we efficiently broadcast driver’s location to customers ?
How much memory we need to store all these subscriptions ?
How much bandwidth we need to broadcast the driver’s location to customers ?
How can we efficiently implement Notification service ?
How the new publishers/drivers will get added for a current customer ?
How about if clients pull information about nearby drivers from the server ?
Do we need to repartition a grid as soon as it reaches the maximum limit ?



How would “Request Ride” use case work ?
  1. The customer will put a request for a ride.
  2. One of the Aggregator servers will take the request and asks QuadTree servers to return nearby drivers.
  3. The Aggregator server collects all the results and sorts them by ratings.
  4. It then send a notification to the top (say three) drivers simultaneously, whichever accepts first will be assigned the ride.
  5. The other drivers will receive a cancellation request.
  6. If none of the three drivers respond, the Aggregator will request a ride from the next three drivers from the list.
  7. Once a driver accepts a request, the customer is notified.


Step-5: Fault Tolerance and Replication

What if a Driver Location server or Notification server dies ?


Step-6: Ranking

How can we return top rated drivers within a given radius ?


Step-7: Advanced Issues

  1. How to handle clients on slow and disconnecting networks ?
  2. What if a client gets disconnected when it was a part of a ride? How will we handle billing in such a scenario?
  3. How about if clients pull all the information as compared to servers always pushing it?




← Previous: Design Yelp / Nearby

Next: Design BookMyShow →