Seqlock: Optimistic Concurrency Control - Quant Developer Interview Question
Difficulty: Hard
Category: concurrency
Asked at: Jump Trading, Tower Research, Citadel Securities, Optiver, HRT
Topics: concurrency, lock-free, atomic, low-latency
Problem Description
A Seqlock (Sequence Lock) implements optimistic concurrency control using atomic sequence counters, allowing frequent readers to access data without blocking writers or acquiring heavy mutexes. This pattern ensures data consistency through versioning rather than mutual exclusion, making it ideal for scenarios where reads vastly outnumber writes.
Task
Implement the ConfigStore class to manage shared configuration data using the Seqlock pattern with std::atomic primitives. The class must support
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.