Design a low-latency trading system
Company: Citadel
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Technical Screen
Design an electronic trading platform that supports equities trading with limit and market orders. Specify how you would:
(
1) maintain per-symbol order books and implement a price–time priority matching engine;
(
2) ingest and normalize market data from multiple venues and publish snapshots plus incremental updates with bounded skew;
(
3) expose authenticated APIs for order entry (REST/gRPC) and a low-latency streaming protocol for market data;
(
4) perform pre-trade risk checks (credit/position/price bands), ensure idempotent submissions, and provide exactly-once execution reports;
(
5) achieve P99 end-to-end acknowledgement under 5 ms within one region at 200k orders/second peak, and scale horizontally for bursts;
(
6) persist state with an append-only log or event sourcing, support deterministic replay/backtesting, and meet strict auditability;
(
7) handle partial fills, cancels, mass cancels, auctions, market halts, and symbol pauses;
(
8) design partitioning/sharding of order books, concurrency control inside the matcher, recovery and disaster recovery (RPO ≈ 0, RTO < 1 minute);
(
9) address fault tolerance, time synchronization and clock skew (e.g., PTP), fairness across partitions, backpressure, and flow control;
(
10) define monitoring, SLOs, capacity planning, and strategies to test latency and correctness under failures.
Quick Answer: This question evaluates expertise in designing low-latency, high-determinism electronic trading systems, covering order matching, market data ingestion and publish, partitioning/sharding, persistence for auditability, idempotency, pre-trade risk controls, and operational reliability.