Per-User Sliding Window Rate Limiter

Asked at Plaid · Coding Questions · Difficulty: Medium

For each request, if the number of already allowed requests for that user in the interval `(timestamp - windowSize, timestamp]` is less than `maxRequests`, allow the request and output `ALLOW`; otherwise reject it and output `DENY`.

Loading the problem…