Design an Exchange Matching Engine and Market Data Feed

Last updated: November 29, 2026

Quick Overview

Design the core of a crypto exchange: accept orders for hundreds of trading pairs, match them with price-time priority at low latency, and publish order book updates and trades to hundreds of thousands of WebSocket subscribers.

Coinbase
System Design
Software Engineer
Coinbase
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design the core of a crypto exchange: accept orders for hundreds of trading pairs, match them with price-time priority at low latency, and publish order book updates and trades to hundreds of thousands of WebSocket subscribers.

This is close to what Coinbase Exchange and Advanced Trade run, and senior candidates are expected to reason about determinism, sequencing and recovery rather than generic microservices. The interviewer probes how you keep one authoritative order of events per market and how you fan out market data without slowing matching.

What the Interviewer Expects
  • Single-threaded deterministic matcher per market (or shard of markets) fed by a sequenced log
  • Pre-trade risk and balance holds before orders reach the matcher
  • Replay from the event log for recovery and replicas
  • Separate market data fan-out from the matching path, with sequence numbers and snapshots
  • Concrete latency and throughput targets
Key Topics to Cover
matching engine
event sourcing
WebSockets
sequencing
market data
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do clients detect and recover from a missed market data message?
  • How would you fail over a matcher without double-matching or losing orders?
  • How would you halt and resume a market during extreme volatility?
  • Where do you enforce self-trade prevention and why there?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: place, cancel and replace limit and market orders; price-time priority; trade reports to both parties; public L2 updates and trades plus private order updates. Non-functional: p99 order-to...

High-Level Design

Clients hit an order gateway (auth, schema, rate limit). Gateways call a risk service that places a balance hold, then append the order to a per-market sequenced log (a replicated log such as Raft or ...


Submit Your Answer
Markdown supported