Loading challenge...
Preparing the challenge details...
Loading challenge...
Preparing the challenge details...
Implement the three Promise utility variants: allSettled (never rejects), race (first to settle wins), and any (first to resolve wins).
These three are variations on Promise.all. Interviewers ask them together because the differences test whether you understand promise settling. allSettled never rejects — there is no reject call in its executor at all. race is tiny because the first resolve/reject wins automatically. any is the inverse of all: it resolves on the first success and only rejects if everything fails.
Goal: Implement all three variants. Focus on the structural difference between them — not just the code.
Continue learning with these related challenges
Implement Promise.all from scratch: resolve with an ordered results array when all settle, reject immediately on the first rejection.
Implement your own Promise.all polyfill to understand how concurrent Promise handling works under the hood.
Implement a retry function that handles transient failures by retrying async operations with optional delays.
Implement Promise.all from scratch: resolve with an ordered results array when all settle, reject immediately on the first rejection.
Implement your own Promise.all polyfill to understand how concurrent Promise handling works under the hood.
Implement a retry function that handles transient failures by retrying async operations with optional delays.