Node Js MCQ Questions And Answers
NodeJs MCQ : This section focuses on "Basics" of Node Js. These Multiple Choice Questions (MCQ) should be practiced to improve the NodeJs skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Which of the following is true about Node.js?
A. Node.js is an open source server environment.
B. Node.js allows you to run JavaScript on the server.
C. Node.js runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
D. All of the above
View Answer
Ans : D
Explanation: All of the above statement are true.
2. Which of the following is false?
A. Node.js can create, open, read, write, delete, and close files on the server
B. Node.js can generate static page content
C. Node.js can collect form data
D. Node.js can add, delete, modify data in your database
View Answer
Ans : B
Explanation: False, Node.js can generate dynamic page content.
3. Node.js files must be initiated in the?
A. Command Prompt
B. nodejs Editor
C. Both A and B
D. None of the above
View Answer
Ans : A
Explanation: Node.js files must be initiated in the "Command Line Interface" program of your computer.
4. Syntax to Initiate the Node.js File is?
A. filename.js
B. javascript filename.js
C. node filename.js
D. node filename
View Answer
Ans : C
Explanation: Syntax to Initiate the Node.js File is node filename.js.
5. Which keyword is used to make properties and methods available outside the module file?
A. import
B. module
C. exports
D. require
View Answer
Ans : C
Explanation: Use the exports keyword to make properties and methods available outside the module file.
6. Which method appends specified content to a file.
A. fs.appendFile()
B. fs.open()
C. fs.writeFile()
D. None of the above
View Answer
Ans : A
Explanation: The fs.appendFile() method appends specified content to a file. If the file does not exist, the file will be created.
7. Which of the following command will show version of Node?
A. $ npm --version
B. $ npm getVersion
C. $ node getVersion
D. $ node --version
View Answer
Ans : D
Explanation: Executing $ node --version command will show the version of Node instance.
8. What are the key features of Node.js?
A. Real time Data intensive
B. Highly scalable servers for Web Applications
C. Builds fast and scalable network Applications
D. All of the above
View Answer
Ans : D
Explanation: All of the above statement are correct.
9. which of the following areas, Node.js is not advised to be used?
A. Single Page Applications
B. JSON APIs based Applications
C. CPU intensive applications
D. Data Intensive Realtime Applications (DIRT)
View Answer
Ans : C
Explanation: It is not advisable to use Node.js for CPU intensive applications.
10. The URL module splits up a web address into readable parts.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: The URL module splits up a web address into readable parts. To include the URL module, use the require() method
Discussion