asynceasy
Why did promises replace callbacks for async work?
Answer
Callbacks nest: each dependent step goes inside the previous one, so error handling has to be repeated at every level and the code grows sideways. A promise is a value you can return, chain and pass around, so steps compose in a flat sequence with one .catch() at the end. async/await then lets that chain read like synchronous code while keeping try/catch for errors.
Points an interviewer listens for
- Callbacks nest and duplicate error handling
- Promises are first-class values — returnable and composable
- One .catch() covers the whole chain
- async/await is syntax over the same promises
Reported at
Similar questions have been reported by candidates at HCLTech, Kofuku Idea Labs, Physicswallah, Teksversity, Accenture, AlgoLeap Technologies.
Now try answering it out loud
Interview practice mode times your spoken answer and checks it against the points above.
Practise this question