ASP.NET Core Web API Interview Question #144

What is a retry policy?

Error Handling, Logging, Caching, Rate Limiting, CORS & Reliability Senior Advanced

Quick Interview Answer

A retry policy repeats an operation after a transient failure that may succeed on a later attempt, such as a brief network interruption. Retries should use bounded attempts and usually delay or backoff between attempts.

Detailed Explanation

A retry policy repeats an operation after a transient failure that may succeed on a later attempt, such as a brief network interruption. Retries should use bounded attempts and usually delay or backoff between attempts.

Do not automatically retry every failure. Non-idempotent operations can create duplicate side effects, and persistent failures can be amplified by aggressive retry storms.

Code Example

// Conceptual policy:
// Retry only known transient failures.
// Use bounded attempts + backoff.
// Avoid unsafe retries for non-idempotent operations
// unless the operation has an idempotency mechanism.