Problem Statement: A Three-Sided Real-Time Marketplace
Frames food delivery as a logistics optimization problem connecting restaurants, couriers, and consumers under strict time pressure.
Problem Statement
Design a food delivery platform that connects three distinct participant groups—restaurants preparing food, couriers transporting it, and consumers ordering it—under the constraint that food degrades in quality every minute it sits. Unlike ride-sharing where the passenger waits inside a vehicle, food delivery involves a perishable product with a narrow quality window of roughly 30-45 minutes from preparation to consumption.
The system must handle menu browsing and ordering, real-time courier dispatch and route optimization, live location tracking with ETA updates, multi-order batching to improve courier utilization, payment processing including tips and partial refunds, and restaurant integration ranging from simple tablet-based order receipt to full POS system integration.
Why This Problem Is Distinctive
A ride-sharing system matches one rider to one driver for a single trip. Food delivery introduces compounding complexity: a courier may carry three orders simultaneously from two different restaurants to three different customers, each with different preparation times, pickup windows, and delivery deadlines. The dispatch algorithm must reason about food temperature degradation, restaurant preparation speed variance, courier capacity constraints (insulated bags, drink holders), and the cascading effect of one late pickup on subsequent deliveries in a batch.
DoorDash reported processing approximately 37 million monthly orders in 2023, with peak dinner hours generating order volumes 4-6x the daily average. Uber Eats operates across 6,000+ cities with over 500 million registered users on the broader Uber platform. Grubhub served approximately 30 million active diners before its acquisition by Wonder Group. These are not hypothetical numbers—they represent real infrastructure operating at massive scale.
The Three Architectural Planes
- Commerce Plane: Menu management, order intake, payment authorization, pricing, promotions, and refund processing. This plane is transactional, strongly consistent per order aggregate, and tolerant of seconds-level latency.
- Logistics Plane: Courier dispatch, route optimization, order batching, pickup coordination, and delivery sequencing. This plane is optimization-heavy, operates on 5-30 second decision cycles, and must handle continuous re-optimization as conditions change.
- Tracking Plane: Real-time courier location, ETA computation, status broadcasting to consumers and restaurants, and notification orchestration. This plane is high-throughput, eventually consistent, and optimized for fan-out read patterns.
A strong interview answer keeps these planes separate. The commerce plane can tolerate brief unavailability without food spoiling. The tracking plane can show slightly stale positions without harm. But the logistics plane must never lose awareness of which courier is carrying which order, because a lost mapping means cold food at a customer's door.
The Ephemeral Data Challenge
Unlike social media posts or e-commerce catalogs that persist indefinitely, food delivery data is aggressively ephemeral. A courier's location is useful for perhaps 30 minutes—the duration of a delivery batch. A restaurant's preparation queue is relevant for the current service window. An order's real-time status matters only until delivery confirmation. This ephemerality drives storage architecture: hot in-memory stores for active operations, durable persistence only for business-critical records (orders, payments, disputes), and aggressive TTL-based cleanup for telemetry.
Success Looks Like
A consumer opens the app, sees accurate restaurant availability and realistic delivery estimates, places an order, watches their courier approach on a live map, receives their food within the promised window, and completes payment seamlessly. Behind the scenes, the platform coordinated a restaurant's kitchen, optimized a courier's route across multiple orders, tracked GPS pings every 3-5 seconds, computed dynamic ETAs accounting for traffic and preparation delays, and processed a payment with tip—all within a 30-45 minute window.
Key Highlights
- •Food delivery is a three-sided marketplace with perishable inventory and a 30-45 minute quality window.
- •DoorDash processes ~37M monthly orders; peak dinner hours generate 4-6x average volume.
- •Three architectural planes: Commerce (transactional), Logistics (optimization), Tracking (high-throughput fan-out).
- •Order batching introduces combinatorial complexity: one courier, multiple restaurants, multiple customers, strict time windows.
- •Ephemeral data drives storage architecture: hot in-memory for active operations, durable persistence only for business records.
Section Rescue Kit
Buzzwords to use:
Safe statements:
- "I will separate the three planes because they have fundamentally different consistency and latency requirements."
- "Before selecting technologies, let me define which decisions are latency-sensitive, which are correctness-sensitive, and which are throughput-sensitive."