1,000,000 messages/sec hypothetical peak
A hypothetical burst of new, cancel and modify messages. The duration and per-symbol skew require separate assumptions.
Trace FIFO priority, partial fills and cancellation in a hypothetical continuous limit book, then reason about sequencing, journal capacity and recovery.
For this hypothetical continuous limit order book, one sequenced writer per symbol chooses the best eligible opposite-side price, then the earliest order at that price. It fills up to the smaller remaining quantity, repeats while prices cross, and rests any unfilled limit quantity. Separate order entry, durable sequencing, matching and market-data publication. Real venues have additional rules; this is an interview learning model, not a production exchange design.
Use one fictional symbol, integer price ticks and fictional quantity units. Process commands in sequence order. All orders are displayed, good-until-cancelled limit orders. This simplified continuous book excludes hidden orders, auctions, routing, fees and self-match rules. Fills use the resting order’s price.
Add 5 units at 100 ticks.
Asks in priority order: A: 5 units at 100 ticks. No bids.
Add 4 units at 100 ticks.
Asks in priority order: A: 5 units at 100 ticks; B: 4 units at 100 ticks. No bids.
Add 6 units at 101 ticks.
Asks in priority order: A: 5 units at 100 ticks; B: 4 units at 100 ticks; C: 6 units at 101 ticks. No bids.
Submit a limit buy for 7 units at up to 102 ticks. The lowest ask wins first; at the same price, first in is first out (FIFO).
Fill 5 units from A at 100 ticks then 2 units from B at 100 ticks. D is fully filled. Remaining asks: B: 2 units at 100 ticks; C: 6 units at 101 ticks. No bids. B keeps its place for its unfilled quantity.
Remove B’s remaining 2 units. The earlier fill is unchanged.
Remaining asks: C: 6 units at 101 ticks. No bids.
Submit a limit buy for 3 units at 100 ticks. The best ask is 101 ticks, above this buy’s limit.
No fill. E rests as a bid for 3 units at 100 ticks. Asks remain C: 6 units at 101 ticks.
Rehearse why A fills before B, why C does not fill, and why cancelling B cannot undo its execution. The log must preserve this sequence, integer quantities, order identifiers and the rule version so replay makes the same decisions. This is an educational algorithm trace, not production trading code or financial advice.
Illustrative interview sizing for the whole modeled service. These are assumptions and targets, not measured exchange or ClawPad results.
A hypothetical burst of new, cancel and modify messages. The duration and per-symbol skew require separate assumptions.
An assumed participant population; this is not a measured daily active user count.
Raw journal payload only, using decimal GB. Copies are included only in the second value; retention and overhead are separate.
An illustrative target from delivery of a sequenced command to the match core through its in-memory state update. Excludes network, risk checks, durable commit and response delivery. Measure end-to-end latency separately.
Establish clear problem boundaries before proposing architectural components.
Keep daily message volume, burst rate and copy count separate. All rows use the same whole-service scope.
The fixed 64-byte message is an editorial payload assumption, not the size of every FIX, OUCH or ITCH message. Order lifecycle messages include new, cancel and modify commands; they are not all executions.
The 24-hour average is only an arithmetic comparison. A real workload needs market hours, burst duration, symbol distribution and market-data fanout. Daily totals do not establish peak capacity.
Nasdaq’s references illustrate price-time priority and distinguish OUCH order entry from ITCH market data. This model omits venue-specific priority exceptions and order types. The references do not substantiate this design’s capacity or latency targets.
| Dimension | Calculation Formula | Estimated Result |
|---|---|---|
| Hypothetical peak message rate | 1,000,000 new, cancel or modify messages/second at peak | A sizing assumption for the whole modeled service, not a sustained rate or a benchmark |
| Daily average over 24 hours | 1,000,000,000 messages/day ÷ 86,400 seconds/day | About 11,574 messages/second; intraday distribution is unspecified |
| Daily raw journal payload | 1,000,000,000 messages/day × 64 bytes/message | 64 GB/day (decimal GB) across the whole modeled service, before copies |
| Daily payload across copies | 64 GB/day × 3 total copies | 192 GB/day of payload only; excludes indexes, protocol framing, market-data output and headroom |
Reviewed October 23, 2026. Calculations use the hypothetical inputs above; source results are not benchmarks of this design.
How requests navigate ingress gateways, application logic, caching, and persistence.
Authenticate participants, validate price ticks and quantities, enforce risk limits and deduplicate requests by participant and request identifier before sequencing. Parsing cost and network latency must be measured. OUCH handles orders and their updates; ITCH is a separate market-data protocol.
Assign ordered sequence numbers and durably replicate each accepted command to a quorum before acknowledging acceptance. Matching consumes committed commands. An acceptance response is distinct from a fill report. Fence old leaders with an epoch, stop accepting when a quorum cannot commit, and preserve request identity and result mapping for safe retries.
Give each symbol one state owner, maintain FIFO queues at price levels, and apply committed commands in order. Preallocate where useful and profile allocations, queues and cache behavior. Deterministic results come from explicit rules and ordered inputs, not a guaranteed execution duration.
Publish sequenced book changes and trades after committed matching. Multicast can reduce repeated sends, but consumers can lose packets or observe different delays. Supply gap detection, recovery and snapshots; do not promise simultaneous arrival or equal market access.
Entity models, indexing, and primary key partitioning.
In-memory cache-line aligned C++ struct; price levels indexed via custom B-Tree with intrusive doubly linked list queues.
Store stable execution identifiers and command sequences for audit and idempotent downstream delivery. This sketch does not establish regulatory reporting compliance.
A bounded in-memory risk view needs explicit freshness, reservation and recovery rules. Cache-friendly layout may help, but application code cannot guarantee L3 residency or a fixed access time.
How to defend engineering compromises when challenged by interviewers.
Rationale: A single state owner per symbol simplifies ordering and avoids concurrent mutation within that book. Partitioning symbols can add parallelism, but a hot symbol and shared risk limits can bottleneck it. CPU affinity and preallocation are options to measure; neither provides a fixed speedup or a latency guarantee.
Rationale: Point-to-point TCP offers ordered delivery per connection and creates per-consumer backpressure. UDP multicast reduces sender fanout work on supported networks, while requiring application-level sequencing and loss recovery. Compare load, tail latency and recovery costs for the actual topology; neither transport guarantees equal arrival times.
Key interview questions and conceptual defenses.
The hypothetical 1,000,000,000 messages/day at 64 bytes/message produce 64 GB/day of raw payload, or 192 GB/day across 3 total copies. These are decimal GB for the whole modeled service, not each symbol partition. Indexes, protocol framing, market-data output, retention and operating headroom need separate budgets. The 1,000,000 messages/second peak is an assumption, not an all-day rate or a measured result.
This model keeps ordered book mutation in one in-memory owner to make priority rules and replay explicit. PostgreSQL can still store accounts, configuration or query projections, and its suitability depends on the measured workload and durability requirements. A separate journal and core add recovery complexity; they do not establish that a relational database is universally too slow.
Acceptance is acknowledged only after the sequenced command is durably committed to a quorum. Recover from a snapshot plus the committed log suffix using the same rule version, then verify the replay position before enabling writes. Fence the old leader with a new epoch so only one writer can commit. Preserve request and execution identifiers so retries cannot duplicate accepted commands or downstream effects. If a reply is lost after commit, the client may not know the outcome and must query or retry the same identifier. Promotion can take time; writes can be unavailable or rejected while quorum or leadership is unresolved. This is a design contract to test, not a promise of instant or lossless failover under every failure.
No. This example uses a simplified continuous book of displayed limit orders. Nasdaq’s overview describes price/time priority and also distinguishes displayed from non-displayed shares. Real rulebooks add order types, auctions, routing and other priority rules. State your interview assumptions before tracing the algorithm.