Limit Order Book with Top-of-Book Volume

Asked at Citadel · Coding Questions · Difficulty: Medium · Last asked May 7, 2026

Implement a limit order book for a single trading symbol. The book keeps resting buy orders (bids) and sell orders (asks) and answers questions about the best prices. Trades are never executed: orders only rest, so a bid may sit at or above an ask without matching.

Loading the problem…