KatInterview

Live Market Data Distribution Platform

System DesignModel answer
HardModel answerSystem Designreal-time systemsstreamingpub-sub

Last updated

Build a streaming architecture to deliver current stock quotes to millions of users with sub-second latency and graceful degradation under load.

You're tasked with architecting a platform that streams live market quotes to end users. The system receives price feeds from exchanges, processes them, and pushes updates to client applications in near real-time.

What you need to design:

  • How raw feeds are consumed, validated, and normalized across different sources
  • Strategy for combining feeds from multiple exchanges into unified quotes
  • Distribution mechanism to reach clients (protocol choice, connection management)
  • How updates are batched and conflated to balance freshness with resource usage
  • Scaling approach to support millions of simultaneous viewers
  • Handling of uneven popularity (some tickers vastly more watched than others)
  • Managing slow or disconnected clients without impacting others
  • Operational concerns: monitoring what matters, handling failures, multi-region deployment

Constraints and assumptions:

  • Coverage spans roughly 10,000 tradable instruments
  • Peak inbound message rate reaches 1-2 million per second during volatile periods
  • Target audience is 5 million concurrent users, each tracking around 20 instruments
  • Acceptable end-to-end latency is under 250ms (p99) from exchange receipt to client display
  • Users need current values only; historical lookups are handled separately
  • Humans perceive updates effectively at 4-10Hz, enabling intelligent batching

Walk through your design from ingestion to client delivery, explaining trade-offs and how you'd validate it works at scale.

Hints

Hint 1

Consider how popularity distribution affects resource allocation—what changes when 100 symbols account for 80% of traffic?

Hint 2

Think about the semantic guarantees clients actually need: is every intermediate price tick critical, or just maintaining an accurate current view?

Hint 3

Explore where state lives in your architecture and which components can be stateless to simplify scaling and recovery.