Scrivio Interview library
ScenarioAdvanced7 min read · updated 13 November 2026

At market open a trading venue gets 2 million order messages in the first second, ten times normal. Acknowledgement latency for some clients rose from 50 microseconds to 80 ms, and a primary engine failed; the backup took over, but two clients reported fills they could not reconcile.

How should the venue handle the opening burst and the engine failover so latency stays predictable and every client's view of its orders stays exact?

Open with a call auction, which collects orders during a call period and matches them at the single price that maximises traded volume, so there is no race at the open and the burst is spread out. Protect the engine with per-client message rate limits at the gateways that reject with a clear reason instead of queuing without bound, so latency stays predictable for everyone. Make failover exact: the backup consumes the same sequenced journal and takes over from the last sequence number confirmed there, execution reports are sequenced and stored so gateways can resend anything a client missed, and clients reconcile through FIX sequence numbers, resend requests, order status queries and drop-copy feeds; then test failover at opening-level load and give clients sequence-level incident reports.

Why this question is asked

The opening of a market is the most stressful second of the trading day. Overnight news, orders queued before the open and algorithms racing to be first all arrive together, and that is exactly when an engine failure does the most harm. Here two separate things went wrong: latency for some clients jumped by more than a thousand times, and after failover two clients could not reconcile their fills, which for an exchange is a serious incident. Interviewers ask this scenario to test both market structure knowledge and precise reasoning about failover. In this answer, we will see why the burst hurt latency, replace the race with a call auction, add rate limits, find how the fills became unreconcilable, design exact failover, and set up reconciliation and testing.

1Why Latency Jumped From 50 Microseconds to 80 Milliseconds

An engine that matches, say, 500,000 messages per second has no problem with normal load, but 2 million messages in one second is four times its capacity. Messages that cannot be processed wait in queues, and a queue that grows by 1.5 million messages per second adds latency quickly: every message waits behind everything ahead of it. The clients who sent the most messages, often aggressive algorithms resending and cancelling, filled the queues, and every other client's orders waited behind them. That is how 50 microseconds became 80 milliseconds.

The lesson is that an unbounded queue turns overload into unpredictable latency for everyone. We need to remove the burst where we can and refuse excess traffic where we cannot.

2Replace the Race With an Opening Auction

In a continuous market, the first orders after the open trade first, so every participant rushes to send at the same microsecond. A call auction removes the race. During a call period, for example the ten minutes before the open, orders are collected but not matched, and the venue publishes an indicative price and volume. At the open, the engine computes the single price that maximises the volume that can trade, matches all eligible orders at that price, and only then starts continuous trading.

For each candidate price, the executable volume is the smaller of the buy quantity willing to pay at least that price and the sell quantity willing to accept at most that price. The engine picks the price with the largest such volume, with tie-breaking rules on imbalance and the reference price that each venue defines in its rulebook.

Choosing the opening price
PriceBuy at or aboveSell at or belowTradable
10.009,0002,0002,000
10.057,5004,5004,500
10.106,0006,5006,000
10.154,0008,0004,000
10.202,5009,5002,500
10.10 maximises traded volume: 6,000 shares cross at one price.

Because orders can arrive at any time during the call period, the opening burst is spread over minutes, and no participant gains by being a microsecond faster at the open.

3Rate Limits at the Gateways

Even with an auction, some clients will send far more messages than the engine can fairly absorb. Each client session gets a message rate limit at its gateway, for example 5,000 messages per second, enforced with a token bucket. A message beyond the limit is rejected immediately with a clear reason such as throttled, rather than queued. The client knows at once and can slow down, and the engine's input queue stays short, so every other client keeps its normal latency.

Limits are published in the venue's technical specifications and tiered by agreement, and the gateways also enforce an overall cap in front of the sequencer. The principle is to fail fast and visibly at the edge rather than slowly and invisibly in the core.

4How the Fills Became Unreconcilable

Two clients reported fills they could not reconcile, which means their view of their orders differed from the exchange's. The typical cause is that the primary acted on, or reported, something the backup did not know. For example, the primary matched messages that had reached it but were not yet confirmed in the replicated journal, and sent execution reports for those trades. When it failed, the backup took over from the last confirmed sequence number, never saw those messages, and the clients' resent orders were matched again against a different book. The clients now held fills that the exchange of record did not have, or fills at different prices.

