nextRound
TechnologiesCoding ProblemsBookmarksLearning PathsLogin
nextRound
TechnologiesCoding ProblemsBookmarksLearning PathsLogin
Questions
2 of 17
1How does the Node.js Cluster module work internally?
2What is the difference between the master process and a worker process in Node.js clustering?
3How do you send messages between master and worker processes in a Node.js cluster?
4What are the two load balancing strategies in Node.js cluster, and how do you configure them?
5How does clustering differ from using Worker Threads in Node.js?
6How would you monitor the health of worker processes in a Node.js cluster in production?
7What is clustering in Node.js, and why is it needed?
8How do you check if the current process is a master or worker in Node.js?
9How do workers in a Node.js cluster share a port without conflict?
10Can workers share memory or state in a Node.js cluster?
11What are the limitations of Node.js clustering?
12Your Node.js server handles 10,000 concurrent users but is slow. How does clustering help?
13What happens when a worker process crashes in a Node.js cluster?
14How do you gracefully shut down a worker in Node.js clustering?
15What is the difference between cluster.fork() and child_process.fork()?
16How do you implement sticky sessions with Node.js clustering?
17What is PM2 and how does it relate to Node.js clustering?
nodejsnodejs
Basics
Event Loop
Buffers
Streams
Events
Time functions
Clusters
Crypto
Modules
Worker Threads
File Operations
Threads
Performance Optimisation
Websockets
02 / 17
nextRound

AI-powered interview preparation platform. Practice with curated questions, mock interviews, and personalized learning paths to crack your dream tech interview.

Quick Links

  • Technologies
  • Mock Interviews
  • Saved Questions
  • Pricing

Company

  • About Us
  • Contact Us

Legal

  • Privacy Policy
  • Terms of Use

© 2026 nextRound. All rights reserved.

What is the difference between the master process and a worker process in Node.js clustering?

The master process is responsible for managing the lifecycle of worker processes — spawning, monitoring, and restarting them. Worker processes contain the actual application logic and handle incoming client requests independently.

In a clustered Node.js application, the roles of the master and worker processes are clearly separated. The master process acts as an orchestrator — it never handles HTTP requests directly. Workers are the actual application servers that process requests and respond to clients.

Master Process Responsibilities
  1. 1

    Spawn worker processes using cluster.fork()

  2. 2

    Monitor worker health and listen for exit events

  3. 3

    Restart dead workers automatically

  4. 4

    Distribute incoming connections to available workers

  5. 5

    Send configuration or messages to workers via IPC

Worker Process Responsibilities
  1. 1

    Run the actual HTTP server or application logic

  2. 2

    Handle incoming requests assigned by the master

  3. 3

    Send and receive messages to/from the master via IPC

  4. 4

    Operate independently with their own memory space

Master vs Worker Role Separation