Ctrl K
Frontend · Junior · Theory

What is a promise, and how does async/await differ from a then chain?

~4 min by voice

How to approach it

The interviewer checks whether the candidate understands the asynchrony model in JS: what a promise is and its lifecycle, that async/await is just syntax on top of the same promises, how to handle errors, and how not to lose parallelism.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsExplain how prototypal inheritance works in JavaScript, and what actually happens when you write a class with extends. Mid-levelYou 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? Mid-levelExplain how the event loop works in JavaScript. And what gets printed to the console if a script has, one after another, a console.log, a setTimeout with zero delay, and a Promise.resolve().then? JuniorWhat is a closure in JavaScript? Give an example of where it's used in practice. JuniorHow does prototypal inheritance work in JavaScript? 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