Asynchronous and Event-Driven Programming Questions

The programming model of a single asynchronous runtime: callbacks, promises and futures, async/await, event loops and task/microtask scheduling (including microtask starvation and where rendering fits), reactive streams and back-pressure, and how ordering, cancellation, timeouts, retries and error propagation behave across JavaScript, Node.js, mobile coroutine or async runtimes, and a comparison with Python asyncio and Java futures. Includes the async mechanics of a data fetch such as parallel versus sequential requests, partial failure, stale or out-of-order responses, abort, debounced live search, single-flight token refresh, and bounded concurrency; wrapping callback APIs as promises, streaming work through async consumers, moving heavy work off the main thread and back, and diagnosing unhandled rejections, race conditions and leaked subscriptions. Excludes message-queue and pub/sub system design, server throughput and thread-pool tuning, per-language threading and memory models, rebuilding standard APIs from scratch, and fetch caching or state architecture.

EasyTechnical
49 practiced

What is a promise and what states can it be in? Walk through what happens when you attach a handler before it settles and after it settles, why a handler never runs synchronously, and what a thenable is.

MediumTechnical
60 practiced

In a Node.js service, an engineer schedules follow-up work with several different mechanisms and sees an order they did not expect, and under load the service stops serving I/O. Explain how Node schedules those callbacks, the order they run in, and how one of them can starve the rest and what you would change.

HardTechnical
64 practiced

The same async code can order its callbacks differently in a browser and in Node.js. Explain how scheduling works in each environment, where the main scheduling primitives of each land relative to one another, and what you would do to write async code whose behaviour does not depend on the environment.

EasyTechnical
58 practiced

Take one asynchronous operation that can fail and show it written three ways: as nested callbacks, as a promise chain, and with async/await. For each version, explain how an error travels and where it would be lost if you were careless, and which version you would want to maintain.

MediumTechnical
47 practiced

Write retryFetch(url, options, retries, backoffBaseMs) that retries only failures that are worth retrying, spaces attempts so many clients do not retry in lockstep, and stops a single hung attempt from blocking the rest. Explain which responses you would not retry and why.

Unlock Full Question Bank

Get access to all 10 Asynchronous and Event-Driven Programming interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.