InterviewDB Question

Optiver Graduate SWE 2025 OA Q2: Order Book Simulation with Price-Time Priority

Question Details

Problem Simulate a simplified limit order book. You receive a stream of orders: each order is {id, side, price, quantity} where side is "buy" or "sell". Buy orders are matched against the lowest-priced sell order at or below the buy price. Sell orders are matched against the highest-priced buy order at or above the sell price. On price tie, earlier orders have priority (FIFO). Unmatched remainder stays in the book. After processing all orders, return the remaining orders in the book grouped by s…

Full Details

🔒

Unlock all Optiver questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a reported interview question from a optiver interview for a swe role during the oa round.

It covers the following topics: Coding, Queue, Oa .