×

Top 15 NodeJS Interview Questions for 2024

1) What is NodeJs?

NodeJs is open source JavaScript based feamework used to develop I/O intensive web application. It is collections of JavaScript library and runtime environment. It is used to develop server-side and networking applications.

2) What are the features on NodeJs?

These are the some important feature provided by NodeJs:
  • Asynchronous and Event Driven.
  • Fast code execution.
  • Single threaded.
  • No buffering
  • Great concurrency

3) What is REPL in NodeJs?

REPL (Read Eval Print Loop) represent a computer environment (window console or linux/unix shell) where some command is entered and system generates an output.
  • Read: Reads user input command, parses it to JavaScript data structure.
  • Eval: Evaluate the data structure.
  • Print: Prints the output result.
  • Loop: Circulate the above all commands until user press ctrl-c twice.

4) What is npm?

npm stands for Node Package Manager. It provide the following facilities:
  • It provides command line utility to install NodeJs packages.
  • It also manages version and dependency of NodeJs packages.
  • It provides online repositories facilities for NodeJs packages which are It provides online repositories facilities for NodeJs packages which are searchable on search.nodejs.org.

5) How NodeJs works?

NodeJs executes on v8 environment which act as virtual machine. This virtual machine utilizes JavaScript as its scripting language and generates output via non-blocking I/O and single threaded event loop.

6) Why Node.js is single threaded?

Nodejs is single-threaded as JavaScript executed in single thread with event loop. Event mechanism helps the server to respond in an asynchronous way and make server highly scalable.

7) Where can we use NodeJs?

NodeJs is used to build following type of applications:
  • Network application
  • Web application
  • Single Page application
  • Video (data) streaming application
  • Distributed systems

8) What does event-driven programming mean?

Event driven programming is a programming paradigm in which the flow of program is determined by events. In NodeJs event driven paradigm is maintain by event and callbacks. NodeJs uses an event loop and whenever a task gets finished, it calls the corresponding event.

9) What is EventEmitter?

EventEmitter is a class which lies in events module. It has multiple methods with event and listener. The following code represents how it can be accessed:
var events = require('event'); //import event module  

var eventEmitter = new events.EventEmitter(); //creating an object
Methods under EventEmitter class:
addListener(event, listener)

removeListener(event, listener)

removeAllListeners([events])

setMaxListeners(n)

listeners(events)

once(event, listener)

on(event, listener)

emit(event, [arg1],[arg2],[..])

10) What are the different types of API functions in NodeJs?

There are two types of API function in NodeJs:
  • Non-blocking (asynchronous) function.
  • Blocking (synchronous) function.

11) What is 'Callback' in NodeJs?

Callback is a function used to deal with multiple requests made to the server. A callback is called at the completion of assign task. Callback function allows server to deal with pending request first and call a function when it is completed.

12) What does it mean "non-blocking" in NodeJs?

Non-blocking code are those which doesn't wait for previous assign task to complete. Non-blocking code means that the IO is not blocking. Non-blocking code do not execute in sequence.

13) What is "blocking" function in NodeJs?

Blocking code refers when an application wait for some I/O operation in order to complete its execution. It wait for previous assign task to complete first when multiple task assign to server.

14) Which command is used to import external libraries?

"require" command is used to import external libraries. For example:
var http=require("http"); //load http library.  

var fs=require("fs"); // load external file.

15) Which is the most compatible framework used in NodeJs?

"ExpressJs" is most commonly framework used in node.js.

Related Topics

Top 15 iOS (iPhone, iPad) Interview Questions for 2024

Top 20 Most Frequently asked iOS Interview Questions and Answers 1) What is iOS? iOS is a mobile operating system developed by Apple Inc. iOS offers iPhone and iPad application development using...

3 minutes read.

Top 31 Dart Programming Interview Questions for 2024

1) What is Dart? Dart is an application programming language. It is used to build web, server and mobile applications. 2) Who is the developer of Dart? Google is the developer of Dart. 3)...

6 minutes read.

Top 30 Python Interview Questions for 2024

1) What is Python? Python is a high level, interpreted and object-oriented programming language. It is easy to learn and supports multiple programming patterns. It is also known as powerful and versatile...

6 minutes read.

