
Question Bank
MAthamatics
Node.js code executes in a single thread, implying no concurrency is possible.
Answer: False
Which HTTP module method is used to create an HTTP server in Node.js?
Answer: `http.createServer()`
The `fs.readFile` method is an asynchronous operation by default.
Answer: True
What is a 'Middleware' in the context of Express.js?
Answer: Functions that execute during the request-response cycle and have access to the req and res objects
`global` object in Node.js is similar to `window` in the browser environment.
Answer: True
Which file is the default entry point for a Node.js application if not specified in package.json?
Answer: index.js
Node.js streams are instances of the `EventEmitter` class.
Answer: True
Which of these modules is NOT a built-in Node.js module?
Answer: `express`
Using `try-catch` blocks is sufficient to catch all errors in asynchronous Node.js code.
Answer: False
What is the purpose of the `__dirname` global variable in Node.js?
Answer: It stores the absolute path to the directory containing the currently executing file