0
0
Node.jsframework~5 mins

Master and worker processes in Node.js - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the role of the master process in Node.js cluster?
The master process manages worker processes. It creates, monitors, and distributes tasks to workers to balance the load.
Click to reveal answer
beginner
What is a worker process in Node.js cluster?
A worker process is a child process created by the master. It runs the application code and handles incoming requests.
Click to reveal answer
intermediate
How do master and worker processes communicate in Node.js?
They communicate using an internal messaging system with events and messages passed between the master and workers.
Click to reveal answer
beginner
Why use master and worker processes in Node.js?
To use multiple CPU cores efficiently by running multiple instances of the app, improving performance and reliability.
Click to reveal answer
intermediate
What happens if a worker process crashes in a Node.js cluster?
The master detects the crash and can automatically create a new worker to replace it, keeping the app running smoothly.
Click to reveal answer
What does the master process do in a Node.js cluster?
AStores data in a database
BHandles all HTTP requests directly
CRuns the user interface
DCreates and manages worker processes
How many worker processes can a Node.js cluster have by default?
AUnlimited without limits
BOnly one
COne per CPU core
DExactly two
What happens when a worker process crashes in a cluster?
AThe whole application stops
BThe master can restart a new worker
CNothing, the worker stays crashed
DThe master process crashes too
Which module in Node.js helps create master and worker processes?
Acluster
Bhttp
Cfs
Devents
How do master and worker processes share workload?
AMaster distributes incoming connections to workers
BWorkers share memory directly
CMaster runs all code, workers idle
DWorkers communicate with each other directly
Explain how master and worker processes work together in Node.js cluster.
Think about who manages and who does the work.
You got /5 concepts.
    Describe what happens when a worker process crashes and how the cluster handles it.
    Focus on fault tolerance and recovery.
    You got /4 concepts.