The other common cause is on the output side: execution reports that were generated but never stored, so after failover the gateway could not resend them, and the client never learned of a fill that did happen.

5Making Failover Exact

The fix is to tie everything to the sequenced journal. The engine processes only messages that are confirmed in the replicated journal, so the backup, which reads the same journal, has seen exactly the same inputs. Execution reports are generated deterministically from those inputs, sequenced, stored in an output journal, and only then released to gateways. When the backup takes over, it continues from the last sequence number confirmed in the journal; because it computed the same state, its outputs up to that point are identical to the primary's.

Gateways track, for each client session, the last output sequence they delivered. After failover, they ask the new primary for anything after that point and resend it, so every client receives every report exactly once, in order.

Step throughFailover with exact client state
ClientGatewayJournalBackup engine
NewOrder, FIX seq 812
sequenced as 9001 and replicated
9001 (backup computes the same fill)
primary fails before report 9001 is delivered
promoted at journal sequence 9001
resend outputs after the last delivered
execution report for 9001
ExecutionReport, FIX seq 1450

8 messages in order. Play them, or step through them one at a time.

Clients see every fill once, because outputs are sequenced and stored before release.

6Client Reconciliation and Testing

Clients need their own tools to confirm their state. FIX sessions number every message in both directions, so a client that sees a gap in the exchange's sequence numbers sends a resend request for the missing range and the gateway replays it. Clients can also send order status requests for any order they are unsure of. Drop-copy feeds send a firm's risk and back-office systems an independent copy of every execution, so the firm can check its trading systems against a second source.

Failover must be tested under the conditions where it matters: replay a recorded opening at full rate in a test environment and kill the primary during the burst, then check that every client's view matches the journal. And when an incident does happen, the venue should give affected clients a report at sequence level: which messages were received, how they were sequenced, which executions were generated, and when each was delivered. That turns an argument about who is right into a check against a shared record.

7Follow-up questions

Doesn't rejecting messages hurt the clients who are rejected?

It affects only clients exceeding their published limit, and they get an immediate, explicit reason, so their systems can react. The alternative, queuing everything, hurts every client, including those who behaved well, with unpredictable latency.

Why not let the backup start from its own last processed message?

Because the backup may be slightly ahead of or behind what was confirmed. Taking over at the last sequence confirmed in the replicated journal gives a single point that both engines and all gateways agree on, which is the only way client state can be exact.

Are there closing auctions too?

Yes. Many venues end the day with a closing auction, which sets the official closing price used for index calculations and fund valuations. It uses the same volume-maximising logic and concentrates liquidity at one moment.

8Conclusion

In this answer, we saw that the opening burst overloaded the engine's queues, so a call auction that matches the open at the volume-maximising price removes the race, and gateway rate limits that reject excess messages keep latency predictable. Unreconcilable fills came from the primary acting on or reporting things the backup never saw, so the engine must process only journaled inputs, store sequenced outputs before release, and fail over at the last confirmed sequence while gateways resend missed reports. FIX sequence numbers, resend requests, order status requests and drop copies let clients reconcile, and failover is tested at opening load.

What to say in the interviewAbout 80 seconds aloud

Open with

Two problems, two fixes. The latency jump is unbounded queuing: two million messages in a second is several times the engine's capacity, so everyone waited behind the heaviest senders.

Then, if they want more

I would remove the race with an opening call auction, collecting orders during a call period and matching them at the single price that maximises traded volume, then starting continuous trading.

And I would put per-session rate limits at the gateways, say a token bucket at a published rate, rejecting excess messages with a clear throttled reason instead of queuing, so latency stays predictable for everyone.

The unreconcilable fills mean the primary did or reported something the backup never saw, for example matching messages not yet confirmed in the replicated journal, or sending reports that were never stored.

Failover has to be exact: the engine processes only journaled inputs, execution reports are sequenced and stored before release, and the backup, which consumed the same journal, takes over at the last confirmed sequence. Gateways track the last output delivered per session and resend the rest. Clients reconcile with FIX sequence numbers, resend requests, order status requests and drop copies.

Then I would test failover by replaying an opening at full rate and give clients sequence-level incident reports.

About this answer

Last updated
13 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "How should the venue handle the opening burst and the engine failover so latency stays...": https://scrivio-interview-library.netlify.app/architecture/system-design-problems/0c15837fca/