Ctrl K
Frontend · Mid-level · Theory

You need to load data for a hundred IDs, but the backend can handle no more than three parallel requests. How would you implement this, and how would you handle errors in individual requests?

~4 min by voice

How to approach it

The interviewer wants to see whether you understand how promises work during parallel loading: that Promise.all doesn't limit anything, how to build a pool with a concurrency limit by hand, and how to make the loading resilient to errors in individual requests without losing the order of the results.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsImagine your code has, one after another, a console.log, a setTimeout with zero delay, a Promise.resolve().then and an async function with an await. In what order will these run, and why? Mid-levelWhat is a promise, and how does async/await differ from a then chain? Junior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min