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.
Loading...
Related Quiz
- In Pandas, how can you filter the rows of a DataFrame where the value in a specific column is greater than a threshold?
- You are assigned to optimize a Python application performing extensive calculations. Which approach would you take to reduce the computational time and improve the efficiency of the calculations?
- In Python, _____ is a special method used to overload the ‘+’ operator for custom objects.
- You are developing a web application where the front-end needs to continuously receive real-time updates from the Python back-end. Which technology would you use to implement this functionality?
- How can you secure sensitive information, like API keys, in a Flask or Django application?