Audit a usage-window answer by replaying the actual arrival timestamps under the documented counting rule. A calendar reset and a sliding lookback can disagree immediately after a boundary, even when both are described as three requests per minute.
Use a timestamp queue for a continuous sliding-window model and calendar buckets for a fixed-window model. The artifact must preserve which arrivals count, which expire and whether rejected attempts change the history. Relative phrases such as last month are not the issue here; admission depends on a concrete event-membership algorithm.
Identify the implemented window mechanism
Record the limit, duration, scope, time basis, endpoint convention and counted event type. Determine whether the system counts attempts, admitted requests, completed operations or another event. A rejected request may or may not consume allowance under the real policy.
Microsoft's ASP.NET Core rate-limiting documentation describes fixed-window and sliding-window limiters, including segmented sliding windows. That is a specific implementation model. The exact continuous timestamp queue below is an original fictional contract, not a claim that Microsoft's segmented implementation makes identical boundary decisions.
Do not treat every limiter called sliding window as interchangeable. The stored state and expiration granularity matter. Verify the actual source before comparing an observed rejection with a theoretical model.
Freeze two complete fictional contracts
Both teaching contracts allow at most three admitted requests under their stated counting rule. Contract F counts requests in UTC calendar-minute buckets. At the start of a new minute, its new bucket starts empty.
Contract S counts admitted arrivals in the preceding sixty seconds using the interval strictly after t minus sixty seconds and through t. A rejected attempt is not added to its queue. There is no separate token refill, concurrency limit or other traffic.
For the candidate request, remove expired arrivals first, inspect the retained count, and admit only if adding the request stays within three. These are invented rules, not guarantees about a named provider.
Advance the sliding queue explicitly
Evaluate a new candidate at 00:00:21 under S, retaining its earlier rejection at 00:00:10 as a non-counted attempt. The lookback begins strictly after 23:59:21, so the 23:59:20 arrival has expired. The 23:59:40 and 23:59:50 arrivals remain.
Two counted arrivals remain, so the new candidate can be admitted as the third. The resulting queue contains 23:59:40, 23:59:50 and 00:00:21.
Do not mix the branches' histories. F admitted the 00:00:10 request, while S rejected it. Later comparisons must carry forward each model's own accepted events rather than using one shared count after their decisions diverge.
Make the endpoint rule testable
Under S's declared interval, an arrival exactly sixty seconds old is excluded. At 00:00:20, the 23:59:20 arrival is therefore outside the retained queue. A source that uses a different inclusion rule could make a different exact-boundary decision.
Record that convention rather than hiding it behind the word within. A fixture just before, exactly at and just after expiration can expose a one-boundary error that ordinary timestamps never reveal.
The number check should reproduce elapsed seconds and queue membership. It should not replace the rule with calendar subtraction simply because both can be described using a minute.
Distinguish the queue from a token bucket
A token bucket replenishes a balance according to its own capacity and refill policy. This model expires discrete counted arrivals based on their timestamps. Idle time can change both systems, but through different state transitions.
Likewise, a task finishing does not remove an arrival from S unless its policy explicitly ties counting to completion. The stock-capacity ledger addresses reserved and committed occupancy, a different resource model.
An answer should name the mechanism that the source actually establishes. It cannot infer rolling behavior from a rate alone, or infer a token bucket because a dashboard displays a remaining count.
Verify scope and observation completeness
A queue for one client does not establish an account-wide count if other clients share the allowance. Record the namespace, caller identity where relevant and whether all counted arrivals are available in the evidence.
Keep clock uncertainty visible. Server receipt time, client send time and completed-operation time may differ. Use the event time the actual policy defines rather than choosing whichever timestamp produces the desired pass.
The source record should preserve the actual window algorithm, counted event and endpoint rule. A source with only a marketing rate label may leave a specific admission decision unverified.
Check the queue input order
A replay assembled from an exported log needs an explicit ordering check. A queue implementation that removes expired events only from its head assumes those events are ordered by the policy’s relevant time. An unsorted export can leave an old arrival behind a newer one and produce the wrong retained count. Preserve stable event identities, verify the chosen ordering, and keep genuinely unresolved simultaneous ordering separate from a deterministic display sort. The teaching history is already ordered; that fact is an input, not a universal property of logs.
Build a complete boundary replay
Retain the initial accepted history, candidate arrivals, expired events, retained queue, decisions and resulting state. Include a calendar rollover and an exact-expiration case in the local teaching fixtures.
Use the prerequisite matrix for other constraints and permissions. A request fitting the window does not prove that every other admission condition is satisfied or that the operation will finish.
The final answer should explain why F admits at 00:00:10 while S rejects, and why S can admit after its oldest event expires. That concrete replay is more useful than repeating that a product offers three requests per minute without establishing what that phrase means.
