AITeky Learn

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.

Locked. Sign up free

Learn

Understand each idea with everyday examples. No coding background needed.

  1. 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.
  2. 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.

  1. 03 30 min 🔒 AiTeky Pass On the job: the one-time code anyone could guess A six-digit login code has no limit on tries. Work out how often a guesser wins, compare four limits by effort and risk, choose, and write the note.

We use essential cookies to run the site. With your permission we also set one anonymous ID to count unique visitors, and analytics cookies to see which pages help learners. Cookie notice

Join AiTeky Learn. It's free.

Create a free account to track your progress, save items for later and get study suggestions.

Sign up free Log in