Difficulty: Hard
Category: low_latency
Asked at: IMC, Jump Trading, Tower Research, Optiver, HRT
Topics: concurrency, lock-free, atomic, c++17, optimization
Low-latency financial systems rely on lock-free data structures to minimize thread contention and context switching during market data streaming or order execution. The Single-Producer Single-Consumer (SPSC) ring buffer utilizes atomic indices and memory barriers to ensure thread safety without the overhead of mutexes. This approach maximizes throughput in high-frequency trading environments where microsecond delays are critical. Task Implement the SPSCQueue class in C++17 to manage a fixed-siz
Practice this hard developer interview question on MyntBit - the LeetCode for quants with 200+ quant interview questions for Jane Street, Citadel, Two Sigma, and other top quantitative finance firms.