Design exchange–trading system message flow
Jane StreetSoftware Engineer · OnsiteLast updated
This question evaluates a candidate's knowledge of distributed messaging protocols, fault-tolerant system design, and financial trading interface competencies, including defining message contracts, session management, and guarantees like idempotency and ordering.
Design the message contract and flow between a firm's trading system (OMS/EMS) and an external exchange.
Assume:
- The trading system sends orders and receives acknowledgements, rejects, cancels, and fills.
- The exchange is an external system reachable over the network.
- The system must handle retries, partial fills, out-of-order delivery, and disconnect/reconnect.
Deliverables:
- What message types are required in each direction (trading system → exchange, exchange → trading system)?
- For each message type, what are the key fields (IDs, timestamps, quantities, prices, etc.)?
- How do you guarantee idempotency, ordering, and exactly-once or effectively-once processing at the application level?
- How do you handle session management (heartbeats, sequence numbers, resend/replay) and failure modes (timeouts, dupes, reconnect)?
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.