How would you implement rate limiting in a RESTful API to prevent abuse?

  • A. Use JWT tokens
  • B. Implement a token bucket algorithm
  • C. Limit requests based on IP addresses
  • D. Disable API access during peak hours
B. Implementing a token bucket algorithm is a common method for rate limiting in RESTful APIs. It allows you to control the rate of requests over time, preventing abuse while allowing legitimate usage. Options A, C, and D are not effective methods for rate limiting.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *