Problem Statement
A downstream service is flaky and increases tail latency. What resilience patterns will you apply on the caller?
Explanation
Add timeouts and retries with jitter to avoid long hangs. Use a circuit breaker to fail fast after consecutive errors and probe recovery through half-open trials.
Provide fallbacks where possible, such as cached data or degraded responses. Expose metrics on error rates and breaker state so on-call teams can tune thresholds.
Code Solution
SolutionRead Only
timeout=300ms; retries=2; circuit=open after 5 failures/30s
