Quant Interview Practice Questions
题目详情
In high-frequency trading systems, order book snapshots are frequently read by multiple strategy threads and updated by a single market data thread. To minimize latency and avoid locking, a double-buffering scheme is often used. The writer prepares data in a background buffer and atomically swaps a pointer to make it active, while readers track their access using reference counts. Task Implement a simulated DoubleBuffer class that manages an order book snapshot (best bid and best ask) using two