Implement a rate limiter over a stream of request timestamps. The interview usually starts with a single global stream, then adds user and experience identifiers. A request is allowed only if accepting it would not exceed the configured request count inside the sliding window. Reported variants call this "Rate Limiter", "Log Rate Limiter", or a LeetCode 359 / 362-style rate limiter. The Roblox version is not exactly either LeetCode problem: it asks you to return a boolean decision for each request and, in the follow-up, enforce multiple independent windows at the same time.
Given sorted request timestamps, a window length, and a maximum request count, return whether each request should be accepted. [Source: darkinterview.com] `from typing import List def rate_limiter( requestTimestamps: List[int], windowLength: int, maxRequests: int, ) -> List[bool]: Return True for each accepted request and False for each denied request. Only accepted requests count against future capacity.
`requestTimestamps = [1, 2, 3, 4, 5, $L44] windowLength = $L45 maxRequests = $L46 rate_limiter(requestTimestamps, windowLength, maxRequests)