0
0
Postmantesting~20 mins

Rate limit testing in Postman - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Rate Limit Testing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
1:30remaining
What is the expected HTTP status code after exceeding the rate limit?

You send 101 requests in 1 minute to an API with a rate limit of 100 requests per minute. What HTTP status code should you expect on the 101st request?

A403 Forbidden
B200 OK
C500 Internal Server Error
D429 Too Many Requests
Attempts:
2 left
💡 Hint

Think about the standard HTTP response for rate limiting.

assertion
intermediate
2:00remaining
Which Postman test script correctly asserts the rate limit reset header?

You want to verify that the response header X-RateLimit-Reset exists and is a valid UNIX timestamp in your Postman test script. Which option is correct?

Apm.test('Rate limit reset header exists', () => { pm.response.to.have.header('X-RateLimit-Reset'); const reset = parseInt(pm.response.headers.get('X-RateLimit-Reset')); pm.expect(reset).to.be.a('number'); });
Bpm.test('Rate limit reset header exists', () => { pm.response.to.have.header('X-RateLimit-Reset'); const reset = pm.response.headers.get('X-RateLimit-Reset'); pm.expect(reset).to.be.a('string'); });
Cpm.test('Rate limit reset header exists', () => { pm.response.to.have.header('X-RateLimit-Reset'); const reset = pm.response.headers.get('X-RateLimit-Reset'); pm.expect(reset).to.be.above(0); });
Dpm.test('Rate limit reset header exists', () => { pm.response.to.have.header('X-RateLimit-Reset'); const reset = pm.response.headers.get('X-RateLimit-Reset'); pm.expect(reset).to.equal('number'); });
Attempts:
2 left
💡 Hint

Check that the header exists and is parsed as a number.

🔧 Debug
advanced
2:30remaining
Why does this Postman test script fail to detect rate limit exceeded?

Given this Postman test script:

pm.test('Detect rate limit exceeded', () => {
  pm.expect(pm.response.code).to.equal(429);
  pm.expect(pm.response.json().message).to.equal('Rate limit exceeded');
});

But the test always fails even when the API returns 429 with message 'Rate limit exceeded'. What is the likely cause?

AThe test script syntax is invalid and causes a runtime error.
BThe response body is empty or not JSON, so pm.response.json() throws an error.
CThe status code 429 is not the correct code for rate limiting.
DThe message string is case sensitive and should be 'rate limit exceeded'.
Attempts:
2 left
💡 Hint

Consider what happens if pm.response.json() is called on a non-JSON response.

🧠 Conceptual
advanced
1:30remaining
What is the main purpose of rate limit testing in API QA?

Choose the best description of why rate limit testing is important in API quality assurance.

ATo verify the API can handle unlimited requests without failure.
BTo check if the API returns correct data formats under heavy load.
CTo ensure the API enforces usage limits to protect resources and maintain performance.
DTo test the API's authentication mechanisms under multiple requests.
Attempts:
2 left
💡 Hint

Think about why APIs limit the number of requests per user.

framework
expert
2:00remaining
Which Postman collection runner setting helps simulate rate limit testing effectively?

You want to simulate sending 150 requests quickly to test rate limiting in Postman. Which collection runner setting is best to achieve this?

ASet delay between requests to 0 ms and run all iterations immediately.
BSet delay between requests to 1000 ms to avoid hitting rate limits.
CRun requests sequentially with a delay of 5000 ms to simulate user behavior.
DUse the 'Save responses' option to store all responses for later analysis.
Attempts:
2 left
💡 Hint

To test rate limits, you want to send requests as fast as possible.