Roblox Coding Interview Question: Sliding-Window Rate Limiter

Given chronologically sorted requests, each with a timestamp, user ID, and experience, implement a sliding-window rate limiter.

A request is allowed only if both its user and experience have fewer than maxInWindow previously allowed requests within the current windowLength; otherwise, it is rejected.

Return a boolean array indicating whether each request is allowed.

This problem asks you to build a sliding-window rate limiter over chronologically ordered requests. For each request, you need to track the number of already allowed requests within the current time window for both the user dimension and the experience dimension. The request is accepted only if both counts are below <code>maxInWindow</code>; otherwise, it is rejected. A typical solution uses hash maps plus queues or deques to expire old requests efficiently while maintaining the allowed counts in O(1) or amortized O(1) per request.

END
 0