With a few taps on the phone, you can make a ride available at your doorstep to take you wherever you want. This is possible with a ride-sharing service such as Uber or Grab. How does such a service handle each ride request? Moreover, how does it scale the service to millions of users. Designing Uber (or Grab or Lyft) is a common question you can encounter in the system design round in interviews. In this post you'll learn how to design a ride-sharing app.
Each of these apps, including Uber, Grab, Lyft and Ola, have their own set of features. Grab and Uber, for instance, offers food deliveries in addition to transportation. Lyft also guides you on the shortest bus routes and helps you connect to the nearest scooters and bikes besides arranging a taxi service for you. With such differences in the apps, it's important to establish what a basic ride-sharing system offers.
A ride-sharing app allows riders to book a vehicle with a driver to take them to the desired destination. The drivers and customers can view each other's locations and communicate via the app from the time the request is made till ride completion.
How to design Uber is a broad question. For a 40-minutes interview, you'll need to list down a few core features and design the system around them.
Basic features of a ride-sharing app include:
Uber gets over 1 million active customers and 500k active drivers each day. With a number of different components to handle and the need to scale the system to millions of active riders and drivers, Uber switched from monolithic architecture to a service-oriented architecture in 2014. Each of the microservices operate independently and combine into one big system. Since the evolution of the system, Uber has added additional services too. Other than delivering taxis, it also handles food deliveries, and cargo.
50% off Udemy courses
Grokking the System Design Interview
Java Multithreading for Senior Engineering Interviews
Grokking the Advanced Design Interview
Grokking the Coding Interview: Patterns for Coding Questions
Grokking Dynamic Programming Patterns for Coding Interviews
Coderust: Hacking the Coding Interview