Node Js Interview Questions And Answers
1. What is Node.js?
Answer: Node.js is a server-side JavaScript platform which is built on Google Chrome’s JavaScript V8 engine. It is an open-source and cross-platform application to develop server-side and networking applications. Anyone can develop the Node.js application by writing code in JavaScript and it can be run on Microsoft Windows, Linux, or OS X.
Node.js is not a new language and also it is not just a framework built on JavaScript. It is built on Chrome’s JavaScript Runtime, so the code is written and executed very similarly to the browser.
2. Explain Process.nextTick() function in Node.js?
Answer: The Process.nextTick() function typically runs before any other I/O events fire. As we know, every node application runs on a single thread, in other words, only one task or event is processed by the Node’s event loop. In an event loop, a queue of callbacks is processed by Node on every tick of the event loop. On the next loop around the event, loop calls these callbacks.
The Process.nextTick() function defers the function until a completely new stack. You can call as many functions as you want to in the current stack. When the event loop is looking for a new event to execute the nextTick function will be in the queue and will execute an entirely new stack. The Process.nextTick() function defers the execution of action until the next pass around the event loop.
3. What are the Modules in Node.js?
Answer: Modules are part of the program. Programs are composed of one or more independently developed modules that are not combined until the programs are linked. The structure of the module is identical to the structure of the program. Node has a simple module loading system. In Node, there is a one-to-one correspondence of files and modules. As I have shown you in the example below, Module.js loads the module RequireModule.js in the same directory.
4. Where can we use node.js?
Answer: Node.js can be used for the following purposes
a) Web applications ( especially real-time web apps )
b) Network applications
c) Distributed systems
d) General-purpose applications
5. What is the difference between Node.js vs Ajax?
Answer: The difference between Node.js and Ajax is that Ajax (short for Asynchronous Javascript and XML) is a client-side technology, often used for updating the contents of the page without refreshing it. While,Node.js is Server Side Javascript, used for developing server software. Node.js does not execute in the browser but by the server.
6. How Node.js can be made more scalable?
Answer: Node.js works well 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.
7. Explain Web Server?
Answer: It is a software app which will handle the HTTP requests by the client (eg: browser) and will return web pages to the client as a response. Most of the webserver support – server-side scripts using scripting languages. Example of a web server is Apache, which is mostly used webserver.
8. How Node.js improves the performance of the application?
Answer: Node.js uses a single non-blocking thread. This means that thread runs time-consuming tasks as I/O asynchronously. So instead of creating a new thread for every request, Node.js uses the same thread for every request. This improves the performance of the application.
9. What is REPL in the context of Node?
Answer: REPL stands for reading Eval Print Loop and it represents a computer environment like a window console or Unix/Linux shell where a command is entered and the system responds with an output. Node.js or Node comes bundled with a REPL environment. It performs the following desired tasks.
Read: Reads the user’s input, parse the input into JavaScript data-structure and stores in memory.
Eval: Takes and evaluates the data structure
Print: Prints the result
Loop: Loops the above command until user press ctrl-c twice.
10. What is Node.Js and explain its features?
Answer: Node.js is a runtime platform built on Google Chrome’s JavaScript engine. It is a single thread model which uses the concurrency model for its events to be looped. Instead of blocking an application it helps in registering a callback to the new application and allows the present application to continue. That results in handling of concurrent operations without creating multiple threads of execution. It uses JavaScript with C or C++ for interacting with a filesystem.
The main features of node.js are:
1)Node.js library: All developers are mostly already comfortable with JavaScript. Node.js has a library built over JavaScript. Hence developers find it easy to use node.js.
2)Single-Threaded and highly scalable: It uses a single thread for event looping. Though the responses may not reach the server on time this does not block any operations. The normal servers have limited threads to handle the requests and Node.js creates a single thread to handle a large number of requests.
3)No Buffer: These applications do not need any buffer and just send the output of data in chunks.
4)Concurrent request handling with Asynchronous event-driven IO: All nodes of API in Node.js are asynchronous which helps in a node to receive a request for an operation. It works in the background along with taking new requests. Hence it handles all requests concurrently and does not wait for previous responses.
11. What is the purpose of Node.js?
Answer:
These are the following purposes of Node.js:
- Real-time web applications
- Network applications
- Distributed systems
- General-purpose applications
12. What is the use of a buffer class in Node.js?
Answer: The Node.js provides Buffer class to store raw data similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. It is a global class and can be accessed in an application without importing a buffer module. Buffer class is used because pure JavaScript is not compatible with binary data. So, when dealing with TCP streams or the file system, it’s necessary to handle octet streams.
13. Why should you separate Express ‘app’ and ‘server’?
Answer: Keeping the API declaration separated from the network-related configuration (port, protocol, etc) allows testing the API in-process, without performing network calls, with all the benefits that it brings to the table: fast testing execution and getting coverage metrics of the code. It also allows deploying the same API under flexible and different network conditions. Bonus: better separation of concerns and cleaner code.
14. Explain How Does Node.Js Work?
Answer:
- A Node.js application creates a single thread on its invocation. Whenever Node.js receives a request, it first completes its processing before moving on to the next request.
- Node.js works asynchronously by using the event loop and callback functions, to handle multiple requests coming in parallel. An Event Loop is a functionality which handles and processes all your external events and just converts them to a callback function. It invokes all the event handlers at a proper time. Thus, lots of work is done on the back-end, while processing a single request, so that the new incoming request doesn’t have to wait if the processing is not complete.
- While processing a request, Node.js attaches a callback function to it and moves it to the back-end. Now, whenever its response is ready, an event is called which triggers the associated callback function to send this response.
- Let’s Take An Example Of A Grocery Delivery. Usually, the delivery boy goes to each and every house to deliver the packet. Node.js works in the same way and processes one request at a time. The problem arises when anyone house is not open. The delivery boy can’t stop at one house and wait till it gets opened up. What he will do next, is to call the owner and ask him to call when the house is open. Meanwhile, he is going to other places for delivery. Node.js works in the same way. It doesn’t wait for the processing of the request to complete (the house is open). Instead, it attaches a callback function (call from the owner of the house) to it. Whenever the processing of a request completes (the house is open), an event gets called, which triggers the associated callback function to send the response.
- To summarize, Node.js does not process the requests in parallel. Instead, all the back-end processes like, I/O operations, heavy computation tasks, that take a lot of time to execute, run in parallel with other requests.
15. What Is Callback In Node.Js?
Answer: We may call “callback” as an asynchronous equivalent for a function. Node.js makes heavy use of callbacks and triggers it at the completion of a given task. All the APIs of Node.js are written in such a way that they support callbacks.
For example, suppose we have a function to read a file, as soon as it starts reading the file, Node.js return the control immediately to the execution environment so that the next instruction can be executed. Once the file read operation is complete, it will call the callback function and pass the contents of the file as its arguments. Hence, there is no blocking or wait, due to File I/O. This functionality makes Node.js as highly scalable, using it processes a high number of requests without waiting for any function to return the expected result.
16. What Is The Local Installation Of Dependencies?
Answer: By default, NPM installs any dependency in the local mode. It means that the package gets installed in the “node_modules” directory which is present in the same folder, where Node application is placed. Locally deployed packages are accessible via require(). Following is the syntax to install a Node project locally.
17. What is the best way of viewing this course?
Answer: You have to just watch the course from beginning to end. Once you go through all the videos, try to answer the questions in your own words. Also, mark the questions that you could not answer by yourself. Then, in the second pass go through only the difficult questions. After going through this course 2-3 times, you will be well prepared to face a technical interview in Node.js.
18. What Is NodeJS Module?
Answer: A module encapsulates related code into a single unit of code. When creating a module, this can be interpreted as moving all related functions into a file. Node modules run in their own scope so that they do not conflict with other modules. Node relatedly provides global access to help facilitate module interoperability. The primary 2 items that we are concerned with here require and exports. You require other modules that you wish to use in your code and your module exports anything that should be exposed publicly. Let’s see an example: save the below code as test.js,
19. What is middleware?
Answer: Middleware is actually a very simple concept to understand, it is very similar to the middleman. What middleman does is he takes the request from one party and gets in touch with the other party, he does what needs to be done and then provides a response back to the party which placed the request in the first place. So middleware is just simple functions with three arguments; request, response and next, they act as a middleman; when express receives a request, express passes this request to each middleware in the chain until it receives a response. In general, there are two kinds of middleware, the first one being a normal middleware, and the second one an error-handling middleware.
Middleware concept is at the core of express.js and very important to understand, almost everything in express.js is a middleware, from body parsers to loggers, from routes to error handlers. So it is very important to understand what are middlewares and how they work.
20. Why Node.js is single-threaded?
Answer: For async processing, Node.js was created explicitly as an experiment. It is believed that more performance and scalability can be achieved by doing async processing on a single thread under typical web loads than the typical thread-based implementation.
21. What does event-driven programming mean?
Answer: In computer programming, event-driven programming is a programming paradigm in which the flow of the program is determined by events like messages from other programs or threads. It is an application architecture technique divided into two sections
1) Event Selection
2) Event Handling
22. What are the pros and cons of Node.js?
Answer:
Pros: a) If your application does not have any CPU intensive computation, you can build it in the Javascript top to bottom, even down to the database level if you use JSON storage object DB like MongoDB.
b) Crawlers receive a full-rendered HTML response, which is far more SEO friendly rather than a single page application or a WebSockets app run on top of Node.js.
Cons:
a) Any intensive CPU computation will block node.js responsiveness, so a threaded platform is a better approach.
b) Using a relational database with Node.js is considered less favorable.
23. Explain Global Installation Of Dependencies?
Answer: Globally installed dependencies or packages are stored in /npm directory and these dependencies can be used in the Command Line Interface function of any node.js.
24. What is Asynchronous programming in Node.js?
Answer: In normal synchronous programming code is executed sequentially. This means that the first block of code should be executed before the next block code could be executed. This means that the first block of code blocks the next block of code. In asynchronous programming, which is used in Node.js, the code to execute does not depend on the previous block of code. In other words, there is no dependency on the sequence of code. This results in applications which execute faster.
25. What is ‘Callback’ in node.js?
Answer: The callback function is used in node.js to deal with multiple requests made to the server. Like if you have a large file which is going to take a long time for a server to read and if you don’t want a server to get engage in reading that large file while dealing with other requests, call back function is used. Call back function allows the server to deal with pending request first and call a function when it is finished.
26. What is the advantage of using node.js?
Answer:
- It provides an easy way to build scalable network programs
- Generally fast
- Great concurrency
- Asynchronous everything
- Almost never blocks
27. Why use Net.socket in Node.JS?
Answer: This object is an abstraction of a local socket or TCP. net. Socket instances implement a duplex Stream interface. These can be created by the user and used as a client (with connect() function) or they can be created by Node and can be passed to the user through the ‘connection’ event of a server.
28. When To Not Use Node.Js?
Answer: However, we can use Node.js for a variety of applications. But it is a single-threaded framework, so we should not use it for cases where the application requires long processing time. If the server is doing some calculation, it won’t be able to process any other requests. Hence, Node.js is best when processing needs less dedicated CPU time.
I am text block. Click the edit button to change this text. Lorem ipsum dolor sits amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper Mattis, pulvinar dapibus leo.
29. What Are The Key Features Of Node.Js?
Answer:
Let’s look at some of the key features of Node.js.
Asynchronous event-driven IO helps concurrent request handling: All APIs of Node.js is asynchronous. This feature means that if a Node receives a request for some Input/Output operation, it will execute that operation in the background and continue with the processing of other requests. Thus it will not wait for the response from the previous requests.
Fast in Code execution: Node.js uses the V8 JavaScript runtime engine, the one which is used by Google Chrome. Node has a wrapper over the JavaScript engine which makes the runtime engine much faster and hence the processing of requests within Node.js also become faster.
Single-Threaded but Highly Scalable: Node.js uses a single thread model for event looping. The response from these events may or may not reach the server immediately. However, this does not block other operations. Thus making Node.js highly scalable. Traditional servers create limited threads to handle requests while Node.js creates a single thread that provides service to much larger numbers of such requests.
Node.js library uses JavaScript: This is another important aspect of Node.js from the developer’s point of view. The majority of developers are already well-versed in JavaScript. Hence, development in Node.js becomes easier for a developer who knows JavaScript.
There is an active and vibrant community for the Node.js framework: The active community always keeps the framework updated with the latest trends in web development.
No Buffering: Node.js applications never buffer any data. They simply output the data in chunks.
30. Is Node.Js Entirely Based On A Single-Thread?
Answer: Yes, it’s true that Node.js processes all requests on a single thread. But it’s just a part of the theory behind Node.js design. In fact, more than the single thread mechanism, it makes use of events and callbacks to handle a large no. of requests asynchronously.
Moreover, Node.js has an optimized design which utilizes both JavaScript and C++ to guarantee maximum performance. JavaScript executes at the server-side by Google Chrome v8 engine. And the C++ lib UV library takes care of the non-sequential I/O via background workers.
To explain it practically, let’s assume there are 100s of requests lined up in Node.js queue. As per the design, the main thread of Node.js event loop will receive all of them and forwards to background workers for execution. Once the workers finish processing requests, the registered callbacks get notified on event loop thread to pass the result back to the user.
31. List Out the Difference Between Angularjs And NodeJs?
Answer: AngularJS is a web application development framework. It’s a JavaScript and it is different from other web app frameworks written in JavaScript like jQuery. NodeJS is a runtime environment used for building server-side applications while AngularJS is a JavaScript framework mainly useful in building/developing client-side part of applications which run inside a web browser.
32. What are the features of Node.js?
Answer: Node.js is a single-threaded but highly scalable system that utilizes JavaScript as its scripting language. It uses asynchronous, event-driven I/O instead of separate processes or threads. It is able to achieve high output via single-threaded event loop and non-blocking I/O.
33. Mention the steps by which you can async in Node.js?
Answer: By following steps you can async Node.js
- First-class functions
- Function composition
- Callback Counters
- Event loops
34. List out the differences between AngularJS and NodeJS?
Answer: AngularJS is a web application development framework. It’s a JavaScript and it is different from other web app frameworks written in JavaScript like jQuery. NodeJS is a runtime environment used for building server-side applications while AngularJS is a JavaScript framework mainly useful in building/developing client-side part of applications which run inside a web browser.
35. what require() is used in Node Js?
Answer: require() is used to include modules from external files in Node Js. It is the easiest way to include a module in Node. Basically require is a function that takes a string parameter which contains the location of the file that you want to include. It reads the entire javascript file, executes the file, and then proceeds to return the exports object.
36. What does it mean “non-blocking” in node.js?
Answer: In node.js “non-blocking” means that its IO is non-blocking. Node uses “libuv” to handle its IO in a platform-agnostic way. On windows, it uses completion ports for Unix it uses poll or queue, etc. So, it makes a non-blocking request and upon a request, it queues it within the event loop which calls the JavaScript ‘callback’ on the main JavaScript thread.
37. What is the difference of using var and not using var in REPL while dealing with variables?
Answer: Use variables to store values and print later. if var keyword is not used then the value is stored in the variable and printed. Whereas if var keyword is used then the value is stored but not printed. You can use both variables later.
38. What is REPL in Node.js?
Answer: REPL stands for Reading Eval Print and Loop. Using these operations you can write programs to accept commands, evaluate those and print them. It supports an environment similar to Linux or UNIX where a developer can enter commands and get a response with the output.
REPL performs the following functions:
READ: It reads input from the user, parses it into JavaScript and then proceeds to store it in the memory.
EVAL: It executes the data structure which stored the information.
PRINT: It prints the outcome which is received from executing the command.
LOOP: It loops the above command until developer presses Ctrl + C two times.
39. What is Node.js and where is it used?
Answer: Node.js is a server-side scripting technology that is based on the JavaScript engine of Google’s V8. It is used to build scalable web application programs that are quite simple but frequently needed for application development.
I/O intensive web applications like video streaming of websites can be done through Node.js Real-time web applications can also be developed through Node.js, not only this even network applications, distributed systems, and general-purpose applications can be developed by Node.js.
40. What are Globals in Node.js?
Answer:
Globals is a group of keywords in Node JS. Below-listed keywords usually lie under this category:
Global: Global namespace objects are represented by this and it works as a container for all other objects.
Process: Asynchronous function can be turned to an async call back through this function. You can access it from anywhere in the code and the information of the environment and application is provided by this keyword.
Buffer: Binary data is handled by this class of Node.js
41. What is event-driven programming in Node.js?
Answer: In Node.js, event-driven programming means as soon as Node starts its server, it initiates its variables, declares functions and then waits for an event to occur. It is one of the reasons why Node.js is pretty fast compared to other svr technologies.
42. Why is Node.js Single-threaded?
Answer: Node.js is single-threaded for async processing. By doing async processing on a single-thread under typical web loads, more performance and scalability can be achieved as opposed to the typical thread-based implementation.
43. What is the Event Loop?
Answer: Node js is a single-threaded application but it supports concurrency via the concept of event and callbacks. As every API of Node js are asynchronous and being a single thread, it uses async function calls to maintain the concurrency. Node uses observer pattern. Node thread keeps an event loop and whenever any task gets completed, it fires the corresponding event which signals the event listener function to get executed.
44. How Node.js overcomes the problem of blocking I/O operations?
Answer: Node.js solves this problem by putting the event-based model at its core, using an event loop instead of threads.
45. What is an Event Loop?
Answer: Node.js applications use the concepts of loops. This means that you register a callback for an event. When the event is executed the callback is pushed on the event loop. The event loop can consist of multiple callbacks. Event loop executes callbacks in a FIFO manner.
46. Can you explain the Asynchronous Approach In Node Js?
Answer: Nodejs operates asynchronously using event loop and callback functions. An Event Loop is a functionality which handles and processes all your external events and just converts them to a callback function. It invokes all your event handlers at a proper time. So, that means while executing a single request, it does a lot of things in the back-end so that the current request or the coming request doesn’t take much time.
47. How to avoid Callback Hell?
Answer: Node.js uses only a single thread and hence this may lead to many queued events. Hence whenever a long-running query finishes its execution it runs the callback associated with the query. To solve this issue the following can be followed:
Modular code: This code will be split into smaller modules and later can be joined together to the main module to achieve the desired result.
Promise Mechanism: This is an alternate way for async code. This mechanism ensures either a result of an error. They take two optional arguments and depending on a state of promise one of them will be called.
Use of Generators: These are routines which wait and resume using the yield keyword. They can also suspend and resume asynchronous operations.
Async Mechanism: This method provides a sequential flow of execution. This module has API which passes data from one operation to another using next callback. The caller is the main method and it is called only once through a callback.
48. Why node.js is quickly gaining attention from JAVA programmers?
Answer: Node.js is quickly gaining attention as it is a loop-based server for JavaScript. Node.js gives the user the ability to write the JavaScript on the server, which has access to things like HTTP stack, file I/O, TCP, and databases.
49. What’s your favorite HTTP framework and why?
Answer: There is no right answer to this. The goal here is to understand how deeply one knows the framework she/he uses if can reason about it, knows the pros, cons.
50. Explain NPM in Node.js?
Answer: 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
31. List Out the Difference Between Angularjs And NodeJs?
Answer: AngularJS is a web application development framework. It’s a JavaScript and it is different from other web app frameworks written in JavaScript like jQuery. NodeJS is a runtime environment used for building server-side applications while AngularJS is a JavaScript framework mainly useful in building/developing client-side part of applications which run inside a web browser.
32. What are the features of Node.js?
Answer: Node.js is a single-threaded but highly scalable system that utilizes JavaScript as its scripting language. It uses asynchronous, event-driven I/O instead of separate processes or threads. It is able to achieve high output via single-threaded event loop and non-blocking I/O.
33. Mention the steps by which you can async in Node.js?
Answer: By following steps you can async Node.js
- First-class functions
- Function composition
- Callback Counters
- Event loops
34. List out the differences between AngularJS and NodeJS?
Answer: AngularJS is a web application development framework. It’s a JavaScript and it is different from other web app frameworks written in JavaScript like jQuery. NodeJS is a runtime environment used for building server-side applications while AngularJS is a JavaScript framework mainly useful in building/developing client-side part of applications which run inside a web browser.
35. what require() is used in Node Js?
Answer: require() is used to include modules from external files in Node Js. It is the easiest way to include a module in Node. Basically require is a function that takes a string parameter which contains the location of the file that you want to include. It reads the entire javascript file, executes the file, and then proceeds to return the exports object.
36. What does it mean “non-blocking” in node.js?
Answer: In node.js “non-blocking” means that its IO is non-blocking. Node uses “libuv” to handle its IO in a platform-agnostic way. On windows, it uses completion ports for Unix it uses poll or queue, etc. So, it makes a non-blocking request and upon a request, it queues it within the event loop which calls the JavaScript ‘callback’ on the main JavaScript thread.
37. What is the difference of using var and not using var in REPL while dealing with variables?
Answer: Use variables to store values and print later. if var keyword is not used then the value is stored in the variable and printed. Whereas if var keyword is used then the value is stored but not printed. You can use both variables later.
38. What is REPL in Node.js?
Answer: REPL stands for Reading Eval Print and Loop. Using these operations you can write programs to accept commands, evaluate those and print them. It supports an environment similar to Linux or UNIX where a developer can enter commands and get a response with the output.
REPL performs the following functions:
READ: It reads input from the user, parses it into JavaScript and then proceeds to store it in the memory.
EVAL: It executes the data structure which stored the information.
PRINT: It prints the outcome which is received from executing the command.
LOOP: It loops the above command until developer presses Ctrl + C two times.
39. What is Node.js and where is it used?
Answer: Node.js is a server-side scripting technology that is based on the JavaScript engine of Google’s V8. It is used to build scalable web application programs that are quite simple but frequently needed for application development.
I/O intensive web applications like video streaming of websites can be done through Node.js Real-time web applications can also be developed through Node.js, not only this even network applications, distributed systems, and general-purpose applications can be developed by Node.js.
40. What are Globals in Node.js?
Answer:
Globals is a group of keywords in Node JS. Below-listed keywords usually lie under this category:
Global: Global namespace objects are represented by this and it works as a container for all other objects.
Process: Asynchronous function can be turned to an async call back through this function. You can access it from anywhere in the code and the information of the environment and application is provided by this keyword.
Buffer: Binary data is handled by this class of Node.js
41. What is event-driven programming in Node.js?
Answer: In Node.js, event-driven programming means as soon as Node starts its server, it initiates its variables, declares functions and then waits for an event to occur. It is one of the reasons why Node.js is pretty fast compared to other svr technologies.
42. Why is Node.js Single-threaded?
Answer: Node.js is single-threaded for async processing. By doing async processing on a single-thread under typical web loads, more performance and scalability can be achieved as opposed to the typical thread-based implementation.
43. What is the Event Loop?
Answer: Node js is a single-threaded application but it supports concurrency via the concept of event and callbacks. As every API of Node js are asynchronous and being a single thread, it uses async function calls to maintain the concurrency. Node uses observer pattern. Node thread keeps an event loop and whenever any task gets completed, it fires the corresponding event which signals the event listener function to get executed.
44. How Node.js overcomes the problem of blocking I/O operations?
Answer: Node.js solves this problem by putting the event-based model at its core, using an event loop instead of threads.
45. What is an Event Loop?
Answer: Node.js applications use the concepts of loops. This means that you register a callback for an event. When the event is executed the callback is pushed on the event loop. The event loop can consist of multiple callbacks. Event loop executes callbacks in a FIFO manner.
46. Can you explain the Asynchronous Approach In Node Js?
Answer: Nodejs operates asynchronously using event loop and callback functions. An Event Loop is a functionality which handles and processes all your external events and just converts them to a callback function. It invokes all your event handlers at a proper time. So, that means while executing a single request, it does a lot of things in the back-end so that the current request or the coming request doesn’t take much time.
47. How to avoid Callback Hell?
Answer: Node.js uses only a single thread and hence this may lead to many queued events. Hence whenever a long-running query finishes its execution it runs the callback associated with the query. To solve this issue the following can be followed:
Modular code: This code will be split into smaller modules and later can be joined together to the main module to achieve the desired result.
Promise Mechanism: This is an alternate way for async code. This mechanism ensures either a result of an error. They take two optional arguments and depending on a state of promise one of them will be called.
Use of Generators: These are routines which wait and resume using the yield keyword. They can also suspend and resume asynchronous operations.
Async Mechanism: This method provides a sequential flow of execution. This module has API which passes data from one operation to another using next callback. The caller is the main method and it is called only once through a callback.
48. Why node.js is quickly gaining attention from JAVA programmers?
Answer: Node.js is quickly gaining attention as it is a loop-based server for JavaScript. Node.js gives the user the ability to write the JavaScript on the server, which has access to things like HTTP stack, file I/O, TCP, and databases.
49. What’s your favorite HTTP framework and why?
Answer: There is no right answer to this. The goal here is to understand how deeply one knows the framework she/he uses if can reason about it, knows the pros, cons.
50. Explain NPM in Node.js?
Answer: 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
Note: Browse latest Node JS Interview Questions and Angular training videos. Here you can check Angular JS Online Training details and React Js Training Videos for self learning. Contact +91 988 502 2027 for more information.