FullStackFSCCafé
 
 
Sign in with GoogleSign in with Google. Opens in new tab
Kill Your Tech Interview
3877 Full-Stack, Algorithms & System Design Interview Questions
Answered To Get Your Next Six-Figure Job Offer
      
🤖 Having Machine Learning & DS Interview? Check  MLStack.Cafe - 1704 Data Science & ML Interview Questions & Answers!Having ML & DS Interview? Check 🤖 MLStack.Cafe - 1704 ML & DS Interview Questions and Answers

Top 126 Node.js Interview Questions

Entry Junior Mid Senior Expert
Sign in with GoogleSign in with Google. Opens in new tab
Topic Progress:

Theoretical Questions

Q1:   

What npm is used for?

  
Add to PDF   Entry 
Q2:   

Why does Node.js prefer Error-First Callback?

  
Add to PDF   Junior 
Q3:   

What is V8?

  
Add to PDF   Junior 
Q4:   

What is libuv?

  
Add to PDF   Junior 
Q5:   

What does Promisifying technique mean in Node.js?

  
Add to PDF   Junior 
Q6:   

What are the benefits of using Node.js?

  
Add to PDF   Junior 
Q7:   

What's the difference between process.cwd() vs __dirname?

  
Add to PDF   Junior 
Q8:   

What do you mean by Asynchronous API?

  
Add to PDF   Junior 
Q9:   

What is the difference between returning a callback and just calling a callback?

  
Add to PDF   Junior 
Q10:   

Explain the difference between local and global npm packages installation

  
Add to PDF   Junior 
Q11:   

Why we always require modules at the top of a file? Can we require modules inside of functions?

  
Add to PDF   Junior 
Q12:   

What are the key features of Node.js?

  
Add to PDF   Junior 
Q13:   

Name some Built-in Globals in Node.js

  
Add to PDF   Junior 
Q14:   

What is Callback Hell and what is the main cause of it?

  Related To: JavaScript
Add to PDF   Junior 
Q15:   

What is Callback?

  
Add to PDF   Junior 
Q16:   

What is the file package.json?

  
Add to PDF   Junior 
Q17:   

What is the meaning of the @ prefix on npm package?

  
 Add to PDF   Mid 
Q18:   

What exactly does module.exports do in Node.js, and what would a simple example be?

  
 Add to PDF   Mid 
Q19:   

Explain how does Node.js work?

  
 Add to PDF   Mid 
Q20:   

How does Node.js handle Child Threads?

  
 Add to PDF   Mid 
Q21:   

What is the difference between require(x) and ES6 import x in Node.js?

  
 Add to PDF   Mid 
Q22:   

Which one is better: Node.js built in cluster or PM2 clustering?

  
 Add to PDF   Mid 
Q23:   

What is the relationship between Node.js and V8?

  
 Add to PDF   Mid 
Q24:   

Explain the concept of Domain in Node.js

  
 Add to PDF   Mid 
Q25:   

Provide some of the reasons not to use Node.js

  
 Add to PDF   Mid 
Q26:   

Provide your favourite reasons to use Node.js

  
 Add to PDF   Mid 
Q27:   

When would you use cluster module in Node.js?

  
 Add to PDF   Mid 
Q28:   

What is stream and what are types of streams available in Node.js?

  
 Add to PDF   Mid 
Q29:   

What is the purpose of pm2 save?

  
 Add to PDF   Mid 
Q30:   

How do I run a Node.js app as a background service?

  
 Add to PDF   Mid 
Q31:   

Is an Event Emitter Synchronous or Asynchronous?

  
 Add to PDF   Mid 
Q32:   

Explain the order of Event Listeners execution in Node.js

  
 Add to PDF   Mid 
Q33:   

What is Event Loop in Node.js?

  
 Add to PDF   Mid 
Q34:   

What is the preferred method of resolving unhandled exceptions in Node.js?

  
 Add to PDF   Mid 
Q35:   

What is a Blocking Code in Node.js?

  
 Add to PDF   Mid 
Q36:   

When should we use Node.js?

  
 Add to PDF   Mid 
Q37:   

When should I use EventEmitter?

  
 Add to PDF   Mid 
Q38:   

What is difference between synchronous and asynchronous method of fs module?

  
 Add to PDF   Mid 
Q39:   

What is export default in JavaScript?

  Related To: JavaScript
 Add to PDF   Mid 
Q40:   

What are the use cases for the Node.js vm core module?

  
 Add to PDF   Mid 
Q41:   

What is the difference between cluster and worker_threads packages in Node.js?

  
 Add to PDF   Mid 
Q42:   

How do you debug Node.js applications?

  
 Add to PDF   Mid 
Q43:   

Could we run an external process with Node.js?

  
 Add to PDF   Mid 
Q44:   

What is the difference between browser global scope and Node.js global scope?

  
 Add to PDF   Mid 
Q45:   

How to use global variable in Node.js?

  
 Add to PDF   Mid 
Q46:   

What is the difference between setTimeout(fn,0) vs setImmediate(fn)?

  
 Add to PDF   Mid 
