Saturday, October 20, 2018

Node.JS Interview Questions And Answers

Node.JS Interview Questions And Answers

Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser. Now a days NodeJs is very popular in the industry so, if you want to get hired in NodeJS interview, at least you should have good knowledge of Nodejs. Here we have collected some frequently asked questions of Nodejs. I hope you will get some help from these questions with answers.

Node.JS Interview Questions And Answers

 Q1) What is NodeJS?

NodeJS is javascript runtime environment that is built on chrome to enable lightweight and effective performance of server-side and networking applications in javascript. Node.js is a web application framework built on Google Chrome's JavaScript Engine (V8 Engine).

Node.js = Runtime Environment + JavaScript Library

Q2) What is NPM?

Node Package Manager(NPM). It is used to provide command line environment to install and manage NodeJS Packages, and NodeJS repositories that can be accessed at

Q3) Syntax to install modules using NPM. 

Syntax : $ npm install

Example: $ npm install express

var express = ('express'); 

Where express is Name of the module, 

express is JS file, that can be used in your module.

Q4) Mention types of npm modules available that are used very often.

Express, connect, and socketjs, pug, mongodb and mongojs, redis, lodash, forever, bluebird, moment are some of npm modules. 

Q5) Command to list modules installed in current npm. 

$ npm ls

Note: Remember not to mention npm in UPPERCASE - (Recommended) 

Q6) What are the attributes of package.json 

Name, version, description, homepage, author, contributors, dependencies − list of dependencies, repository − repository type and URL of the package, main − entry point of the package, keywords. 

Q7) What is REPL?

 REPL - Read, Eval, Print, Loop. 

It is an environment to input commands to perform REPL tasks. Each of the task is associated with its respective operations. 

Q8) What kind of applications can be built by Node.JS.

 DIRT, JSON, I/O Bound, Single Page applications are preferable to use Node.JS. 

Q9) What is the latest version of Node JS.

 Node v8.0.0 is the current version.

Q10) NodeJS is a framework. True or False. 

False. It is runtime or environment, but not a framework 

Q11) Commands to work with the file from the local database. 

 Var fs = require(‘fs’);
  • Read: fs.readFile(); 
  • Create: fs.appendFile();; fs.writeFile(); 
  • Write: fs. writeFile(); 
  • Delete: fs.unlink(); 
  • Rename: fs.rename(); 
  • Update: fs.appendFile() fs.writeFile()
Q12) What is error-first callback in Node JS? 

In order to check for proper working of the code, we need to verify error free execution. In this regard, error-first callbacks are used, that will send error first, followed by related data to the error. 

Q13) What is cluster? 

Cluster is a process to handle thread execution load while working with multi-core systems.

Q14) Why node is single threaded? 

In order to upgrade the performance well, single thread operations work better than multi-threaded operations. 

Q15) How does URL module works. 

This module helps URL to parse it into host, pathname, search, query, etc. 

var url = require('url');
var adr = ''; 
var q = url.parse(adr, true); 
console.log(; //returns '' 
console.log(; //returns '?s=node+js+training' 

Q16) Explain use of nodemailer module. 

It is not included in default modules list, it has to be installed using npm. 

Var nodemailer = require('nodemailer'); 

Q17) What are the types of versions available? 

Patch_Version, Minor_Version, Major_Version. 

Q18) What are event emitters in NodeJS? 

Objects in NodeJS will have to trigger events in order to maintain asynchronous execution of core API used. These objects that emit events are known as Event Emitters. 

Q19) What are event listeners? 

Events that are emitted by event emitters have to be listened in order to continue the asynchronous execution of the threads. These objects that listens the emitted events are known as listeners.


  1. IEEE Project Domain management in software engineering is distinct from traditional project deveopment in that software projects have a unique lifecycle process that requires multiple rounds of testing, updating, and faculty feedback. A IEEE Domain project Final Year Projects for CSE system development life cycle is essentially a phased project model that defines the organizational constraints of a large-scale systems project. The methods used in a IEEE DOmain Project systems development life cycle strategy Project Centers in Chennai For CSE provide clearly defined phases of work to plan, design, test, deploy, and maintain information systems.

    This is enough for me. I want to write software that anyone can use, and virtually everyone who has an internet connected device with a screen can use apps written in JavaScript. JavaScript Training in Chennai JavaScript was used for little more than mouse hover animations and little calculations to make static websites feel more interactive. Let’s assume 90% of all websites using JavaScript use it in a trivial way. That still leaves 150 million substantial JavaScript Training in Chennai JavaScript applications.

  2. I have been reading for the past two days about your blogs and topics, still on fetching! Wondering about your words on each line was massively effective. Techno-based information has been fetched in each of your topics. Sure it will enhance and fill the queries of the public needs. Feeling so glad about your article. Thanks…!
    selenium training in chennai
    selenium online courses best selenium online training
    selenium testing training
    selenium classes

  3. keep up the good work. this is an Ossam post. This is to helpful, i have read here all post. i am impressed. thank you. this is our courses in data analytics
    courses in data analytics |

  4. Nice post. Thanks for sharing! I want people to know just how good this information is in your article. It’s interesting content and Great work.
    Digital Marketing Course In Kolkata
    Web Design Course In Kolkata