Node.js Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to Node.js Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Which of the following statement is valid to use a Node module http in a Node based application?

A - var http = require("http");

B - var http = import("http");

C - package http;

D - import http;

Answer : A

Explanation

Require directive is used to load a Node module(http) and store returned its instance(http) into its variable(http).

Q 2 - By default, npm installs any dependency in the local mode.

A - true

B - false

Answer : A

Explanation

By default, npm installs any dependency in the local mode.

Answer : B

Explanation

on property is used to bind a function with the event.

Answer : A

Explanation

fs.close(fd, callback) is the method which is used to close a file.

Answer : A

Explanation

The clearTimeout( t ) global function is used to stop a timer that was previously created with setTimeout(). Here t is the timer returned by setTimeout() function.

Answer : B

Explanation

os.type() returns the operating system name.

Answer : A

Explanation

path.normalize(p) normalizes a string path, taking care of '..' and '.' parts.

Q 8 - Which of the following module is required for DNS specific operations?

A - dns module

B - web module

C - net module

D - None of the above.

Answer : A

Explanation

Node.js dns module is used to do actual DNS lookup as well as to use underlying operating system name resolution functionalities.

Answer : B

Explanation

Error emmitter is added explicitly to a domain using its add method in case of external binding.

Q 10 - Duplex stream can be used for both read and write operation.

A - true

B - false

Answer : A

Explanation

Duplex stream can be used for both read and write operation.

nodejs_questions_answers.htm
Advertisements