ABA Problem: Lock-Free Stack - Quant Developer Interview Question
Difficulty: Hard
Category: concurrency
Asked at: Jump Trading, Citadel, Tower Research, Optiver, HRT
Topics: concurrency, lock-free, data-structures, c++
Problem Description
Lock-free algorithms are critical in low-latency trading systems to prevent thread blocking and priority inversion, ensuring consistent execution times. The ABA problem arises in these concurrent environments when a memory location is modified and restored to its original value between reads, potentially corrupting data structures like stacks during atomic Compare-And-Swap (CAS) operations. To mitigate this, developers employ tagged or stamped pointers to version memory addresses, ensuring that
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.