← Questions
Per-key fixed-window cost limiter
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Build a rate limiter that meters cost rather than request count. Each key may spend at most limit units in each fixed window of window seconds, with windows aligned to multiples of window. Process commands: ALLOW key cost t answers whether the request fits (and records it if so), and RESET key clears that key's usage.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
