Scope an order book45 min
Tell a story from your work2 min
Walk through your project10 min
Say each answer out loud, then open the fold.
Under a nanosecond against around 100. Memory comes in 64-byte chunks. Fast data structures
10,037 − 9,900 = slot 137. Fast data structures
A 300, B 200 and 100 of C. Yours waits. Price-time priority
At 99, the resting order's price. Matching a trade
1 − (5/6)⁴ = 671 / 1,296, about 51.8%. Probability is counting
I'd start with a lock-free concurrent tree.A clever structure before the requirements worries an interviewer. One thread per book is usually simpler and faster.
We decided, we built it, and we fixed it.They're hiring you. With "we" all the way through, they can't tell what you did.
The stack was Python, Postgres, Airflow and Docker.A list of tools isn't a decision. Say what you chose, what you turned down, and why.
To cancel, I'd scan the level for the order id.Cancels are a large share of messages, and a busy level holds thousands of orders. Keep an index from id to order.