Design Real-Time Order Dispatch for a Food Delivery Fleet

Last updated: November 29, 2026

Quick Overview

Design the system that assigns delivery partners to food orders across a large city in real time, including batching, handling rejections, and staying up during peak dinner traffic.

Swiggy
System Design
Software Engineer
Swiggy
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design the system that assigns delivery partners to food orders across a large city in real time, including batching, handling rejections, and staying up during peak dinner traffic.

Dispatch sits at the center of Swiggy's logistics stack and drives cost per order, delivery time and rider earnings. Senior backend candidates are asked to design it end to end; the interviewer checks state modelling, the matching algorithm, data freshness and behavior under load spikes.

What the Interviewer Expects
  • Separates location ingestion, order state, and the matching engine
  • Uses short batching windows and a cost-based matching rather than pure nearest rider
  • Defines a clear order and rider state machine with reliable offer and accept flow
  • Partitions work by zone so matching stays fast
  • Plans for peak load, degraded modes and region failures
  • Names the metrics used to tune the cost function
Key Topics to Cover
matching
geospatial indexing
state machines
partitioning
peak load
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you prevent two matchers from assigning the same rider?
  • How would you add a second pickup to a rider already en route?
  • What happens if the location stream lags by 30 seconds?
  • How would you test a new cost function safely?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: accept confirmed orders, choose a rider, send an offer, handle accept, reject or timeout, support batching two orders, and reassign when a rider goes offline. Non-functional: assignment wi...

High-Level Design
  • Location service: riders send GPS over a persistent connection to gateways, which publish to Kafka partitioned by zone. A consumer keeps the latest position per rider in Redis with a geo index per z...

Submit Your Answer
Markdown supported

Related Questions