Cryptocurrency Exchange System Design (Mock Interview + Matching Engine)

Design a cryptocurrency exchange platform like Coinbase or Binance that allows users to buy, sell, and trade cryptocurrencies. The system must handle real-time trading, order matching, wallet management, and blockchain integration with high security and reliability.

Constraints

Functional

User accounts with KYC, wallet management, buy/sell/trade, real-time order book, order matching, deposit/withdraw (crypto and fiat), multiple trading pairs, limit and market orders, price history and charts

Non-functional

High security for funds and data, order matching < 10ms, real-time prices and order book, 99.99% uptime for trading, millions of trades/day, strong consistency, KYC/AML compliance

Scale

10M users, 1M DAU; $1B daily volume, 10M trades/day, peak ~500/s; millions of order updates/day, peak ~50K/s; 1M deposits/withdrawals/day, peak ~20/s; ~5 GB/day trades (~1.8 TB/year), ~100 MB order book in-memory

Stages ahead

1Requirement Analysis
2API Design
3High-Level Design
4HLD Extensions
5Trade-offs