.NET Architecture & System Design Interview Question #132
What is the Fallback pattern?
Resilience, Rate Limiting, Health Checks & Observability Senior Advanced
Quick Interview Answer
Fallback provides an alternative response or behavior when the preferred dependency or operation is unavailable. Examples include cached data, a reduced feature set, or a safe default.
Detailed Explanation
Fallback provides an alternative response or behavior when the preferred dependency or operation is unavailable. Examples include cached data, a reduced feature set, or a safe default.
Fallback is appropriate only when the alternative remains correct enough for the business scenario. Returning misleading or unsafe data merely to avoid an error is not a valid resilience strategy.
Code Example
Recommendation service fails
|
Fallback:
show product page
without recommendations
Core purchase path remains available.