Concurrent Counter Increment - Quant Trader Interview Question
Difficulty: Hard
Category: Code Analysis
Practice quant interview questions from top firms including Jane Street, Citadel, Two Sigma, DE Shaw, and other leading quantitative finance companies.
Topics: concurrency, race-condition, threads, counter
Problem Description
Two threads are spawned, each executing a function that increments a shared counter variable by one, 1,000,000 times. The counter is initialized to zero. No locks or other synchronization mechanisms are used. After both threads complete, what can you definitively say about the final value of the counter?
Practice this hard trader interview question on MyntBit - the all-in-one quant learning platform with 200+ quant interview questions for Jane Street, Citadel, Two Sigma, and other top quantitative finance firms.