Skip to content

Quiz / MCQ’s Related To Node.js

authentication-and-authorization-in-nodejs

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?

  1. HTTP
  2. CSS
  3. Node.js
  4. 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?

  1. Node.js
  2. HTML/CSS
  3. JSON
  4. 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?

  1. Binding errors are identified at run-time.
  2. It must be called at the beginning of the file.
  3. It can be used within conditional statements and functions.
  4. 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?

  1. Group Node.js modules into a package
  2. Develop a callback function
  3. Set the web server to listen to a port
  4. 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?

  1. To create an instance of a web server application
  2. To download an npm package from the Internet on the terminal
  3. To retrieve the date from a weather service
  4. 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?

  1. Add a property to exports
  2. Create an instance of a web server application
  3. Edit the module manifest
  4. 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?

  1. Library
  2. Third-party
  3. Core
  4. 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?

  1. It translates code into a machine-readable language.
  2. It is the protocol used by servers to communicate with each other.
  3. It automates dependency package configuration.
  4. 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.)

Leave a Reply

Your email address will not be published. Required fields are marked *