×

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 29 Pascal Interview Questions for 2024

1) What is Pascal? Pascal is a high-level and Algol-based language that was developed by Niklaus Wirth. It is used to develop efficient and reliable programs. 2) What are the features of Pascal? Features...

4 minutes read.

Top 15 MATLAB Interview Questions for 2024

1) What is MATLAB? MATLAB (matrix laboratory) is fourth-generation programming language. It allows matrix manipulations, implementations of algorithm and many more. 2) Who developed MATLAB? MATLAB is developed by MathWorks. 3) In which language...

2 minutes read.

Top 10 WCF Interview Questions for 2024

  1. What is WCF? Windows Communication Foundation (WCF), earlier known by the name Indigo, is a run-time platform and a set of APIs in the .NET Framework for building, configuring, and...

7 minutes read.

Top 48 C# Interview Questions for 2024

1) Write a program in C# to print "HELLO WORLD"? class Program         {          static void Main(string  args[])           {             System.Console.WriteLine(" HELLO WORLD ");             }          } 2) Write a program in C# to print "TutorialandExample" using namespace? Here, namespace is used to group related classes. Using System;    namespace  TutorialandExample      {         public class           {             public static void Main(string[]  args)             {              Console.WriteLine(" TutorialandExample ");             }          }       } 3) What are the...

8 minutes read.

Top 15 T-SQL(Transact-SQL) Interview Questions for 2024

1) What is T-SQL? T-SQL stands for Transact Structured Query Language. T-SQL is the extension of SQL functionality supported by Microsoft SQL Server and Sybase ASE. 2) What are the features of...

3 minutes read.

Top 15 SQL Server Interview Question for 2024

1) Describe SQL Server? SQL server is a DataBase Management System developed by Microsoft. It was first introduced in year 2008 since, then many version has been introduced such as :...

2 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.

Bugzilla interview Questions

Frequently asked questions about Bugzilla Q1. What are reports in Bugzilla? A1. Reports can be defined as an interface between the user and the database of Bugzilla. It helps to examine and...

4 minutes read.

Top 15 JSP Interview Questions for 2024

1) What is JSP? It is a technology which is used to create web application like Servlet technology. It provides more functionality than Servlet. It consists of HTML and JSP tags. 2) What are...

3 minutes read.

Top 25 DB2 Interview question for 2024

1) Give breif detail about DB2? DB2 is a Relational Database Management System developed by IBM. It supports Object Oriented features and non-relational structures with XML. 2) Enlist the types of datatypes...

3 minutes read.

Top 30 AngularJS Interview Questions and Answers for 2024

Most Frequently asked AngularJS Interview Questions and Answers for Fresher 1) Describe Angular JS ? It is a powerful framework of JavaScript. AngularJS is used to design Rich Internet Application. This framework...

5 minutes read.

Top 28 Prototype Interview Questions for 2024

1) What is Prototype? Prototype is a JavaScript framework which is used in dynamic web applications. It is a namespace and a module that is used to manage HTML forms. It is also...

4 minutes read.

Top 15 Erlang Interview Questions for 2024

1) What is Erlang÷ Erlang is an open source programming language. It is used to build massively scalable soft real-time systems. It has runtime environment. It supports concurrency, fault tolerance and...

2 minutes read.

Top 31 PHP Interview Questions for 2024

1) What is PHP? PHP is a object-oriented scripting language, open source, interpreted and executed at server side. It is also used to develop web applications. 2) What are the features of PHP? Features...

4 minutes read.

Top 15 XML Interview Questions for 2024

1) What is XML? XML (eXtensible Markup Language) is designed to transport and store data. It has user executive tags i.e. no pre-defined tags used as in HTML. This language is...

2 minutes read.

Polymer.js Interview Questions

1) What is Polymer.js? Polymer.js is an open source JavaScript library. It is developed by Google. It is used to develop web applications for using of web components like HTML. 2) Describe...

3 minutes read.

Top 24 Clojure Interview Questions for 2024

1) What is Clojure? Clojure is a dynamic, general-purpose programming language. It is simple, coherent and powerful tool. It is based on Lisp Programming language. 2) Which platform is used to run...

4 minutes read.

SSIS Interview Questions and Answers

Q.1 What is SSIS? SQL Server Integration Service (SSIS) is a component of Microsoft SQL Server. It is a powerful ETL tool that is used for building enterprise-level data transformation and...

5 minutes read.

Top 40 IoT Interview Questions and Answers in 2024

Q.1 What is IoT? IoT stands for the Internet of things refers to the interconnection of the network of various devices that can recognize, collect and transfer data over the internet...

13 minutes read.

Top 30 TypeScript Interview Questions for 2024

1) What is TypeScript? TypeScript is an object-oriented and compiled language. TypeScript is also known as a set of tools. TypeScript is used for application-scale development. 2) What are the features of TypeScript? Features of...

4 minutes read.