Design a Food Delivery App like DoorDash
Understanding the Problem
🍔 What is a food delivery app? A food delivery app is a three-sided marketplace. Customers browse nearby restaurants and order a meal, restaurants receive the order and cook it, and couriers pick it up and bring it to the customer's door. DoorDash, Uber Eats, Grubhub, Swiggy and Zomato all run this loop. The app has to keep all three parties in sync from the moment the customer taps "Place order" until the bag is handed over, usually within 30 to 45 minutes.
You may hear this asked as "design Uber Eats," "design Swiggy" or "design Zomato." They're the same problem. The differences are market details: Indian apps lean on two-wheeler couriers in very dense cities and still see real volumes of cash on delivery, while US apps cover more sprawl and longer drives. None of that changes the architecture, so we'll design one system and point out where those details matter.
Functional Requirements
We'll agree with our interviewer on what each of the three sides needs. It's easy to drift into restaurant onboarding, courier payouts and promotions, so draw the line early.
Core Requirements
- Customers should be able to browse restaurants that deliver to their address and view a restaurant's menu.
- Customers should be able to place an order and pay for it.
- Restaurants should be able to accept an order, and the system should assign a courier to deliver it.
- Customers should be able to track their order's status and the courier's location in real time.
Below the line (out of scope)
- Restaurant onboarding, menu editing tools and courier sign-up.
- Ratings, reviews and customer support.
- Courier pay calculation, tips distribution and payouts.
- Promotions, coupons and subscriptions (DashPass, Swiggy One).
Non-Functional Requirements
Ask your interviewer for scale. We'll assume 50M monthly active customers, 20M orders a day at peak season, 500k restaurants and up to 1M couriers online at dinner time across all markets. The menu and restaurant pages are the hot read path: we'll plan for 50k QPS of menu reads at peak.
Core Requirements
- Browsing (restaurant list, menus) should be fast, under 200ms at p99, and highly available. Slightly stale data is fine.
- Orders and payments must be strongly consistent and durable: an order is never lost, never charged twice, and never assigned to two couriers.
- Tracking updates (status changes and courier location) should reach the customer within a few seconds.
- The system should absorb a sharp dinner peak, roughly 3x the daily average, and a big city's outage shouldn't take down other cities.
Below the line (out of scope)
- Analytics, ML model training and the data warehouse.
- Fraud detection beyond what the payment provider gives us.
Some quick math. 20M orders a day is about 230 orders per second on average, so maybe 1,000 to 2,000 orders per second at the dinner peak. That is a comfortable load for a sharded relational database. The order path needs correctness more than raw throughput.
Courier locations are a different story. A million online couriers sending a GPS fix every 4 seconds is 250k location writes per second, and each payload is small (courier ID, lat/lng, heading, timestamp, about 50-100 bytes), so that's only about 25MB/s of data. The problem isn't bandwidth, it's the write rate on a constantly changing value. That stream has to live in memory, not in our order database.
The three workloads in this problem have completely different shapes. Menus are read-heavy and cacheable, orders are low-volume but must be correct, and locations are write-heavy and disposable. A strong answer gives each one its own storage instead of forcing them into one database.