Implement an in-memory rate limiter allowing K refunds per merchant in a rolling 5-minute window.
Unlock detailed company stats for this questionUpgrade
To prevent API abuse on a refund service, a merchant can only initiate K refunds within a rolling 5-minute window. Implement boolean allowRefund(String merchantId, long timestamp) returning true if allowed and false if the merchant exceeded the limit in the last 5 minutes.
Format · Walmart SDE3 DS+coding round.
Community answers
No answers contributed by the community yet.
Related questions
Implement a sliding window log rate limiter.Implement a working rate limiter core.Implement token bucket and fixed window rate limiters.Related courses

Course

Course
Course
