Katkat

Design a natural-disaster notification system

ExpediaSoftware Engineer · Onsite

Last updated

This problem tests your ability to design a high-throughput, geo-aware notification system that must deliver time-sensitive alerts to users based on their current or planned location during natural disasters.

Design a Natural-Disaster Notification System

Design a scalable system that notifies Expedia users when they are located within or traveling to a region affected by a natural disaster (e.g., hurricane, earthquake). The system must ingest disaster event feeds from government APIs, identify affected users, and dispatch notifications via push, email, or SMS.

Functional Requirements

  • Ingest disaster polygons from external providers (e.g., USGS).
  • Notify users currently in the impact zone.
  • Notify users with upcoming bookings in the impact zone within the next 48 hours.
  • Allow users to opt-out or manage notification preferences.

Non-Functional Requirements

  • Low Latency: Alerts should reach users within 2 minutes of disaster ingestion.
  • Scale: Support up to 50 million active users globally.
  • Reliability: Ensure high delivery rates; minimize false positives.
  • Consistency: Handle high-volume spikes during large-scale disasters.

Deliverables

  1. High-level architecture diagram (described in text).
  2. Choice of database schema and geospatial indexing strategy (e.g., Quadtree, S2, H3).
  3. Strategy for mapping user location (real-time vs. itinerary-based) to disaster impact zones.
  4. Design for ensuring notification idempotency to prevent duplicate alerts.

Hints

Hint 1

Consider how to efficiently store and query moving users versus static itinerary data using spatial partitioning.

Hint 2

Think about using a message queue or streaming platform to decouple disaster ingestion from the user notification pipeline.

Hint 3

Address how you would handle the 'thundering herd' problem if a major disaster impacts a high-density travel hub.

Follow-up questions

  • How would you modify your design to handle a multi-region disaster scenario where the alert footprint changes hourly?
  • What observability metrics would you track to ensure the system is meeting the 2-minute latency SLO?
  • If the notification provider API experiences a partial outage, how would you prioritize the delivery of messages?