Design a sliding window rate limiter.
Unlock detailed company stats for this questionUpgrade
Design a rate limiter for an API service. Implement a class that allows a client (identified by a unique clientId) to make at most N requests within a rolling time window of T seconds. Implement allowRequest(clientId, timestamp), which returns true if the request is allowed and false otherwise.
Requirements: support multiple clients independently; process a large number of requests efficiently; optimize time complexity per request; consider how inactive clients can be removed from memory over time.
Format · Technical interview.
Community answers
No answers contributed by the community yet.
Related questions
Implement a sliding window log rate limiter.Design a rate limiter.Design rate limiting.Related courses

Course

Course
Course
