AdvancedMultiple choice
What data structure best supports a limit order book that must add, cancel and match quickly?
- AA single balanced tree keyed on price, holding every order
- BAn array of price levels plus a map from order id to node
- CA hash map keyed on price with no additional structure
- DA sorted list of every live order in the market
The worked solution is in Premium
The answer, the full working and the one idea to take away – for this and all 1,322 questions in the bank. Answer it in practice and your working is marked, with a known mistake named when you make one.
Reported in interviews at
More systems and low latency questions
- An array-based book pre-allocates one slot per price tick.Foundation
- You join a price level behind 800 shares.Foundation
- Designing an order book, part 1 of 3Foundation
- You keep one million live orders in a hash map at 48 bytes an entry.Applied
- A buy order for 500 at a limit of $100.02 meets offers of 200 at $100.00, 100…Applied
- Designing an order book, part 2 of 3Applied