Design a Stock Exchange Order Book
A limit order book for one symbol: price-time priority at the resting price, one side built from a dict of levels, a heap of prices and a FIFO per level, partial fills and an order's status, O(1) lazy cancels, every operation's cost, and one matcher thread per symbol fed by a queue, hammered by 8,000 orders from eight threads.
01 · One buy, three sellers
LLD-20 · Design a Stock Exchange Order Book
A buy for 10 at ₹102 meets three sellers.
5, then 3, then 2
A buy order for 10 shares at 102 rupees meets three sellers.
0:00 / 13:24