Node Js Multiple Choice Question
Question 1. What is Node.js ?
A
A server-side JavaScript runtime environment
B
A front-end framework
C
A database management system
D
A programming language
Answer:
Question 2. Which of the following is not a core module in Node.js ?
A
fs
B
http
C
net
D
mongo
Answer:
Question 3. What is the default package manager for Node.js ?
A
npm
B
yarn
C
bower
D
gulp
Answer:
Question 4. Which of the following methods is used to import modules in Node.js ?
A
require()
B
import ()
C
include()
D
import_module()
Answer:
Question 5. Which module is commonly used for creating a web server in Node.js ?
A
http
B
fs
C
url
D
path
Answer:
Question 6. Which keyword is used to create a new instance of an object in Node.js ?
A
new
B
instance
C
create
D
object
Answer:
Question 7. Which event is emitted when an error occurs in Node.js ?
A
error
B
exception
C
fail
D
crash
Answer:
Question 8. Which module is used for working with file operations in Node.js ?
A
fs
B
http
C
net
D
path
Answer:
Question 9. What is the purpose of the package.json file in Node.js ?
A
To define project dependencies and configurations
B
To store JavaScript code
C
To define the HTML structure of a webpage
D
To define database schemas
Answer:
Question 10. Which of the following is a non-blocking I/O model used in Node.js ?
A
Synchronous I/O
B
Asynchronous I/O
C
Multi-threaded I/O
D
Blocking I/O