Junior
From PDF
Node.js
Node.js
What is the event loop in Node.js?
Short answer: The event loop is the core of Node.js's non-blocking I/O operations. It handles all asynchronous operations in a single thread, constantly checking for events (e.g., incoming data, timers) and executing associated callbacks. 📌
Example code
setTimeout(() => { console.log('Executed after 2 seconds'); }, 2000); This callback is scheduled by the event loop and executed when the time is up.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png