Reported June 2026
Ripplinghash table

In-Memory Fixed-Window Rate Limiter

Reported by candidates from Rippling's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Rippling OA. Under 2s to a working solution.
Founder's read

Rippling's June 2026 OA has a rate limiter question that sounds like system design but isn't. It's a single pass with a hash map and a counter. If you're taking it in the next day or two, relax a little. The real work is reading the spec carefully: half-open windows aligned to timestamp 0, rejected requests that change nothing, and ties processed in input order. Up to 2 * 10^5 requests means O(n) is the goal. Miss one rule and the third example breaks. StealthCoder sits in the background as a safety net if you blank mid-assessment, but you probably won't need it.

The problem

Process a batch of requests through an in-memory, per-client rate limiter. Request i belongs to clientIds[i] and arrives at timestamps[i] seconds.
Use a fixed-window policy. Time is divided into half-open windows of length windowSeconds, aligned to timestamp 0. Therefore, timestamp t belongs to window [floor(t / windowSeconds) * windowSeconds, (floor(t / windowSeconds) + 1) * windowSeconds).
Each client has an independent quota in each window:
Allow a request when fewer than maxRequests requests for that client have already been allowed in the same window.
An allowed request consumes one quota slot.
A rejected request does not change the limiter state.
The timestamps are nondecreasing. Requests with the same timestamp are processed in input order. Return one boolean decision for every request in the original order.

Function
applyRateLimit(clientIds: String[], timestamps: int[], maxRequests: int, windowSeconds: int) → boolean[]

Examples
Example 1
clientIds = ["alice","alice","bob","alice","alice","alice"]
timestamps = [1,2,3,9,10,10]
maxRequests = 2
windowSeconds = 10
return = [true,true,true,false,true,true]
Alice fills her two slots in window [0, 10) at timestamps 1 and 2, so her request at 9 is rejected. Bob has an independent quota. Timestamp 10 begins a new window, so both later Alice requests are allowed.
Example 2
clientIds = ["x","x","y","x","x"]
timestamps = [0,4,4,5,5]
maxRequests = 1
windowSeconds = 5
return = [true,false,true,true,false]
Client x can use one slot in [0, 5) and one new slot in [5, 10). Client y is unaffected by x's quota.
Example 3
clientIds = ["a","b","a","b","a","b"]
timestamps = [7,7,7,7,7,7]
maxRequests = 2
windowSeconds = 3
return = [true,true,true,true,false,false]
All requests share one timestamp and are processed in input order. Each client independently allows its first two requests and rejects its third.

Constraints
1 <= clientIds.length == timestamps.length <= 2 * 10^5.
Each clientIds[i] is a nonempty printable ASCII string of length at most 50.
0 <= timestamps[i] <= 10^9, and timestamps is nondecreasing.
1 <= maxRequests <= 10^5.
1 <= windowSeconds <= 10^9.

Reported by candidates. Source: FastPrep

Pattern and pitfall

It reduces to counting per (client, window) pair. For each request, compute w = floor(t / windowSeconds). Look up the client's state in a hash map. Store the last window seen and a count of allowed requests. If the stored window differs from w, reset the count to 0 and update the window. Then if count < maxRequests, allow, increment, and return true. Otherwise return false and touch nothing. Because timestamps are nondecreasing, you only need the latest window per client, so memory stays small. The common pitfalls are incrementing on rejected requests, using t % windowSeconds by mistake, and sliding the window instead of fixing it. Use integer division, and watch that timestamps reach 10^9, which fits in 32-bit ints but is worth a sanity check. If you freeze on the OA, StealthCoder can hand you this loop in real time.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill In-Memory Fixed-Window Rate Limiter cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Rippling's OA.

Rippling reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

In-Memory Fixed-Window Rate Limiter FAQ

How hard is the Rippling rate limiter OA really?+

Easy on algorithm, medium on reading comprehension. It's one pass with a hash map and a counter per client. Most failures come from misreading the rules, like counting rejected requests or resetting windows wrong. If you can code a frequency map, you can solve it.

What's the trick to the fixed-window rate limiter?+

Compute the window index as floor(t / windowSeconds) and keep, per client, the last window index and the allowed count. When the window index changes, reset the count to zero. Only increment on allowed requests. That's the whole solution.

Do I need a sliding window or queue here?+

No. The policy is fixed-window, aligned to timestamp 0, so a per-client counter is enough. Sliding window logs or deques are for a different rate limiter variant. Using one here adds complexity and can produce wrong answers on the boundary cases.

What edge cases should I test before submitting?+

Test requests exactly on a window boundary, like timestamp 10 with windowSeconds 10, which starts a new window. Test many requests sharing one timestamp, multiple clients interleaved, and maxRequests of 1. Run all three given examples, since they cover boundaries and independence.

How should I prepare in the next 48 hours?+

Write this one from scratch twice with a hash map keyed by client. Then practice similar counting-per-key problems, since the Rippling OA tends toward practical simulation. Focus on clean state handling, not fancy data structures. Complexity target is O(n) time and O(clients) space.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Rippling.

OA at Rippling?
Invisible during screen share
Get it