All fields

“Async Patterns” in Information Technology

35 questions across 3 technologies.

Information Technology

35 questions in 3 technologies

#QuestionTechnologyTopicLevel
1What is the purpose of the 'node:timers/promises' module, and how does it simplify working with delays in async code? Node.js › Async PatternsNode.jsAsync PatternsBeginner
2What is the difference between running async operations sequentially with multiple awaits versus concurrently with Promise.all()? Node.js › Async PatternsNode.jsAsync PatternsIntermediate
3How does async/await relate to Promises under the hood, and what does 'await' actually do to program execution? Node.js › Async PatternsNode.jsAsync PatternsIntermediate
4How do you implement a retry-with-exponential-backoff pattern for a flaky async operation in Node.js? Node.js › Async PatternsNode.jsAsync PatternsIntermediate
5What is an async generator, and how does 'for await...of' let you consume asynchronously produced data? Node.js › Async PatternsNode.jsAsync PatternsAdvanced
6What is a common pitfall when using async/await inside Array.prototype.forEach(), and how do you fix it? Node.js › Async PatternsNode.jsAsync PatternsAdvanced
7How would you implement a concurrency-limited task queue in Node.js to process many async tasks without overwhelming a downstream resource? Node.js › Async PatternsNode.jsAsync PatternsAdvanced
8What is 'fire-and-forget' async code, and why is it generally discouraged in production Node.js applications? Node.js › Async PatternsNode.jsAsync PatternsAdvanced
9What is a callback function in Node.js, and what is 'callback hell'? Node.js › Async PatternsNode.jsAsync PatternsBeginner
10What is a Promise in JavaScript, and what are its three possible states? Node.js › Async PatternsNode.jsAsync PatternsBeginner
11How do you convert a Node.js callback-based function into a Promise-based one manually, without using util.promisify()? Node.js › Async PatternsNode.jsAsync PatternsBeginner
12What is the difference between Promise.all(), Promise.allSettled(), Promise.race(), and Promise.any()? Node.js › Async PatternsNode.jsAsync PatternsIntermediate
13What is util.promisify(), and when would you still need it in modern Node.js? Node.js › Async PatternsNode.jsAsync PatternsIntermediate
14What is the difference between micro tasks and macro tasks in Node.js's event loop, and how does this affect Promise callback ordering? Node.js › Async PatternsNode.jsAsync PatternsIntermediate
15What is the difference between an unhandled promise rejection and an uncaught exception in Node.js, and how does Node handle each by default? Node.js › Async PatternsNode.jsAsync PatternsAdvanced
16Why doesn't Express automatically catch errors thrown inside an async route handler in versions prior to Express 5, and how do you work around this? Node.js › Error HandlingNode.jsError HandlingIntermediate
17What is the try/catch/finally pattern's 'finally' block used for, and how does it behave with async/await? Node.js › Error HandlingNode.jsError HandlingIntermediate
18What is the AsyncLocalStorage API, and what problem does it solve for tracking context across asynchronous calls? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
19How do you write custom Express middleware that needs to perform asynchronous work, like checking a value against a database, before calling next()? Node.js › Express & MiddlewareNode.jsExpress & MiddlewareAdvanced
20What are common patterns for implementing a producer-consumer background processing pipeline using Channel<T> with a BackgroundService? .NET › Background Services.NETBackground ServicesAdvanced
21How should an application handle email sending failures gracefully, and why is sending emails asynchronously through a queue often preferred over sending them directly during a web request? PHP › Email Sending in PHP (PHPMailer & SMTP)PHPEmail Sending in PHP (PHPMailer & SMTP)Advanced
22What is a background job in the context of a Node.js web application, and why can't long-running work simply happen inside a request handler? Node.js › Background Jobs & QueuesNode.jsBackground Jobs & QueuesBeginner
23What is the difference between a delayed job and a scheduled (repeatable) job in a Node.js job queue? Node.js › Background Jobs & QueuesNode.jsBackground Jobs & QueuesBeginner
24What is the difference between throwing an error synchronously and calling a callback with an error as its first argument in Node.js? Node.js › Error HandlingNode.jsError HandlingBeginner
25What is the event loop, and why does it allow Node.js to handle many concurrent operations despite being single-threaded? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOBeginner
26What is a callback queue (or task queue) in the context of the Node.js event loop, and how does it relate to the call stack? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOBeginner
27What is the difference between the synchronous, callback-based, and promise-based variants of Node's fs module methods? Node.js › File System (fs) ModuleNode.jsFile System (fs) ModuleBeginner
28What does the node:readline module provide, and what is a common use case for it? Node.js › Core Node.js ModulesNode.jsCore Node.js ModulesIntermediate
29How does inter-process communication (IPC) work between a parent process and a child created with fork()? Node.js › Child Processes & Process ManagementNode.jsChild Processes & Process ManagementIntermediate
30How does the 'once' method differ from 'on' when subscribing to an EventEmitter's events, and when would you use it? Node.js › Events & EventEmitterNode.jsEvents & EventEmitterIntermediate
31How would you implement request correlation IDs to trace a single request's logs across multiple log lines and services? Node.js › Logging & MonitoringNode.jsLogging & MonitoringIntermediate
32What is the difference between process.nextTick(), setImmediate(), and setTimeout(fn, 0) in terms of execution order? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
33How does the V8 JavaScript engine's microtask queue interact with the Node.js event loop's macrotask phases, and why does this occasionally surprise developers? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOAdvanced
34How would you build an interactive CLI wizard that prompts the user for multiple pieces of input using a library like Inquirer.js? Node.js › CLI Tools & Scripting with Node.jsNode.jsCLI Tools & Scripting with Node.jsAdvanced
35How would you make an outgoing HTTP request from Node.js using the built-in fetch API versus the older http.request()? Node.js › HTTP & HTTPS ModulesNode.jsHTTP & HTTPS ModulesAdvanced