Async in depth
Implement and reason about promises, combinators, cancellation, races, retries and concurrency.
- JS.11.01Promise internals: states, reactions and resolutionCoreMid-level11 min
- JS.11.02Error handling in async codeCoreMid-level11 min
- JS.11.03Promise combinatorsCoreMid-level11 min
- JS.11.04Cancellation with AbortControllerCoreMid-level11 min
- JS.11.05Race conditions in the UICoreMid-level11 min
- JS.11.06Retry, timeout and backoffCoreMid-level12 min
- JS.11.07Concurrency controlCoreSenior10 min
- JS.11.08Async iteration and streamsSeniorBeing written
Interview questions in this module
- Explain the difference between
Promise.all,allSettled,raceandany. What does each return for an empty array? - Implement
Promise.all. - How do you cancel a
fetchrequest? - Your search box sometimes shows results for an older query. Why, and how do you fix it?
- Implement retry with exponential backoff.
- Run 100 async tasks with at most 5 at a time, keeping results in order.
- What happens to an unhandled promise rejection in the browser and in Node?
- If
Promise.raceis used for a timeout, what happens to the slower promise? - What is the difference between
return promiseandreturn await promiseinsidetry? - How would you implement an async queue?
- How do streams handle backpressure?