Top 60+ Node.JS Interview Questions and answers

    1 Votes

Frequently asked Top 60+ Node.JS interview questions and best answers for freshers and 2-5 year experienced web developers.

1) What is Node.js?

Node.js is a very powerful JavaScript based platform or framework which is built on Google Chrome's JavaScript V8 Engine.

2) Why to use Node.js?
It is used to develop I/O intensive web applications like video streaming sites, single page applications (SPA) and other web applications. Node.js is open source and used by thousands of developers around the world.
3) Who developed Node.js?

Node.js was developed in 2009 by Ryan Dahl.

4) What are the features of Node.js?

Below are the features of Node.js –

  • Very Fast
  • Event driven and Asynchronous 
  • Single Threaded but highly Scalable

5) Explain REPL in Node.js?

REPL stands for Read Eval Print Loop. Node.js comes with bundled REPL environment which performs the following desired tasks –

  • Eval
  • Print
  • Loop
  • Read

6) Explain variables in Node.js?

Variables are used to store values and print later like any conventional scripts. If “var” keyword is used then value is stored in variable. You can print the value in the variable using - console.log().

Eg:
$ node
> a = 30
30
> var b = 50
undefined
> a + b
80
> console.log("Hi")
Hi
undefined

7) What is the latest version of Node.js available?

Latest version of Node.js is - v0.10.36.

8) List out some REPL commands in Node.js?

Below are the list of REPL commands –

  • Ctrl + c - For terminating the current command.
  • Ctrl + c twice – For terminating REPL.
  • Ctrl + d - For terminating REPL.
  • Tab Keys - list of all the current commands.
  • .break - exit from multiline expression.
  • .save with filename - save REPL session to a file.

9) Mention the command to stop REPL in Node.js?

Command - ctrl + c twice is used to stop REPL.

10) Explain NPM in Node.js?

NPM stands for Node Package Manager (npm) and there are two functionalities which NPM takes care of mainly and they are –

  • Online repositories for node.js modules or packages, which can be searched on search.nodejs.org
  • Dependency Management, Version Management and command line utility for installing Node.js packages.

11) Mention command to verify the NPM version in Node.js?

Below command can be used to verify the NPM version –

$ npm --version

12) How you can update NPM to new version in Node.js?

Below commands can be used for updating NPM to new version –

$ sudo npm install npm -g
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
npm@2.7.1 /usr/lib/node_modules/npm

13) Explain callback in Node.js?

Callback is called once the asynchronous operation has been completed. Node.js heavily uses callbacks and all API’s of Node.js are written to support callbacks.

14) How Node.js can be made more scalable?

Node.js works good for I/O bound and not CPU bound work. For instance if there is a function to read a file, file reading will be started during that instruction and then it moves onto next instruction and once the I/O is done or completed it will call the callback function. So there will not be any blocking.

15) Explain global installation of dependencies?

Globally installed dependencies or packages are stored in <user-directory>/npm directory and these dependencies can be used in Command Line Interface function of any node.js.

Page 1 of 4

Popular Videos

communication

How to speak so that people want to listen.

Got a tip or Question?
Let us know

Related Articles

HTML/HTML5 Interview Questions and Answers
JQuery Interview Questions and Answers
Javascript Interview Questions and Answers
Top AngularJS Questions and Answers
Top 70 CSS Interview Questions and Answers