Q47:   

When would you use global variables in Node.js? Are they always bad?

  
 Add to PDF   Mid 
Q48:   

Are you familiar with differences between Node.js modules and ES6 modules?

  
 Add to PDF   Mid 
Q49:   

What is N-API in Node.js?

  
 Add to PDF   Mid 
Q50:   

How to avoid Callback Hell in Node.js?

  
 Add to PDF   Mid 
Q51:   

What Are Buffer and why to use them in Node.js?

  
 Add to PDF   Mid 
Q52:   

Is there any difference between res.send and return res.send in Express.js?

  
 Add to PDF   Mid 
Q53:   

What are express.json() and express.urlencoded() in Express.js?

  
 Add to PDF   Mid 
Q54:   

How does concurrency work in Node.js?

  
 Add to PDF   Mid 
Q55:   

What are Event Emitters?

  
 Add to PDF   Mid 
Q56:   

What is Stream Chaining in Node.js?

  
 Add to PDF   Mid 
Q57:   

What is the purpose of using assert module in Node.js

  
 Add to PDF   Mid 
Q58:   

What's the Event Loop?

  
 Add to PDF   Mid 
Q59:   

Would you use Node.js assert library vs. other assert libraries like chai? Why?

  
 Add to PDF   Mid 
Q60:   

What is Mocha in Node.js userland?

  
 Add to PDF   Mid 
Q61:   

What is chai and chai-http in Node.js userland?

  
 Add to PDF   Mid 
Q62:   

Compare PM2 Cluster Mode vs. Node.js Cluster module usage

  
 Add to PDF   Senior 
Q63:   

How to gracefully shutdown Node.js server?

  
 Add to PDF   Senior 
Q64:   

Do I need Dependency Injection in Node.js and how to deal with it?

  Related To: Dependency Injection
 Add to PDF   Senior 
Q65:   

What is the difference between fork() & spawn() in Node.js?

  
 Add to PDF   Senior 
Q66:   

What is the difference between the child_process spawn and execute functions in Node.js? When to use each one?

  
 Add to PDF   Senior 
Q67:   

When would you use import * as X from 'X' ?

  Related To: JavaScript
 Add to PDF   Senior 
Q68:   

List some differences between CommonJS module loader and ECMAScript module loader

  
 Add to PDF   Senior 
Q69:   

What is the difference between Cluster and Fork mode in PM2?

  
 Add to PDF   Senior 
Q70:   

Explain what is Arrange-Act-Assert pattern?

  Related To: Unit Testing
 Add to PDF   Senior 
Q71:   

How can you have one global variable between all clustered workers in Node.js?

  
 Add to PDF   Senior 
Q72:   

Compare strict vs legacy mode for Assert module in Node.js

  
 Add to PDF   Senior 
Q73:   

What is the difference between pm2 restart and pm2 reload?

  
 Add to PDF   Senior 
Q74:   

How would you prevent Callback Hell without using promises, async or generators?

  Related To: JavaScript
 Add to PDF   Senior 
Q75:   

Is an Event Emitter synchronous or asynchronous?

  
 Add to PDF   Senior 
Q76:   

How would you handle errors for async code in Node.js?

  
 Add to PDF   Senior 
Q77:   

Why to use Buffer instead of binary string to handle binary data ?

  
 Add to PDF   Senior 
Q78:   

How the V8 engine works?

  
 Add to PDF   Senior 
Q79:   

Does Node.js support multi-core platforms? And is it capable of utilizing all the cores?

  
 Add to PDF   Senior 
Q80:   

Is it possible to use Class in Node.js?

  
 Add to PDF   Senior 
Q81:   

What is LTS releases of Node.js why should you care?

  
 Add to PDF   Senior 
Q82:   

Is Node.js entirely based on a single-thread?

  
 Add to PDF   Senior 
Q83:   

When not to use Node.js?

  
 Add to PDF   Senior 
Q84:   

What is Piping in Node?

  
 Add to PDF   Senior 
Q85:   

What is the purpose of __filename variable in Node.js?

  
 Add to PDF   Senior 
Q86:   

What's the difference between dependencies, devDependencies and peerDependencies in package.json file?

  
 Add to PDF   Senior 
Q87:   

Can Node.js work without V8?

  
 Add to PDF   Senior 
Q88:   

What are async functions in Node? Provide some examples.

  
 Add to PDF   Senior 
Q89:   

What are the Timing features of Node.js?

  
 Add to PDF   Senior 
Q90:   

Does JavaScript have a map function to iterate over an object properties?

  Related To: JavaScript
 Add to PDF   Senior 
Q91:   

When to use Synchronous vs Asynchronous code in Node.js?

  
 Add to PDF   Senior 
Q92:   

Explain usage of NODE_ENV

  
 Add to PDF   Senior 
Q93:   

How does the Cluster module work? What’s the difference between it and a load balancer?

  
 Add to PDF   Senior 
Q94:   

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

  
 Add to PDF   Expert 
Q95:   

How does libuv work under the hood?

  
 Add to PDF   Expert 
