Object-Oriented Programming · LinkedIn · Medium
Problem Create a RateLimiter that decides whether incoming requests may proceed. It must support a lazy token-bucket design: replenish tokens only when a request arrives, using the elapsed time since the previous request rather than updating the bucket every second. Request timestamps are strictly increasing. The limiter permits no more than n requests during each m-second interval. The bucket can hold at most n tokens, and its refill rate is equivalent to restoring n tokens…
Checking your access…