1. What is Node js ?
Node Js is one of the most popular and powerful server technologies today.
2. Explain CLI.
CLI stands for Command Line Interface. It is a utility or program on your computer where users type commands to perform some action or run some script rather than clicking on the screen.
There are different types of command line interfaces depending on which operating system you are using. We have listed some of them below.
- Bash on Linux.
- Terminal of Mac.
- Command Prompt or Powershell on Windows
- Shell/ Command line/terminal on Unix and Ubuntu
3. In which Language Node Js is written ?
4. Who is the author of Node Js ?
Node Js is written by Ryan Dahl.
6. Explain V8 Engine ?
. It implements ECMAScript as specified in ECMA-262, and runs on Windows 7 or later, macOS 10.5+, and Linux systems that use IA-32, ARM, or MIPS processors. V8 can run standalone or can be embedded into any C++ application.
7. Explain ECMAScript ?
8. How can you check the installed version of Node Js ?
node -v command to check the installed version of Node Js.
9. Explain What is NPM ?
10. Explain Modules in Node Js ?
11. What are CommanJs Modules ?
12. For what require() is used in Node Js ?
13. Explain module.exports in Node Js ?
The method or variable defined in modules cannot be directly accessible by the outer world, that means you cannot call a module member from the external file. In order to access module member, we need to export the functions or variables of modules using module.exports method.
Syntax and usage:
14. Is Node.js Single-threaded ?
Yes, Node Js is single threaded to perform asynchronous processing. Doing async processing on a single thread could provide more performance and scalability under typical web loads than the typical thread-based implementation.
15. What are events ?
An event is an action or occurrence recognized by software/app that is handled by event handler by writing a code that will be executed when the event fired.
Mouse move, Click, file copied or deleted are some examples of events.
In Node Js there are two types of events.
1)System Events: The event that comes from the C++ side.
2)Custom Events: Custom events are user-defined events.
16. Explain event loop in Node Js ?
In Node Js processes are single threaded, to supports concurrency it uses events and callbacks. An event loop is a mechanism that allows Node.js to perform non-blocking I/O operations.
17. How to create a simple server in Node js that returns Hello World ?
By writing following line of code, you can create a server in Node Js.
var http =require('http');
18. Difference between cluster and child_process modules?
19. How to stop master process without suspending all of its child processes?
20. What does emitter do and what is dispatcher?
21. Since node is a single threaded process, how to make use of all CPUs?