What they're testing
Whether you spot the boundary hole — the detail that separates people who've implemented one from people who've read about it.
The short answer~30 seconds
A fixed window is the simplest and permits a double burst: 100 requests at 10:00:59 and 100 more at 10:01:00 is 200 within a second. A sliding window log is exact but must store every timestamp. A token bucket is the pragmatic choice: two numbers (tokens and refill rate), controlled burstiness, and a compact Redis implementation. I default to token bucket unless a contract demands exactness.
The long answer
The token bucket is favoured because it models what we actually want: let a user burst a little (they open a page and ten requests fire, which is normal) while capping the sustained rate. Bucket size is the permitted burst, refill rate is the sustained limit. Those two parameters express a policy that a single number can't.
The sliding window counter is a compromise worth knowing: keep two counters — the current window and the previous — and interpolate by how far into the current one you are. It removes the boundary hole at nearly fixed-window memory cost, and it's what many CDNs use. It's approximate rather than exact, but the error is far smaller than the cost of storing every timestamp.
The implementation detail people skip: the limit must be atomic across instances. Read-then-write to Redis from three machines lets more through than the limit. The correct shape is a Lua script executed atomically on Redis, or INCR with a conditional EXPIRE in one pipeline. And always return Retry-After with the 429 — a limit that doesn't say when to try again just makes clients try immediately.
What they'll ask next
?Limit by what — IP, user, or API key?
By whatever identifies the responsible party. IP is the last resort, because NAT collapses an office onto one address and under IPv6 attackers have addresses to spare. For signed-in users, the user id; for a login endpoint, both IP and username, since at that point there's nobody yet to attribute it to.
These lose points
- Counting in each instance's memory. With three pods the effective limit is three times the number you configured.