DeepFrontend
Learning Paths
Practice
System Design & DS
Design Studio
Data Structures Curriculum
Real-World Case Studies
Careers
Job Board
Resume Builder
Blog
Sign in
Search
⌘K
Go Pro
Loading compiler resources...
System Design Quiz Practice
Active Recall Drill Session
← Exit Session
Question 1 of 1
hard
System Design
Why is it a race condition to read a rate-limit counter from Redis, check it in application code, then write back an incremented value as three separate steps?
A
It isn't a race condition, this is perfectly safe
B
Two concurrent requests can both read the same 'before' value, both decide they're under the limit, and both increment — letting more requests through than the limit intends
C
Redis doesn't support numeric values
D
This only matters for token bucket, not other algorithms
Check Answer