Design a low-latency trading system
CitadelSoftware Engineer · Technical ScreenLast updated
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.
Design an electronic trading platform that supports equities trading with limit and market orders. Specify how you would: (
- maintain per-symbol order books and implement a price–time priority matching engine; (
- ingest and normalize market data from multiple venues and publish snapshots plus incremental updates with bounded skew; (
- expose authenticated APIs for order entry (REST/gRPC) and a low-latency streaming protocol for market data; (
- perform pre-trade risk checks (credit/position/price bands), ensure idempotent submissions, and provide exactly-once execution reports; (
- achieve P99 end-to-end acknowledgement under 5 ms within one region at 200k orders/second peak, and scale horizontally for bursts; (
- persist state with an append-only log or event sourcing, support deterministic replay/backtesting, and meet strict auditability; (
- handle partial fills, cancels, mass cancels, auctions, market halts, and symbol pauses; (
- design partitioning/sharding of order books, concurrency control inside the matcher, recovery and disaster recovery (RPO ≈ 0, RTO < 1 minute); (
- address fault tolerance, time synchronization and clock skew (e.g., PTP), fairness across partitions, backpressure, and flow control; (
- define monitoring, SLOs, capacity planning, and strategies to test latency and correctness under failures.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.