KatInterview

Unified Hotel Availability Search Across Three Supplier Feeds

System DesignModel answer
MediumModel answerSystem Designsystem-designaggregationresilience

Last updated

Design a read-only search service that merges hotel availability from three inconsistent suppliers into one normalized, fault-tolerant response with cross-supplier deduplication.

Scenario

A travel product needs a single search backend that pulls hotel availability from three external suppliers, called S1, S2 and S3. The suppliers disagree on almost everything:

  • Response formats and field names differ.
  • One uses cursor-based paging, another uses offset paging, and the third behaves differently again.
  • Each enforces its own rate limit and a hard cap on concurrent connections.
  • Their response times range from about 200 ms to about 2 s.

What the service must do

Functional

  • Expose one endpoint that takes a destination and a stay date range and returns a single normalized list of hotel options.
  • If a supplier is slow or down, still return what the others provided instead of failing the whole request.

Non-functional

  • Resilience: use mechanisms such as circuit breakers and retries to tolerate flaky suppliers.
  • Normalization: describe how the three schemas are mapped into one canonical model.
  • Observability: measure latency, error rate and data freshness for each supplier.
  • Identity resolution: detect when different suppliers list the same physical hotel and merge them.

Scale

  • Peak load of 5,000 requests per second.
  • Supplier latency between 200 ms and 2 s per call.
  • Strict per-supplier limits on concurrent connections.

Expected in your answer

  1. A high-level architecture sketch.
  2. The canonical data model.
  3. How you produce a partial result when one supplier fails or is too slow.
  4. The pipeline that matches hotels (by name, address and similar attributes) across suppliers.

State your assumptions, do a quick capacity estimate, and discuss trade-offs.

Hints

Hint 1

Estimate load first: multiply request rate by supplier fan-out, then apply Little's Law (concurrency = rate x latency) and compare with the connection quotas. What does this say about calling suppliers live for every user request?

Hint 2

Isolate each supplier behind an adapter with its own concurrency limit, rate limiter and circuit breaker, and give the whole request a single deadline so you can return whatever has finished when time runs out.

Hint 3

Do identity resolution offline: standardize text, block candidates by geographic cell, score pairs, apply thresholds, and keep a versioned mapping lookup that the online path only reads. Never drop an offer just because it is unmatched.