Tentropy
TENTROPY

AVAILABLE CHALLENGES

// Select a diagnostic scenario to initialize

MEDIUM

The Thundering Herd

# The Scenario You are building a data scraper that hits a third-party API. The API is unstable and frequently returns `429 Too Many Requests`. Your current implementation attempts to handle this by recursively calling the function again. However, this is causing a **RecursionError** and crashing the application when the API is under heavy load (The Thundering Herd problem). # The Goal Refactor the `fetch_data` function to handle rate limits gracefully. - Use the `tenacity` library (already installed) to implement **exponential backoff**. - Stop retrying after **5 attempts**. - Reraise the exception if it still fails after 5 attempts.
[ Start ]
SOON

Construction in Progress

MODULE_UNDER_DEVELOPMENT