Verified interview challenge
Build a fixed-window token limiter
Track per-key token usage correctly as requests cross time windows or trigger a reset.
Unlock with Full AccessThe challenge
Build a fixed-window limiter in which every key has its own token usage. A request consumes quota in its current window, and the count starts afresh when time enters the next one.
Extend the implementation with per-key resets and the full workload. The important cases occur where an operation changes eligibility, including a window boundary or a reset that must not affect another key.
What you'll practise
Window state
Associate usage with the right key and active time window.
Boundary correctness
Keep admission and reset operations consistent at quota and timestamp edges.
# Build on your implementation
# Run checks for the current part
# Full starter code includedRun your code to see results.