Design Dispatch Matching for Last-Mile Delivery Drivers

Last updated: November 29, 2026

Quick Overview

Design the system that offers grocery delivery orders to nearby independent drivers on a crowdsourced driver app, batching orders where possible and meeting promised delivery windows. Driver locations update every few seconds.

Walmart Labs
System Design
Software Engineer
Walmart Labs
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design the system that offers grocery delivery orders to nearby independent drivers on a crowdsourced driver app, batching orders where possible and meeting promised delivery windows. Driver locations update every few seconds.

Walmart's last-mile network relies on independent drivers using the Spark Driver app, so dispatch quality directly affects delivery cost and on-time rate. Interviewers expect geospatial indexing, an offer and acceptance protocol, batching logic, and fallbacks when no driver accepts in time.

What the Interviewer Expects
  • Ingest and index frequent driver location updates
  • Find candidate drivers near a store using a geo index
  • Batch compatible orders into a single trip
  • Run an offer protocol with timeouts and exclusivity
  • Track on-time and cost metrics and handle unaccepted orders
Key Topics to Cover
Geohash or H3 indexing
Batching and routing heuristics
Offer state machine
Location streaming
Matching optimization
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 decide between offering one order now versus waiting 3 minutes to batch?
  • How would you shard the geo index for a dense metro?
  • How do you keep offers fair across drivers?
  • What happens if a driver accepts and then goes offline?
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

Orders become ready at a store with a delivery window. Drivers are online, offline or on a trip, sending location every 5 seconds. Dispatch must offer an order to drivers within a radius, allow batchi...

High-Level Design
  • Location Ingest: driver app posts location to a gateway, which writes to a stream partitioned by region.
  • Geo Index Service: in-memory index keyed by H3 cell (resolution around 8, about 0.7...

Submit Your Answer
Markdown supported

Related Questions