0
0
Rest APIprogramming~5 mins

Fixed window algorithm in Rest API - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the Fixed Window Algorithm in rate limiting?
It is a method to limit the number of requests a user can make in a fixed time period, like allowing 100 requests per minute. If the limit is reached, further requests are blocked until the next time window starts.
Click to reveal answer
beginner
How does the Fixed Window Algorithm count requests?
It counts all requests within the current fixed time window, for example, from 12:00:00 to 12:00:59. When the window ends, the count resets to zero for the next window.
Click to reveal answer
intermediate
What is a downside of the Fixed Window Algorithm?
It can cause bursts of traffic at the edges of windows. For example, a user can send the maximum allowed requests at the end of one window and again at the start of the next, effectively doubling the allowed rate temporarily.
Click to reveal answer
beginner
In the Fixed Window Algorithm, what happens when the request count exceeds the limit?
The system rejects or delays further requests until the current time window ends and the count resets.
Click to reveal answer
beginner
Why is the Fixed Window Algorithm easy to implement?
Because it only needs to track the count of requests in a simple fixed time window, without complex calculations or storing timestamps for each request.
Click to reveal answer
What does the Fixed Window Algorithm use to limit requests?
AA fixed time period to count requests
BA sliding time window
CRandom request sampling
DUser IP address only
What happens when the request count reaches the limit in a fixed window?
ARequests are always allowed
BRequests are blocked until the window resets
CRequests are queued indefinitely
DThe limit increases automatically
What is a common problem with the Fixed Window Algorithm?
AIt allows bursts of requests at window edges
BIt requires complex calculations
CIt never resets the count
DIt blocks all requests
Which of these is NOT true about the Fixed Window Algorithm?
AIt limits requests per fixed time period
BIt resets the count after each time window
CIt is simple to implement
DIt tracks requests individually with timestamps
Why might someone choose the Fixed Window Algorithm?
ABecause it perfectly smooths request rates
BBecause it never blocks requests
CBecause it is easy and fast to implement
DBecause it tracks each request's exact time
Explain how the Fixed Window Algorithm controls the number of API requests.
Think about counting requests in a set time and what happens when the limit is reached.
You got /4 concepts.
    Describe one advantage and one disadvantage of the Fixed Window Algorithm.
    Consider simplicity and how traffic might spike.
    You got /2 concepts.