Interview practice question
A counter is wrong under load
Backend Engineering · Concurrency · Beginner
A request counter in your service shows lower numbers than expected when traffic is high. What is the likely cause and fix?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Non-atomic increment race.
- Multiple threads read-modify-write.
- Use atomic integer or lock.
- Or external atomic counter (Redis INCR).
- Add concurrency tests.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.