KatInterview

Design a Multi-Provider Money Transfer Price Comparison Service

System DesignModel answer
MediumModel answerSystem Designsystem-designcachingfault-tolerance

Last updated

Design a service that gathers remittance quotes from many providers, computes true customer cost against a mid-market rate, and clearly marks stale or missing data.

Scenario

A consumer finance app wants to show people which service is cheapest for sending money abroad on a given route, such as USD to PHP or EUR to INR. The headline exchange rate alone is misleading: a provider may charge a small upfront fee but give a worse rate than the interbank mid-market rate, which is a hidden cost.

Design a prototype and its architecture for a price comparison service. It pulls prices from provider APIs, public web pages, and data partners, converts them to one comparable total cost, and serves the result to end users and to internal pricing analysts.

Requirements

Functional

  • Query and normalization. A request is (source_currency, target_currency, send_amount, delivery_method). For each provider compute:

    total_cost = upfront_fee + send_amount * (1 - provider_rate / mid_market_rate)

  • Provenance. Every quote keeps its source, retrieval time, expiry/TTL, and a pointer to the raw response it was derived from.

  • Partial results. If a provider times out, rate-limits you, or breaks, return the comparison for the others and explicitly mark the missing or outdated entries. Never fail the whole request because of one provider.

  • Extensibility. Adding a provider or a fallback parser should need little code.

Non-functional

  • Latency. P95 under 800 ms for cached or pre-warmed routes. Live on-demand fetching must finish within 3 seconds.
  • Freshness. FX quotes must be no more than 5 minutes old during active market hours.
  • Transparency. Show fee breakdowns plainly. Do not hide provider disclaimers or tiered and promotional pricing.

Scale

  • 100 active routes (corridors) and 20 providers.
  • Around 3,000 comparison requests per minute at peak.
  • Mid-market reference rates refresh every 30 seconds from trusted feeds.

What to cover

  1. Data model: quotes, provider adapters, raw payloads, normalized comparisons.
  2. Architecture: ingestion (APIs versus scrapers), caching, worker pools, fallbacks.
  3. Failure and staleness semantics: how a client tells live data from stale data from a failed provider.
  4. Production readiness: rate-limit protection, circuit breaking, observability, and automatic detection of broken parsers.

Hints

Hint 1

Do the capacity math first: convert requests per minute to QPS, then count route x provider x amount-tier x delivery-method combinations and divide by the refresh interval. Work out which load actually dominates.

Hint 2

Decouple the read path from the fetch path. Reads should hit a cache of normalized quotes, while a scheduler and per-provider workers keep that cache fresh in the background.

Hint 3

Make status a per-quote property (live, fresh cache, stale, unavailable) with an age and a reason, and pin each comparison to a single mid-market snapshot so every provider is judged against the same baseline.

Hint 4

Isolate providers from each other with separate worker pools, rate limiters, and circuit breakers, and validate parsed quotes (range and delta checks) before publishing so a broken scraper cannot poison results.