How do you fetch from three APIs using Promise.all versus allSettled?

Promise concurrency and failure isolation.
Promise.all parallelizes but rejects on first failure. allSettled returns every outcome with status, value, and reason.
Wrapping each call in try-catch to imitate allSettled.
What's really being asked
This question tests whether you understand the semantic differences between Promise concurrency methods, specifically the trade-off between fail-fast behavior and fault tolerance. Interviewers want to see that you know Promise.all is not just a parallelization utility but a strict combinator that rejects immediately on the first failure, discarding results from sibling promises. They also want to know you can choose Promise.allSettled when partial success is acceptable and every outcome matters, rather than inventing ad-hoc error-handling wrappers.
The full answer
First, explain that Promise.all takes an iterable of promises and returns a single promise that fulfills with an array of all values only if every input promise fulfills. Second, note the critical failure mode: if any input promise rejects, Promise.all immediately rejects with that reason, and the values from already-resolved promises are not surfaced to the caller. Third, introduce Promise.allSettled as the correct alternative when you need every result regardless of individual failures. Fourth, describe the return shape: an array of objects, each with a status property of either fulfilled or rejected, plus value or reason respectively, preserving order. Fifth, mention that allSettled never rejects; it always fulfills, so you only need a single then or await without a catch for the aggregate promise itself.
The mistakes people make
A red flag is suggesting you keep Promise.all and wrap each fetch in a manual try-catch that resolves to null on failure. This reinvents allSettled poorly and obscures intent. Another red flag is claiming Promise.all returns whatever results it has at the moment of rejection; it does not. Some candidates suggest sequential awaits in a loop, which misses the parallelism requirement entirely. Finally, confusing allSettled with Promise.race or Promise.any is a signal of weak API familiarity.
What usually comes next
The interviewer may ask how you would retry only the failed requests after using allSettled, or how to enforce a timeout across the aggregate operation. They might also ask about TypeScript typing for the results array, since allSettled produces a heterogeneous array of outcome objects. Another angle is memory or connection limits: how many parallel fetches are safe, and would you use a concurrency limiter instead of raw all or allSettled?
A concrete example
Imagine fetching user profile, billing status, and notification preferences. With Promise.all, a billing API outage crashes the entire page even though profile and preferences are ready. With Promise.allSettled, you await all three, then iterate the results array. For each result, you check status. If fulfilled, you render the section. If rejected, you log the reason and show a graceful fallback UI for that card. The page loads every available module and isolates the outage.
Interview question
When one of three parallel fetch calls rejects, how does Promise.all behave compared to Promise.allSettled?
- a.Promise.all returns the results of any fetches that resolved before the first rejection, while allSettled rejects if every fetch fails.
- b.Promise.all can match allSettled by wrapping each fetch in try-catch and resolving to null on failure.
- c.Promise.all waits for all fetches to complete and then rejects if any failed, while allSettled returns only the successfully resolved values.
- d.Promise.all rejects immediately on the first failure and discards sibling results, while allSettled always fulfills with an array of status objects.Correct
Why? this is the answer
Promise.all is fail-fast: it rejects immediately on the first failure and does not surface values from sibling promises, whereas allSettled always fulfills with an array of outcome objects. Option A is tempting because many candidates wrongly assume Promise.all returns partial results, but it actually discards them entirely.
Just read this? Test yourself on what you have been reading.
Read the original → developer.mozilla.org
- #promise
- #async
- #javascript
- #typescript
- #fetch
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles