KatInterview

Design an Aggregated Flight Search Engine

System DesignModel answer
MediumModel answerSystem Designsystem-designcachingdistributed-systems

Last updated

Design a large-scale flight search engine that aggregates dynamic fares from multiple third-party sources under low latency constraints.

Context

Design an aggregated flight search platform (similar to Skyscanner or Google Flights). The service enables global travelers to search for flights, apply complex filters, compare prices across various ticket vendors, and get redirected to vendor websites for checkout.

Key Requirements

Functional Requirements

  1. Flight Search: Support one-way and multi-city/round-trip searches given origin/destination codes, dates, passenger count, and cabin class.
  2. Filtering & Ordering: Users can sort results by price, total travel time, or a custom rank score ("best balance"), and filter by maximum stops, specific airlines, and departure/arrival time windows.
  3. Data Ingestion: Ingest live pricing and inventory data from hundreds of legacy Global Distribution Systems (GDS like Amadeus/Sabre), direct airline APIs, and online travel agencies (OTAs).

Non-Functional Requirements

  1. Latency: Sub-2-second response time for search requests, even when downstream external APIs are sluggish or unresponsive.
  2. Data Consistency: Prices displayed should be reasonably accurate. Small discrepancies between the search result and the final checkout page are tolerable if detected and flagged gracefully.
  3. Scale: The system must handle peak search workloads of 10,000+ QPS while operating within third-party rate limits and query cost constraints.

Deliverables

  1. High-level System Architecture: Core components, data ingestion flow, and user query flow.
  2. API Design: Endpoint specifications for submitting search requests and fetching paginated/filtered results.
  3. Data Storage & Caching: Database schemas, key structures, and multi-tier caching strategy.
  4. Resilience Strategy: Patterns for managing slow downstream integrations, rate limits, and cache staleness.

Hints

Hint 1

Consider how to prevent downstream third-party rate limits from becoming a bottleneck when handling millions of queries daily.

Hint 2

Think about an asynchronous or streaming API model to return instant cached data first while gathering fresh updates in the background.

Hint 3

Identify how to deduplicate the same flight itinerary sold by multiple distinct ticket vendors.