False Sharing Benchmark - Quant Developer Interview Question
Difficulty: Medium
Category: concurrency
Asked at: Jump Trading, Tower Research, Citadel Securities, Optiver, HRT
Topics: concurrency, performance, memory-layout, atomic
Problem Description
False sharing degrades performance in low-latency trading systems when multiple threads modify independent variables residing on the same CPU cache line, triggering excessive cache coherence traffic. Mitigating this requires explicit memory alignment or padding to ensure frequently updated variables are separated by the architecture's cache line size, typically 64 bytes.
Task
Implement the thread-safe class AlignedCounters to manage two independent int64_t atomic counters, ensuring they are sep
Practice this medium 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.