About this question

OCO Order Management

Medium · architecture & logic · Quant Developer interview question · hash map, state machine, logic, c++

One Cancels Other (OCO) orders are a critical component of algorithmic trading systems, allowing traders to simultaneously place profit-taking and stop-loss orders while eliminating the risk of double execution. This mechanism ensures that when one order in a pair is executed, its counterpart is immediately cancelled, maintaining strict control over position exposure. Task Implement an OCOOrderSystem that processes a stream of order operations including creation, execution, cancellation, and st