Design a food ordering and delivery system
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Onsite
Design a backend system for a **food ordering + delivery** platform (like a marketplace that connects customers, restaurants, and delivery couriers).
## Core user flows
1. Customer:
- Browse/search restaurants and menus
- Add items to cart, place an order, pay
- Track order status (prep, picked up, arriving)
2. Restaurant:
- Receive order, accept/reject, update prep status
3. Courier:
- Receive delivery offers, accept, pickup, deliver
## Requirements
### Functional
- Restaurant/menu discovery (basic search/filter is enough)
- Order creation and payment intent
- Reliable order state machine (created → accepted → preparing → ready → picked_up → delivered/cancelled)
- Dispatch: assign courier to an order
- Real-time-ish tracking and status updates to customer
### Non-functional
- High availability (avoid single points of failure)
- Consistent order state (no double-deliver, no lost orders)
- Handle peak traffic (lunch/dinner bursts)
- Observability: metrics, logs, tracing
## Deliverables
- APIs (high level)
- Data model (high level)
- Architecture and major components
- Approach to scaling, reliability, and failure handling (explicitly call out single points of failure)
- Consistency model choices and trade-offs
Quick Answer: This question evaluates a candidate's ability to design scalable, reliable backend systems including API design, data modeling, state management, dispatching, real-time updates, and consistency choices for a marketplace connecting customers, restaurants, and couriers, and it falls under the System Design domain.