AiTeky Original Interactive Learning & Practice Intermediate
Key-value stores: rate limits, windows, buckets and the OTP guessing attack
See how a fixed-window counter lets a burst through at the window edge, how a sliding window and a token bucket treat the same traffic, and what a rate limit does to the odds of guessing a one-time code.
A key-value store with expiring counters is the usual place to keep rate limits: "at most 5 tries a minute". The idea is simple, but how the window is defined changes who gets through. And for a login or one-time code, the limit is a security control, not just a convenience.
This course models three limiters with small Python programs you can run in your browser. Python stands in for the store: the dictionaries and lists play the role of counters with expiry. Check your key-value store's documentation for atomic increments, key expiry and scripts. All numbers are made up.
- Learn lessons explain one idea at a time and let you run it.
- Industry ready lessons decide and justify, and end with interview questions.
No key-value store experience is assumed. Basic Python helps.
- ▶ Run code in your browser. Nothing to install
- ✓ Exercises that check themselves
- 📖 Tap a word to see what it means
Locked. Sign up free
Learn
Understand each idea with everyday examples. No coding background needed.
- 01 20 min Free sample 🔒 AiTeky Pass The fixed window and its edge Count requests per calendar minute, allow five, and see how ten requests in seven seconds all get through when they straddle a minute boundary.
- 02 20 min 🔒 AiTeky Pass Sliding window and token bucket Run the same traffic through a sliding window and a token bucket, and compare how many requests each allows and how smoothly.
Industry ready
Real problems from real jobs, and the questions interviewers ask about them.

