Behavioral correctness
Translate the rules faithfully. Keep identities, quantities and state consistent through delayed and repeated reports.
A C++ challenge for engineers moving across domains. Understand what an order means, then show how you reason about events, correctness and edge cases.
No prior financial-markets or FIX knowledge required.
A trader wants to buy 100 units. The exchange may trade them in several pieces.
Chooses quantity and price
Your code tracks state, fills and remainder
Executes trades and sends reports
Choose a scenario. Step through its messages and see the tracker update. Illustrative examples.
PendingNewThe request has been sent. The exchange has not acknowledged it yet.
Implement OrderTracker. Process one event at a time. These six rules summarize the full statement.
Validate state and quantities. One pending request per order; false changes nothing.
true consumes an ID forever. Cancel/replace name the current ID; old IDs still identify the order.
Add quantity and notional, even while pending. Old terms apply until Replaced confirms the change.
Apply new terms on confirmation. Keep every fill, even when filled exceeds the new total.
Ignore duplicate execId. Invalid reports: log a violation, keep the order unchanged, then continue.
Filled, Cancelled, Rejected, Expired: remaining = 0. Ignore late CancelRejected reports.
Keep the public interface, types and tests unchanged. All tests must pass.
We look at how you turn a written contract into reliable behavior: the questions you ask, the model you choose, the tests you use, and the trade-offs you can explain.
Translate the rules faithfully. Keep identities, quantities and state consistent through delayed and repeated reports.
Explain ownership, lifetimes, data structure choices and complexity. Keep the implementation readable.
Use meaningful event sequences and boundary cases. Explain a failure before changing the code.
Clarify assumptions, state invariants, discuss trade-offs and respond thoughtfully to new information.
Walk through the visual and restate the requirements.
The supplied challenge timebox. Build incrementally and explain the choices that matter.
Outside the coding timebox: explore restart/replay, bounded memory, thread ownership and latency.
Before coding, explain why a fill can arrive after a cancel request and why cancellation cannot erase an executed trade. Then use the fresh CoderPad session supplied by your interviewer.
The brief provides expected behavior. The implementation and problem-solving approach are yours.
Explore the events