read.ai·Software Engineer·Technical Phone Screen
- Design and implement a rate limiter class that supports per-user request limits using a rolling time window. The class should expose a constructor taking a max request count and window size in seconds, and an allow method that takes a user ID and timestamp and returns whether the request should be permitted.
“My first instinct was a fixed window and I almost went with it before catching myself.”