Design a Restaurant Order Aggregator
Understanding the Problem
🧾 What is a restaurant order aggregator? A restaurant on DoorDash, Uber Eats and Grubhub would otherwise have three tablets on the counter, each beeping with orders in a different format, plus its own point-of-sale (POS) system. An aggregator like Otter, Deliverect or Chowly connects to all of them: orders from every platform show up on one screen and go straight into the POS and the kitchen printer, the staff accept and mark them ready in one place, and the menu is edited once and published to every platform.
Functional Requirements
Core Requirements
- Restaurants should receive orders from every connected delivery platform in one place, in one format, within seconds of the customer placing them.
- Staff should be able to accept, reject, set prep time and mark orders ready, and each platform should see the status change.
- Restaurants should be able to manage one menu (items, prices, modifiers, availability) and publish it to every platform, including marking an item sold out everywhere at once.
- Orders should flow into the restaurant's POS and kitchen printer automatically.
Below the line (out of scope)
- Payments. Each platform charges the customer and pays the restaurant.
- Courier dispatch and delivery tracking. That's the platform's job.
- Analytics and reporting beyond a basic order history.
Non-Functional Requirements
Ask about scale, but more importantly ask what failure looks like. For a restaurant, a missed order is a customer who paid and gets nothing, a one-star review and a refund the restaurant often pays for.
Core Requirements
- The system must never lose an order and never show or inject one twice.
- A new order should appear on the restaurant's device within 5 seconds of the platform sending it. Platforms auto-cancel orders that aren't accepted within a few minutes, so delay costs money.
- Status changes and menu updates should reach each platform reliably, within seconds for status and within minutes for full menus, while respecting each platform's API rate limits.
- A problem with one platform (an outage, a changed API) must not affect orders from the others.
- The system must handle restaurants with unreliable Wi-Fi and devices that go offline mid-rush.
Below the line (out of scope)
- Global multi-region active-active. Restaurants are regional; one region per market is fine.
Now the numbers. Say 200,000 restaurant locations, each getting about 60 delivery orders a day: 12 million orders a day, around 140 per second on average. Orders cluster around lunch and dinner, so peak is maybe 5x average, around 700 orders per second. Each order generates several more events (accepted, prep time, ready, picked up), so call it 5,000 events per second at peak in both directions.
That is not much load. A single well-sized Postgres cluster could store it. The difficulty is elsewhere: we sit between a dozen external systems that each have their own data model, delivery semantics, rate limits and outages, and thousands of small devices on restaurant Wi-Fi.
Say this out loud early: "the throughput is modest; this is an integration and reliability problem." It tells your interviewer you'll spend the time on idempotency, delivery guarantees and isolation, which is where the good discussion is.