Imagine an API that allows 100 requests per minute per API key, backed by Redis. Each key has two counters with one-minute expiry. A request arrives 45 seconds into the current minute. The service reads the previous minute count, say 90, and the current count, say 30.
It computes the weighted estimate: 30 plus 90 times the fraction of the previous window still inside the rolling view, which is 15 seconds out of 60, or 0.25. That gives 30 + 90 times 0.25 = 52.5, rounded to 52. Since 52 is below 100, the request is allowed and the current counter increments to 31.
Compare that to fixed windows, where this same client could have fired 100 requests in the last few seconds of the previous minute and 100 more now without being blocked. The sliding window's estimate folds the recent past into the decision, so the burst is caught and throttled.