Node.js Event Loop

0.0(0)
studied byStudied by 0 people
0.0(0)
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/14

flashcard set

Earn XP

Description and Tags

Last updated 12:18 PM on 2/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

15 Terms

1
New cards

What is the primary function of the Node.js Event Loop?

It enables non-blocking I/O operations by offloading tasks to the system kernel whenever possible

2
New cards

Which C library implements the Event Loop in Node.js?

Libuv

3
New cards

What are the six phases of the Event Loop execution order?

Timers

4
New cards

What specific callbacks are executed during the Timers phase?

Callbacks scheduled by setTimeout() and setInterval()

5
New cards

What occurs during the Poll phase?

The event loop retrieves new I/O events and executes I/O related callbacks

6
New cards

When are callbacks scheduled by setImmediate() executed?

During the Check phase

7
New cards

What is the difference between process.nextTick() and setImmediate()?

process.nextTick() runs immediately after the current operation and before the loop continues

8
New cards

What are Microtasks in Node.js?

High-priority tasks like Promise callbacks and process.nextTick() that drain completely between operation phases

9
New cards

What is the default size of the Libuv thread pool used for file system and DNS operations?

4 threads

10
New cards

Why is blocking the main thread dangerous in Node.js?

Because it stops the Event Loop from processing any further I/O or client requests until the blocking task finishes

11
New cards

What happens in the Close Callbacks phase?

Callbacks for close events are handled

12
New cards

If setImmediate() and setTimeout(fn

0) are called within an I/O callback

13
New cards

What is the purpose of the Pending Callbacks phase?

It executes I/O callbacks deferred to the next loop iteration

14
New cards

Does the Event Loop run on a separate thread from the JavaScript code?

No

15
New cards

How does Node.js handle concurrent operations if it is single-threaded?

It uses the Event Loop to manage asynchronous callbacks and the Libuv thread pool for expensive tasks like file I/O or crypto