1. List down the steps using which “Control Flow” controls the function calls in Node.js
A generic piece of code that runs in between several asynchronous function calls is known as the control flow function.
a) Control the order of execution
b) Collect data
c) Limit concurrency
d) Call the next step in program
2. What are the two types of API functions in Node.js?
The two types of API functions in Node.js are
a) Asynchronous, non-blocking functions
b) Synchronous, blocking functions
3. How Node.js overcomes the problem of blocking of I/O operations?
Node.js solves this problem by putting the event-based model at its core, using an event loop instead of threads.
4. Mention the framework most commonly used in node.js?
“Express” is the most common framework used in node.js
5. What do you understand by Reactor Pattern in Node.js?
Reactor Pattern is an idea of non-blocking I/O operations in Node. js. This pattern provides a handler(in case of Node. js, a callback function) that is associated with each I/O operation.
6. Explain the concept of middleware in Node.js?
Middleware is the request/response handler functions.
It calls next middlware handler function after its completion by calling "next()".
It comes in middle of request-response life cycle and that is request and response cycle
Middleware has access to request and response object.
7. Explain the concept of URL module.
The url module provides utilities for URL resolution and parsing.
It splits up a web address into readable parts.
A URL string is a structured string containing multiple meaningful components.
When parsed, a URL object is returned containing properties for each of these components.
8. What do you understand by ESLint?
It covers both code quality and coding style issues.
9. For Node.js, why Google uses V8 engine?
But the similarities with chrome pretty much stop there: Node has no rendering engine/css parser/DOM,
but does have things you need in a server like an HTTP library and a filesystem API.
10. How assert works in Node.js?
Assert is a module in Nodejs which provides a set of assertion methods which helps in the verifying of invariants. The implementation is called assertion in Node.js.
It can also be used with Strict Mode for the verifying of invariants.
If any error occurs assert.AssertionError is the returned class object which contains following information:
message <string> If provided, the error message is set to this value.
actual <any> The actual property on the error instance.
expected <any> The expected property on the error instance.
operator <string> The operator property on the error instance.
stackStartFn <Function> If provided, the generated stack trace omits frames before this function.