Node.js · Senior · Question 62 of 75
Your service must call three APIs per request and can tolerate one failing. What approach fits?
- 1Call them one after another and fail if any fails
- 2Retry each call forever until all succeed
- ✓Correct answer: Call them in parallel with timeouts using
Promise.allSettled, and return partial data with a degraded flag
Explanation
Graceful degradation keeps the main feature working. Make it clear to clients which parts are missing.