KatInterview

Ultra-Low-Latency Quoting Platform: Colo Core and Remote Control Plane

System DesignModel answer
HardModel answerSystem Designlow-latencymarket-makingkernel-bypass

Last updated

Architect a market-making stack for futures and options with a co-located hot path, microsecond latency targets, hard safety controls, and a remote operations site.

Problem

A proprietary firm runs automated market making in listed futures and options on a large derivatives exchange. You are asked to design the full platform: from the moment a market data packet arrives to the moment an order leaves, plus the tooling that people use to supervise it.

The platform lives in two places:

  1. Exchange data center (colocation): bare-metal machines that run the real-time quoting loop.
  2. Remote head office: where engineers, researchers and traders work, and where manual risk oversight and post-trade processing happen.

What the system must do

  • Market data intake: consume the exchange's multicast feeds over UDP and maintain an up-to-date limit order book per instrument.
  • Pricing and quoting: compute fair values, publish two-sided quotes, and react quickly to market-moving events (quoting passively or taking liquidity aggressively).
  • Pre-trade risk: check every outgoing order in well under a microsecond, covering position limits, per-order notional caps, price bands and message-rate limits.
  • Order entry: send new/cancel/replace messages over the exchange's session protocol (binary or FIX over TCP) and process execution reports.
  • Remote supervision: let people at the head office change strategy parameters, flip kill switches, and watch health and positions live, with zero impact on the real-time loop.

Targets

DimensionTarget
Tick-to-trade latencymedian < 2 µs, p99.9 < 5 µs
Determinismno GC pauses, strict core isolation
Market data rateup to 5 million messages/s at peak
Order burstsup to 50,000 orders/s
Safetyquotes are pulled automatically on disconnect or failure
Clock accuracysub-microsecond timestamps across all components

What to cover in your answer

  • Hardware and OS: kernel bypass, NIC timestamping, PTP, NUMA placement, cache-line behavior.
  • Software structure: hot path vs. cold path, inter-process communication (e.g., lock-free shared-memory queues), memory management.
  • Networking: protocol choices and how the colo site talks to the head office over a WAN.
  • Safety and resilience: drop copy, cancel-on-disconnect, propagating a remote kill switch, and state reconciliation after failures.

State your assumptions (instrument count, one exchange or several, software-only or FPGA) and justify the trade-offs you make.

Hints

Hint 1

Begin with a latency budget: split the 2 µs median across NIC receive, decode and book update, pricing, risk, and encode/transmit, and derive what that rules out (syscalls, locks, allocation, page faults).

Hint 2

Draw a hard line between hot and cold. The real-time cores should never wait on anything remote or slow; they talk to everything else through bounded lock-free queues that drop data rather than block.

Hint 3

Treat safety as layered: exchange-side cancel-on-disconnect, an independent drop-copy feed to central risk, a kill flag checked on every loop iteration, and a second route for mass-cancel that does not rely on the trading box.

Hint 4

Prefer a fail-safe posture over automatic failover: a warm standby that listens but does not quote, promoted deliberately after reconciling state, avoids two engines quoting simultaneously.