• Node.js Video Tutorials

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 - Which of the following command will show version of npm?

A - $ npm --version

B - $ node --version

C - $ npm getVersion

D - $ node getVersion

Answer : A

Explanation

Executing $ npm --version command will show the version of npm instance.

Q 3 - Buffer class is a global class and can be accessed in application without importing buffer module.

A - true

B - false

Answer : A

Explanation

Buffer class is a global class and can be accessed in application without importing buffer module.

Answer : C

Explanation

Node implements File I/O using simple wrappers around standard POSIX functions. Node File System (fs) module should be imported for File I/O opearations.

Answer : A

Explanation

path.join([path1][, path2][, ...]) joins all arguments together and normalize the resulting path.

Q 8 - net.isIP(input) returns 0 for invalid input.

A - true

B - false

Answer : A

Explanation

net.isIP(input) tests if input is an IP address. Returns 0 for invalid strings, returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses.

Answer : B

Explanation

Express is a minimal and flexible Node.js web application framework that provides a robust set of features to develop web and mobile applications.

Q 10 - Transform stream is a type of duplex stream.

A - true

B - false

Answer : A

Explanation

Transform stream is a duplex stream where the output is computed based on input.

nodejs_questions_answers.htm
Advertisements