Bird
Raised Fist0

You want to build a client that stops making API calls when the limit is reached and waits until reset. Given these headers:

hard🚀 Application Q15 of Q15
Rest API - Rate Limiting and Throttling

You want to build a client that stops making API calls when the limit is reached and waits until reset. Given these headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1686009000

What should your client do?

AContinue making calls; the limit resets immediately.
BStop calls and wait until the reset timestamp before retrying.
CIgnore the headers and retry after 1 minute.
DReset the remaining count manually and continue.
Step-by-Step Solution
Solution:
  1. Step 1: Check remaining calls

    Remaining is 0, so no calls can be made now.
  2. Step 2: Use reset time to wait

    The client should wait until the reset timestamp before making new calls.
  3. Final Answer:

    Stop calls and wait until the reset timestamp before retrying. -> Option B
  4. Quick Check:

    Remaining=0 means wait until reset [OK]
Quick Trick: Stop calls at zero remaining; wait for reset time [OK]
Common Mistakes:
MISTAKES
  • Ignoring zero remaining and continuing calls
  • Guessing reset time instead of using header
  • Manually resetting counters in client

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes