Top 3 Async await Interview Questions
Browse 3 real-world technical and behavioral interview questions about Async await. Review scenarios, edge cases, and architectural best practices.
A request fails but your Express error-handling middleware never runs. How do you work out why?
An Express error handler is skipped when it is not registered after routes, lacks the four-argument signature, or an async error never reaches next(). Express 4 needs explicit next(err) for rejected promises; Express 5 forwards them automatically.
Here is a script mixing setTimeout, a promise chain and an await. Tell me the order the logs come out in, and why.
The engine finishes the current task, then drains the whole microtask queue before taking another task, so every promise callback and await resumption runs before a zero-delay timeout, in the order each was queued. Use this event loop answer to show the decision, trade-off, and evidence rather than a memorised definition. It also connects microtasks to the point an interviewer is testing.
Why does calling .Result or .Wait() on an async method deadlock, and how do you fix it properly?
Blocking on async code with .Result or .Wait can deadlock when the awaited continuation needs the same SynchronizationContext that is blocked. In ASP.NET Core the common failure is thread-pool starvation; the fix is async all the way up.