All fields

“Event Loop & Non-blocking IO” in Information Technology

27 questions across 1 technology.

Information Technology

27 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is 'event loop lag' (or 'event loop delay'), and how would you monitor it in a production Node.js application? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOAdvanced
2What is the poll phase of the event loop, and under what specific conditions does it block waiting versus move on immediately? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOAdvanced
3What 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
4How 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
5What does 'non-blocking I/O' mean, and how does a Node.js function like fs.readFile() achieve it compared to fs.readFileSync()? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
6How does the event loop handle a large synchronous loop (like processing a huge array with a for loop), and what problem does this cause? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
7How would you measure how 'busy' the event loop is in a running Node.js process using a simple technique? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
8What is the difference between concurrency and parallelism, and which one does Node.js's event loop actually provide by default? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOBeginner
9What 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
10What are the distinct phases of the Node.js event loop, and what kind of callbacks does each phase execute? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOAdvanced
11What is the difference between synchronous and asynchronous versions of the same core Node.js API, using fs.readFile vs fs.readFileSync as an example, and when is the synchronous version actually appropriate? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
12What is the difference between how Node.js handles I/O-bound concurrency versus CPU-bound work, and why does this distinction shape Node.js's ideal use cases? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOAdvanced
13How does setImmediate() differ from process.nextTick() in terms of timing and typical use cases? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
14What does it mean that Node.js's I/O is handled by libuv, and how does libuv abstract different operating systems' I/O mechanisms? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOIntermediate
15How would you use async_hooks (the lower-level predecessor to AsyncLocalStorage) to trace the lifecycle of asynchronous resources in Node.js? Node.js › Event Loop & Non-blocking IONode.jsEvent Loop & Non-blocking IOAdvanced
16What 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
17How do you detect and prevent event loop blocking in a long-running Node.js service? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
18How does async/await relate to Promises under the hood, and what does 'await' actually do to program execution? Node.js › Async PatternsNode.jsAsync PatternsIntermediate
19What is the difference between process.nextTick(), setImmediate(), and setTimeout(fn, 0) in terms of execution order? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
20What is the node:diagnostics_channel module, and how does it differ from simply emitting a custom event? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
21What 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
22What is Node.js, and how does it differ fundamentally from running JavaScript in a web browser? Node.js › Node.js Fundamentals & Runtime ArchitectureNode.jsNode.js Fundamentals & Runtime ArchitectureBeginner
23What is a 'stalled' job in BullMQ, and what causes it? Node.js › Background Jobs & QueuesNode.jsBackground Jobs & QueuesIntermediate
24Why should CPU-intensive media processing like image resizing or video transcoding typically not run directly inside an Express request handler? Node.js › File Uploads & Media ProcessingNode.jsFile Uploads & Media ProcessingIntermediate
25What is the libuv library, and what specific role does it play inside Node.js? Node.js › Advanced Node.jsNode.jsAdvanced Node.jsAdvanced
26How would you use the 'clinic.js' toolset (clinic doctor, clinic flame) to diagnose a Node.js performance problem? Node.js › Debugging & DiagnosticsNode.jsDebugging & DiagnosticsAdvanced
27How does Node.js achieve high concurrency for I/O-bound workloads despite running JavaScript on a single main thread? Node.js › Node.js Fundamentals & Runtime ArchitectureNode.jsNode.js Fundamentals & Runtime ArchitectureAdvanced