Loading...
Loading...
Browse 7 real-world technical and behavioral interview questions about Async. Review scenarios, edge cases, and architectural best practices.
A catch handler that returns normally converts a rejected promise into a fulfilled one, so every then after it runs as though nothing failed. Combined with fetch, which only rejects on network errors and resolves happily on a 500, the chain reports success twice over. Fix by re-throwing from catch, checking response.ok, and modelling UI state as a machine.
A correct wait helper tracks a wall-clock deadline rather than an attempt count, treats an exception from the condition as a not-yet rather than a failure, returns the condition's value, and reports the last observed value or error when it gives up.
An unhandled promise rejection in Node.js means a promise failed before any code observed the error. Treat it as a bug, await or return the promise chain, and make the process-level handler a last-resort alarm.
Detached ASP.NET Core background work can fail after the response because the request scope is disposed. Copy required values, create a fresh service scope, and run tracked work through IHostedService, BackgroundService or a durable queue.
A CancellationToken in C# is cooperative cancellation, not a thread abort. Pass it through async calls, check it around long CPU loops, and define whether cancelled work leaves durable side effects behind.
Node.js event loop phases explain callback ordering across timers, poll, check, nextTick and promise microtasks. Correct answers separate macro-task phases from microtasks instead of memorising one log order.
One exception. WhenAll's task faults with an AggregateException holding every failure, but await rethrows only the first inner exception, so recovering the rest means keeping the WhenAll task in a variable and reading its Exception property.