Track Locked and Crossed States Across Options Exchange Quotes
Last updated: November 29, 2026
Quick Overview
You receive a stream of top-of-book quote updates (timestamp, exchange, bid, ask) for one option series across many exchanges. Maintain the consolidated best bid and offer and emit an event each time the market changes between normal, locked, crossed and one-sided.
Chicago Trading Company
November 29, 20260
0
0 solved
You receive a stream of top-of-book quote updates (timestamp, exchange, bid, ask) for one option series across many exchanges. Maintain the consolidated best bid and offer and emit an event each time the market changes between normal, locked, crossed and one-sided.
US listed options trade on more than a dozen exchanges, so an options market maker like CTC constantly reasons about the consolidated market rather than one venue. This warm-up checks that you can hold per-venue state, recompute an aggregate correctly, and handle missing sides without crashing.
What the Interviewer Expects
- Stores the latest quote per exchange, replacing rather than appending
- Computes best bid as max and best ask as min over venues with a quote on that side
- Classifies locked (bid equals ask) separately from crossed (bid above ask)
- Emits only on state transitions, not on every update
- Handles one-sided or empty markets explicitly
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- With 16 venues the O(E) recompute is fine. What changes if there are 5,000 venues or price levels?
- How would you also report which exchanges are setting the best bid and best ask?
- Prices arrive as floats. What would you change before using this in production?
- How should a stale quote from a venue whose feed has gone silent be treated?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input is an ordered list of (ts, exchange, bid, ask) where either side can be None (no quote). Each update replaces that exchange's previous quote. Output is a list of `(ts, best_bid, best_ask, st...
High-Level Design
Keep a dict exchange -> (bid, ask). On each update overwrite the entry, then take the max bid and min ask over venues that actually have that side. With roughly 16 options exchanges a linear rescan ...