Top 15 KnockoutJS Interview Questions for 2024

1) What is KnockoutJS? It is a JavaScript library which is based on MVVM pattern that helps developers in building rich and responsive websites. 2) Who is the author of KnockoutJS? Steve Sanderson is...

2 minutes read.

Top 30 Core Java Interview Questions for 2024

1. What is the difference between HashMap and Hashtable in Java? Ans. S.No. HashMap Hashtable 1. ...

6 minutes read.

Top 20 HTTP Interview Questions for 2024

1) What is HTTP? HTTP stands for Hypertext Transfer Protocol. It is a set of rules for transferring of data on WWW (World Wide Web). 2) What are the basic Features of...

4 minutes read.

Symfony PHP Framework Interview Questions

1) What is Symfony? Symfony is an open source, web application framework. It is written in PHP and used to design PHP applications. It was first released on18 October, 2005. 2) What...

5 minutes read.

W3.CSS Interview Questions

1) What is W3.CSS? W3.CSS stands for Cascading Style Sheet. It is developed by w3schools.com. It is used to create faster, beautiful and responsive websites. 2) What are the features of W3.CSS? W3.CSS...

3 minutes read.

Top 15 Website Development Interview Questions for 2024

1) What is Website Development? Website Development is a process that includes following steps. web design web content development client-side or server-side scripting network security configuration etc 2) What are the skills...

3 minutes read.

Flutter Interview Questions

Here’s a list of top Flutter questions that are frequently asked. Q1.  Is Flutter an open-source? A1.  Yes, Flutter is a 100% open-source software development kit. Q2.  What are flutter widgets? A2.  Widgets are...

7 minutes read.

Top 16 Arduino Interview Questions for 2024

1) What is Arduino? Arduino is an open source electronic platform. It is based on easy-to-use hardware and software. It able to read input signal. It is used to write and...

2 minutes read.

Top 15 Java Collections Interview Questions for 2024

1) What is Collections in Java? It is a framework which is used to store and manipulate the group of objects. 2) What are the commonly used methods of Collection interface in...

2 minutes read.

Top 16 Ionic Interview Questions for 2024

Top 20 Ionic Interview Questions and Answers for Freshers 1) What is Ionic framework? Ionic is open source HTML5 framework used for hybrid mobile application development. It provides tools and services for...

3 minutes read.

Top 16 Groovy interview Questions for 2024

1) What is Groovy? Groovy is an object oriented programming language. It is based on java platform. It can also be used as scripting language. 2) Who designed the Groovy? James Strachan designed...

2 minutes read.

Top 30 RPA Interview questions for 2024

Q1. What is RPA (Robotic Process Automation)? The Robotic Process Automation is a trending technology in the market where: Robotic: Robotic means "machines that copy the human actions." Process: Process means "the sequence of steps which...

12 minutes read.

Top 20 Java Programming Coding Interview Questions for 2024

Coding is an integral part of any programming language. It is the most important phase of an interview. Interviewee checks the capability of thinking of any particular. I think one...

13 minutes read.

Top 31 CakePHP Interview Questions for 2024

1) What is CakePHP? CakePHP is an open-source PHP framework. It is used to develop dynamic web applications. It helps to developers to work in a structured manner. 2) When cakePHP was...

5 minutes read.

A to Z Interview Questions

ABCDEFGHIJKLMNOPQRSTUVWXYZ Interview Questions and Answers List A AJAX Interview Questions Android Interview Questions Angular 2 Interview Questions AngularJs Interview Questions Apache Presto Interview Questions Apache Tapestry Interview Questions Arduino Interview Questions ASP.NET MVC Interview Questions Aurelia Interview Questions AWS Interview Questions B Blockchain Interview...

3 minutes read.

Top 15 Foundation Interview Questions for 2024

1) What is Foundation? Foundation is a front-end framework that is for designing beautiful responsive websites. This framework is compatible with all types of devices and provides you with HTML, CSS...

2 minutes read.

Top 29 Phalcon Framework Interview Questions for 2024

1) What is Phalcon? Phalcon is an open source framework based on the MVC (Model-View-Controller) pattern. It is the combination of PHP and C language. It is developed by Andres Gutierrez...

6 minutes read.