Following are the Mcq’s related to Node.js these are also asked in coursera Node.js course:
RELATED CONTENT: Learn About Top 5 Node.js Frameworks
MCQ’s Related To Node.js:
Q1: What technology do web servers use to respond to client requests?
- HTTP
- CSS
- Node.js
- HTML
Answer :
1.) HTTP (is the technology web servers use to communicate with and respond to client requests.)
Q2: What is a popular format for sending data to REST services over HTTP?
- Node.js
- HTML/CSS
- JSON
- Express.js
Answer :
3.) JSON (is a popular format for sending data to REST services.)
RELATED CONTENT: Learn the difference between Import() vs require()
Q3: Which of the following is true regarding the import() function but NOT the require() function?
- Binding errors are identified at run-time.
- It must be called at the beginning of the file.
- It can be used within conditional statements and functions.
- It is bound dynamically.
Answer :
2. It must be called at the beginning of the file.
Q4: How can you handle incoming request messages and return response messages with a web server?
- Group Node.js modules into a package
- Develop a callback function
- Set the web server to listen to a port
- Import a Node.js module
Answer :
(2) Develop a callback function (to handle incoming and outgoing messages with a web server.)
Q5: What would you use var today = require(‘./today’); for?
- To create an instance of a web server application
- To download an npm package from the Internet on the terminal
- To retrieve the date from a weather service
- To import a Node.js module
Answer :
(4) To import a Node.js module (You can use the require function to import a Node.js module)
RELATED CONTENT: Learn the difference between Import() vs require()
Q6: How do you make a function or a value available to Node.js applications that import your module?
- Add a property to exports
- Create an instance of a web server application
- Edit the module manifest
- Use the http.createServer function
Answer :
(1) Add a property to exports
Q7: If you find a module written by someone else on the internet with a copyleft license, what type of node module is this considered?
- Library
- Third-party
- Core
- Local
Answer :
(2) Third-party (A module written by someone in the Node.js community is called a third-party module.)
Q8: What is the function of a package manager?
- It translates code into a machine-readable language.
- It is the protocol used by servers to communicate with each other.
- It automates dependency package configuration.
- It is a run-time environment for the Chrome V8 engine.
Answer :
(3) It automates dependency package configuration.
(A package manager automates the process of finding, installing, upgrading, configuring, maintaining, and removing packages for a computer program.)