Courseiva

200-901 Software Development and Design Practice Question

A developer is designing a Python application that must handle failures when making REST API calls to a Cisco DNA Center controller. The application should retry a failed request only if the HTTP status code indicates a server-side error (5xx) or a timeout occurs, but should not retry on client errors (4xx). The developer wants to implement this using a decorator. Which Python library provides a ready-to-use retry decorator that can be configured to retry on specific exceptions and HTTP status codes?

⚠ Common exam trap

The trap here is assuming that the requests library includes a built-in retry decorator, when it actually requires using urllib3's Retry with an adapter.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

tenacity

Tenacity is a dedicated retrying library that offers a decorator with extensive configuration options, including retrying on specific exceptions and stop conditions. It can be easily integrated with HTTP status code checks. The other libraries either lack a retry decorator or require manual implementation, making tenacity the correct choice for this scenario.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    urllib3

    Why it's wrong here

    urllib3 provides a Retry class that can be used with requests to handle retries at the connection level, but it is not a decorator and is not designed to be used directly as a decorator on functions. It is lower-level and would require manual integration. It does not offer the simplicity of a decorator for retrying arbitrary code blocks.

  • ✓

    tenacity

    Why this is correct

    Tenacity is a general-purpose retrying library that provides a decorator and can be configured to retry based on exceptions, including custom conditions. It supports retrying on specific HTTP status codes when integrated with requests, and can be set to stop after a number of attempts. It is widely used in network automation for robust API interactions.

  • ✗

    functools

    Why it's wrong here

    The functools module provides tools like lru_cache and wraps, but it does not include a retry decorator. While it can be used to create a custom retry decorator, it does not provide one out of the box. The developer would need to implement the retry logic manually, which is not the ready-to-use solution requested.

  • ✗

    requests

    Why it's wrong here

    The requests library is used for making HTTP requests but does not include built-in retry logic as a decorator. It does offer a Retry class via urllib3 that can be attached to an HTTPAdapter, but that is not a decorator and requires more setup. It does not provide the decorator-based approach the developer is looking for.

About these practice questions

Courseiva writes every 200-901 question from scratch — 975 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Cisco exam blueprint

This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.