What this C++ concurrency interview question tests
This easy question asks you to spot a correctness flaw in a parallel accumulation pattern—a common pitfall when moving sequential code into a multi-threaded context. It targets whether you can reason about data races and shared state without extensive debugging experience.
The question rewards candidates who think systematically about thread safety: where do multiple threads access the same memory, and what synchronization (if any) is missing? You don't need to write a fix, just identify the hazard and explain why it matters. This skill is foundational for any role involving concurrent C++, from trading systems to market-data handlers.
- Race conditions on shared variables
- Memory visibility across thread boundaries
- Atomicity and synchronization primitives