AniUI Academy

Re-implement Promise.all from Scratch

hardAsync & PromisesHigh freq+300 XPFrontend AlgoArena

Implement promiseAll(promises) without using built-in Promise.all.

What it has to do

  • Resolve with an array of values in original input order.
  • Reject immediately if any input promise rejects.
  • Handle non-promise values seamlessly.

Where it's been asked

  • Meta
  • Google
  • Amazon
  • Microsoft
  • Uber

From public interview reports — a problem very like this one has shown up in a round at these companies. Not an exhaustive list.

Try it yourself
Loading playground...

Ready to check it?

2 tests run against your code, right here in your browser. Sign in to claim the XP when you pass.

Need a nudge?

Reveal a conceptual hint or the reference solution. Both were written and reviewed with the problem — no runtime magic.

Discussion

Sign in to post
Sign in to join the conversation.Sign in

No comments yet. Be the first to say something.