Q96:   

Explain what is Reactor Pattern in Node.js?

  
 Add to PDF   Expert 
Q97:   

Can Node.js use other engines than V8?

  
 Add to PDF   Expert 
Q98:   

How many threads does Node actually create?

  
 Add to PDF   Expert 
Q99:   

Why Node.js devs tend to lean towards the Module Requiring vs Dependency Injection?

  
 Add to PDF   Expert 
Q100:   

How V8 compiles JavaScript code?

  
 Add to PDF   Expert 
Q101:   

How to solve Process out of Memory Exception in Node.js ?

  
 Add to PDF   Expert 
Q102:   

How would you scale Node application?

  
 Add to PDF   Expert 
Q103:   

Does the cluster in Node.js utilizes same event loop?

  
 Add to PDF   Expert 
Q104:   

Explain some Error Handling approaches in Node.js you know about. Which one will you use?

  
 Add to PDF   Expert 
Q105:   

What is V8 Templates?

  
 Add to PDF   Expert 
Q106:   

What is the purpose of using hidden classes in V8?

  
 Add to PDF   Expert 
Q107:   

Why should you separate Express app and server?

  
 Add to PDF   Expert 
Q108:   

Does JavaScript pass by references or pass by values?

  Related To: JavaScript
 Add to PDF   Expert 
Q109:   

What's the difference between pm2 and pm2-runtime and when to use one?

  Related To: Docker
 Add to PDF   Expert 
Q110:   

How would you implement process communication when using cluster module in Node.js?

  
 Add to PDF   Expert 
Q111:   

What is the difference between cluster.fork() vs child_process.fork() in Node.js?

  
 Add to PDF   Expert 
Q112:   

Why do we need C++ Addons in Node.js?

  
 Add to PDF   Expert 

Code Challenges

Q1:   

How would you read files in parallel in Node.js? Provide a code example

  
  Add to PDF   Mid 
Q2:   

How would you read files in sequence in Node.js? Provide a code example

  Related To: JavaScript
  Add to PDF   Mid 
Q3:   

Explain what is wrong with async/await use in the forEach loop

  
  Add to PDF   Mid 
Q4:   

Fix this code. Explain the fix.

  Related To: JavaScript
  Add to PDF   Mid 
Q5:   

Rewrite promise-based Node.js applications to async/await

  
  Add to PDF   Mid 
Q6:   

When is it best to use a module.exports vs a class vs an object literal when defining Node.js modules?

  
  Add to PDF   Mid 
Q7:   

Explain the usage of module.exports vs exports in that Node.js code sample

  
  Add to PDF   Senior 
Q8:   

Provide some example of config file separation for dev and prod environments

  
  Add to PDF   Senior 
Q9:   

How do you convert an existing callback API to promises?

  
  Add to PDF   Senior 
Q10:   

Consider following code snippet

  
  Add to PDF   Expert 
Q11:   

Explain the result of this code execution

  
  Add to PDF   Expert 
Q12:   

What will happen when that code will be executed?

  
  Add to PDF   Expert 
Q13:   

Rewrite the code sample without try/catch block

  
  Add to PDF   Expert 
Q14:   

Explain the result of this code execution

  
  Add to PDF   Expert 
 

Rust has been Stack Overflow’s most loved language for four years in a row and emerged as a compelling language choice for both backend and system developers, offering a unique combination of memory safety, performance, concurrency without Data races...

Clean Architecture provides a clear and modular structure for building software systems, separating business rules from implementation details. It promotes maintainability by allowing for easier updates and changes to specific components without affe...

Azure Service Bus is a crucial component for Azure cloud developers as it provides reliable and scalable messaging capabilities. It enables decoupled communication between different components of a distributed system, promoting flexibility and resili...

Cosmos DB has gained popularity among developers and organizations across various industries, including finance, e-commerce, gaming, IoT, and more. Follow along and learn the 24 most common and advanced Azure Cosmos DB interview questions and answers...
More than any other NoSQL database, and dramatically more than any relational database, MongoDB's document-oriented data model makes it exceptionally easy to add or change fields, among other things. It unlocks Iteration on the project. Iteration f...
Unit Tests and Test Driven Development (TDD) help you really understand the design of the code you are working on. Instead of writing code to do something, you are starting by outlining all the conditions you are subjecting the code to and what outpu...
Domain-Driven Design is nothing magical but it is crucial to understand the importance of Ubiquitous Language, Domain Modeling, Context Mapping, extracting the Bounded Contexts correctly, designing efficient Aggregates and etc. before your next DDD p...
At its core, Microsoft Azure is a public cloud computing platform - with solutions including Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS) that can be used for services such as analytics, virtual c...
As an asynchronous event-driven JavaScript runtime, Node.js is designed to build scalable network applications. Follow along to refresh your knowledge and explore the 52 most frequently asked and advanced Node JS Interview Questions and Answers every...
Dependency Injection is most useful when you're aiming for code reuse, versatility and robustness to changes in your problem domain. DI is also useful for decoupling your system. DI also allows easier unit testing without having to hit a database and...