KatInterview

Design a Live Market Data Feed for a Financial Dashboard

System DesignModel answer
HardModel answerSystem Designstreamingwebsocketsfanout

Last updated

Design a system that streams real-time asset prices to millions of concurrent users with sub-100ms end-to-end latency.

Design a Live Market Data Feed for a Financial Dashboard

You're building the backend for a financial data platform that shows live prices for hundreds of tradeable assets — think stocks, FX pairs, or commodities. A front-end dashboard displays the current price of each asset and a 24-hour price chart. Prices must update automatically as market conditions change, no page refresh required.

Your system receives raw price ticks from several third-party market data providers via WebSocket or REST streams. Your job is to ingest those ticks, compute a unified price, and push updates out to a very large number of simultaneous browser clients with minimal delay.

Requirements

Functional

  1. Users can load a dashboard listing all supported assets and their current prices.
  2. Prices refresh automatically in real time — no polling from the user's browser.
  3. The system stores a rolling 24-hour price history at a reasonable granularity (e.g., 5-minute OHLCV candles) to power the chart view.

Non-Functional

  1. Scale: 5 million concurrent connected clients at peak.
  2. Latency: Price updates must reach clients within 100ms of being received from upstream providers.
  3. Availability: The system must stay up continuously. Occasionally dropping a single price tick is tolerable; extended outages are not.
  4. Consistency: All users should see roughly the same price at any given moment. Small per-client jitter is acceptable.

What your answer should address

  • Ingestion: How do you reliably consume tick streams from multiple upstream providers that each have their own protocols and failure modes?
  • Normalization and aggregation: How do you reconcile prices from different sources into a single authoritative price per asset?
  • Fanout: How do you push updates to 5 million clients without melting your infrastructure?
  • Storage: What databases do you use for current prices versus historical candle data, and why?
  • Handling volatility spikes: A sudden market event can cause tick volume to spike 50–100x above normal. How does your design hold up?

Aim for a structured walkthrough: size the problem first, then describe each layer of the architecture, call out your key technology choices and the trade-offs behind them, and flag the places where the design could break under stress.

Hints

Hint 1

Start by doing the fanout math before picking any technology. Five million clients receiving updates once per second is a fundamentally different problem than five million ticks per second arriving from upstream — figure out which side dominates your infrastructure cost, because the answer shapes every subsequent decision.

Hint 2

Upstream tick rate and client update rate don't have to be the same. If prices change 500 times per second but a human eye can only perceive about 10 updates per second, you can decouple the two with a technique called conflation: always forward the latest state rather than every intermediate tick. This keeps client-facing load roughly constant even during volatility spikes.

Hint 3

The bottleneck in a push-based system at this scale isn't the message broker — it's the final hop from your servers to 5 million open sockets. Think about how many WebSocket gateway nodes you need, how they learn about new prices (they shouldn't each be a direct subscriber to every upstream event), and what happens to a slow client whose buffer fills up.