KatInterview

Geo-Targeted Emergency Alerts for Travelers at Scale

System DesignModel answer
HardModel answerSystem Designgeospatial-indexingnotificationskafka

Last updated

Design a platform that detects natural-disaster zones from external feeds and quickly alerts travelers who are in, or about to arrive in, the affected area without duplicate messages.

Geo-Targeted Emergency Alerts for Travelers

You work on a travel platform with about 50 million active users. Design a system that warns users when a natural disaster (hurricane, earthquake, wildfire, flood) affects the area where they are, or the area they are about to visit.

What the system must do

  • Pull disaster events from public agency feeds. Each event arrives as a geographic polygon with a severity, a start time and an expiry, and it may be updated several times.
  • Alert users who are currently inside the affected area.
  • Alert users who have a booking (stay, flight, or rental) in the affected area within the next 48 hours.
  • Let users choose channels (push, email, SMS), set a minimum severity, or opt out entirely.

Non-functional targets

  • Alerts reach users within 2 minutes of an event being ingested.
  • Support 50M active users worldwide.
  • High delivery rate and few false positives (do not alert people who are not actually affected).
  • Survive large bursts, such as a single event affecting millions of people.

What to cover in your answer

  1. A high-level architecture, described in text.
  2. Data stores, schema, and the geospatial indexing approach (for example H3, S2, or a quadtree), with justification.
  3. How you map both live locations and future itineraries to disaster zones.
  4. How you guarantee a user is not notified repeatedly for the same event, even with retries, overlapping feeds, and polygon updates.

State your assumptions and do back-of-the-envelope numbers for write rate and peak send rate.

Hints

Hint 1

Size the problem first: how many location writes per second, and how many messages per second must you send to finish a 2M-user fan-out in about a minute?

Hint 2

Convert each disaster polygon to a set of hierarchical grid cells, and keep reverse indexes from cell to users (live) and from cell plus date to bookings (itinerary). Finish with an exact point-in-polygon test to remove boundary false positives.

Hint 3

Think about users who move into an already-active zone after the event was processed, and about what should and should not change the idempotency key (feed version versus severity level).

Hint 4

Separate the pipeline into stages joined by queues (resolve zone, match users, orchestrate, send per channel) so a burst is absorbed by the queue rather than by the senders.