Disruptor Pattern: SPSC Ring Buffer - Quant Developer Interview Question
Difficulty: Hard
Category: concurrency
Asked at: Jump Trading, Tower Research, Citadel Securities, Optiver, HRT
Topics: concurrency, lock-free, design-pattern, cpp
Problem Description
The Disruptor pattern is a high-performance inter-thread messaging mechanism widely used in low-latency financial systems, such as order matching engines, to minimize jitter and maximize throughput. It utilizes a pre-allocated ring buffer with sequence barriers to coordinate data exchange between producers and consumers without the overhead of mutual exclusion locks.
Task
Implement the SpscRingBuffer class to facilitate lock-free communication between a single producer thread and a single consu
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.