Node.js Interview Questions and answers

11. How node.js works?
Answer : Node.js works on a v8 environment, it is a virtual machine that utilizes JavaScript as its scripting language and achieves high output via non-blocking I/O and single threaded event loop.

12. What do you mean by the term I/O ?
Answer : I/O is the shorthand for input and output, and it will access anything outside of your application. It will be loaded into the machine memory to run the program, once the application is started.

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

14. What Is ?
Answer : It is a plain JSON (JavaScript Object Notation) text file which contains all metadata information about Node.js Project or application.
This file should be present in the root directory of every Node.js Package or Module to describe its metadata in JSON format.
The file is named as “package” because Node.js platform treats every feature as a separate component. Node.js calls these as Package or Module.

15. Does Node.Js Support Multi-Core Platforms? And Is It Capable Of Utilizing All The Cores?
Answer : Yes, Node.js would run on a multi-core system without any issue. But it is by default a single-threaded application, so it can’t completely utilize the multi-core system.

16. What Is chaining process in Node.Js?
Answer : It’s an approach to connect the output of one stream to the input of another stream, thus creating a chain of multiple stream operations.

17. What is the relation of Node.js with JavaScript?
Answer : Though Node.js is not a JavaScript framework,[3] many of its modules are written in JavaScript, allowing developers to create new modules in JavaScript. Node.js is a virtual machine that leverages JavaScript as its scripting language to achieve high output.

18. What is a child_process module in Node.Js?
Answer : Node.js supports the creation of child processes to help in parallel processing along with the event-driven model.
The Child processes always have three streams , child.stdout, and child.stderr. The stream of the parent process shares the streams of the child process.

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

20. What is the advantage of using node.js?
Answer : a)It provides an easy way to build scalable network programs
b)Generally fast
c)Great concurrency
d)Asynchronous everything
e)Almost never blocks

test1

test1

Comments are closed here.