Design cross-exchange quote and execution abstractions, correct a reported spread error, and handle distinct venues, stale quotes, and uncertain fills.
Design Exchange and Instrument Abstractions for Quote Arbitrage
Company: Jane Street
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Technical Screen
Design the main abstractions and data flow for a **cross-exchange arbitrage system**. Several exchanges publish bid and ask quotes for instruments. The system should identify a quoted opportunity when a valid bid on one exchange is **strictly greater** than a valid ask on another exchange, then support parallel submission of the corresponding buy and sell orders.
A quote contains `InstrumentID`, `ExchangeID`, `BidPrice`, `BidSize`, `AskPrice`, `AskSize`, and `Timestamp`. An instrument has a global identifier. An exchange maintains its local order-book view and exposes an order-submission interface. Explain the responsibilities and interaction of the instrument and exchange abstractions, market-data listener, order-book manager, arbitrage engine, and execution router.
Use this **reported example as a consistency check**: for AAPL, exchange A has bid USD 1.00 and ask USD 1.10; exchange B has bid USD 0.90 and ask USD 1.00. The report claims that buying at B for USD 1.00 and selling at A for USD 1.00 yields USD 0.10 profit per share. Evaluate that claim and explain how it affects the opportunity rule.
Exact exchange APIs, order types, price precision, freshness rules, and fill behavior are open requirements to clarify. Give a design explanation rather than inventing a complete implementation interface.
### What a Strong Answer Covers
- Stable instrument identity and exchange-specific feed and execution responsibilities.
- Correct interpretation of executable bid and ask sides and the example's arithmetic.
- Current quote state, distinct-exchange matching, quantities, and validation before submission.
- Separate tracking of the two order legs, including partial or uncertain execution.
### Follow-up Questions
- What if the highest bid and lowest ask both belong to the same exchange?
- Why does submitting both orders in parallel fail to guarantee the quoted result?
Overview: Design cross-exchange quote and execution abstractions, correct a reported spread error, and handle distinct venues, stale quotes, and uncertain fills.
Design the main abstractions and data flow for a cross-exchange arbitrage system. Several exchanges publish bid and ask quotes for instruments. The system should identify a quoted opportunity when a valid bid on one exchange is strictly greater than a valid ask on another exchange, then support parallel submission of the corresponding buy and sell orders.
A quote contains InstrumentID, ExchangeID, BidPrice, BidSize, AskPrice, AskSize, and Timestamp. An instrument has a global identifier. An exchange maintains its local order-book view and exposes an order-submission interface. Explain the responsibilities and interaction of the instrument and exchange abstractions, market-data listener, order-book manager, arbitrage engine, and execution router.
Use this reported example as a consistency check: for AAPL, exchange A has bid USD 1.00 and ask USD 1.10; exchange B has bid USD 0.90 and ask USD 1.00. The report claims that buying at B for USD 1.00 and selling at A for USD 1.00 yields USD 0.10 profit per share. Evaluate that claim and explain how it affects the opportunity rule.
Exact exchange APIs, order types, price precision, freshness rules, and fill behavior are open requirements to clarify. Give a design explanation rather than inventing a complete implementation interface.
What a Strong Answer Covers Guidance
Stable instrument identity and exchange-specific feed and execution responsibilities.
Correct interpretation of executable bid and ask sides and the example's arithmetic.
Current quote state, distinct-exchange matching, quantities, and validation before submission.
Separate tracking of the two order legs, including partial or uncertain execution.
Follow-up Questions Guidance
What if the highest bid and lowest ask both belong to the same exchange?
Why does submitting both orders in parallel fail to guarantee the quoted result?