KatInterview

Design a Multi-Provider Flight Price Aggregation System

System DesignModel answer
HardModel answerSystem Designsystem-designcachingdistributed-systems

Last updated

Design a scalable service that aggregates, normalizes, and serves cheap flight offers from many providers under strict latency and cost constraints.

Build a Flight Price Aggregation Service

You are designing the backend for a travel search product that lets users find the lowest available fares across many airlines and ticket distributors.

What the system must support

  • Search by departure airport, arrival airport, travel dates, cabin class (economy / business / first), maximum number of stops, and passenger count.
  • Flexible date queries, such as "show me the cheapest day to fly in April" or "prices for ±3 days around my target date," returned as a per-day price calendar alongside ranked itineraries.
  • Results sorted by total price, with filters on stop count, carrier, and departure window.
  • A price-confirmation step before the user is handed off to book, so they always see an accurate fare at purchase time.

What to cover in your answer

  1. Requirements and scale — state your assumptions explicitly: QPS, provider count, data volume, look-to-book ratio.
  2. API design — request and response shapes for search, calendar, and price confirmation.
  3. Architecture — how data flows from providers into a searchable store, including ingestion, normalization, deduplication, and write propagation.
  4. Data model and indexes — schema choices that make price queries fast and price updates cheap.
  5. Data freshness — how stale results stay useful and how the system keeps hot routes up to date without blowing the provider budget.
  6. Caching strategy — what gets cached, at which layer, and for how long.
  7. Provider access — rate limiting, retries, circuit breaking, and quota management.
  8. Consistency vs. availability — where eventual consistency is fine and where it is not.
  9. Scalability and cost control — the dominant cost is provider API calls, not compute; show how the design respects that.
  10. Failure modes and rollout — what breaks first under load, and how you would launch this safely.

You are expected to make and defend trade-offs, not just enumerate options. Numbers and rough sizing carry more weight than vague claims.

Hints

Hint 1

Provider API quota is the most binding constraint in this system, not CPU or memory. Your refresh and caching strategy should be designed around minimizing provider calls, not around minimizing infrastructure cost.

Hint 2

A cache miss on a cold route and a cache miss on a hot route need different handling. Think about what a 'stale but acceptable' result looks like to a user, and design your freshness tiers and TTLs around user behavior rather than uniform expiry.

Hint 3

Deduplication is trickier than it looks: the same physical flight is sold by multiple providers and under codeshare flight numbers. Define your dedup key precisely — which fields uniquely identify an itinerary regardless of who is selling it — before you design the offer schema.