Design a superhero dispatch system
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Stripe's system design round, last asked May 2026. It tests geospatial, dispatch and consistency.
Design the backend of a dispatch platform that connects civilians in an emergency with nearby superheroes. A civilian reports an incident (a fire, an accident, a crime) with its location. The platform creates a rescue request, finds suitable heroes nearby, offers it to them, lets exactly one hero accept and travel there, and lets dispatchers follow every request until it closes. It looks like ride-hailing, but volume is far lower and reliability matters far more: a lost or double-assigned emergency is much worse than a lost ride. The interviewer cares most about why you choose each technology and each consistency level, not about endpoint design.
Requirements
- Functional: report an incident; track hero location and availability; find heroes within a radius; send offers with a timeout; one hero accepts; track the incident through its states to completion; dispatchers can watch, cancel and reassign.
- Non-functional: about 1 million civilians and 10,000 active heroes in a large metro; peak about 500 new incidents a minute; hero location every 5 to 15 seconds; first offer within a few seconds; offers expire after 10 to 20 seconds.
- Non-functional: a single-hero incident is assigned to at most one hero, even under concurrent accepts and partial failures. Strong consistency for the assignment; eventual consistency is fine for live locations, dashboards and analytics.
Clarifying questions
- Can one incident need several heroes with different skills, or is it one hero per incident for now?
- Is "nearby" straight-line distance or travel time, given that some heroes fly?
- How hard may we push to reach a hero: push only, or SMS and voice for severe incidents?
- Is there always a human dispatcher as a fallback who can override?
- Which is worse here: sending a hero who is not needed, or missing a dispatch?
- How long must incidents be kept for review or audit?
What a strong answer covers
- An explicit consistency split: the assignment is the one thing that must never be wrong; location and dashboards can be slightly stale.
- Services and storage matched to each need: a relational store for incidents, offers and assignments; an in-memory geospatial index for live locations; a durable log or queue for the dispatch workflow.
- A race-free accept: a single conditional write (or equivalent) that only one hero can win, owned by the transactional store, and how losers find out.
- The incident state machine with every unhappy path: timeout, decline, cancel, hero drops off, no hero found.
- Never losing a request between "saved to the database" and "dispatch started" (an outbox or equivalent), with idempotent consumers and dead-letter handling.
- Dispatch strategy (one offer at a time vs a small batch, radius expansion, ranking) and its latency vs double-offer trade-off; stuck-incident detection, dispatcher override and alerts; not over-building for ride-share scale.
Follow-ups
- A disaster causes a 50x burst of incidents in one neighborhood. What degrades first, and how do you protect the rest?
- Support incidents that need several heroes arriving together, without double-booking any hero.
- An assigned hero stops sending heartbeats mid-rescue. How do you detect it and reassign safely?
- Add a model that predicts each hero's acceptance probability and ETA. Where does it sit, and how do you keep matching within seconds?
Where it's asked
- Stripe · System design · Last asked May 202660 min · Design discussion in a shared document
What it tests
geospatial · dispatch · consistency
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
