Matching supply and demand at market open
This medium-difficulty coding problem asks you to compute the Indicative Opening Price for a stock before trading begins. It tests your ability to work with order-book data structures, apply multi-level ranking criteria, and handle tie-breaking logic—skills that quantitative trading firms value highly.
The problem requires you to find the price level that clears the most volume between buy and sell orders, then apply two successive tie-breakers: minimizing unexecuted orders at that price, and finally averaging any remaining candidates. The challenge lies in correctly interpreting what "executed" and "unexecuted" mean in the context of an order book, and in implementing an efficient algorithm that evaluates all candidate price levels.
- Order-book representation and traversal
- Volume matching logic (bids vs. asks)
- Multi-criteria ranking and tie-breaking
- Edge cases in floating-point averaging