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

Answer : B

Explanation

REPL stands for Read Eval Print Loop and it represents a computer environment like a window console or Unix/Linux shell where a command is entered and system responds with an output in interactive mode.

Q 2 - Which of the following command will show all the modules installed locally.

A - $ npm ls -g

B - $ npm ls

C - $ node ls -g

D - $ node ls

Answer : B

Explanation

Executing $ npm ls command will show all the modules installed locally.

Q 3 - Which of the following code converts a buffer buf to JSON object?

A - buf.toJSON()

B - buf.json()

C - buf.covertToJson()

D - buf.jsonify()

Answer : A

Explanation

buf.toJSON() converts a buffer buf to JSON object.

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

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

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

C - package fs;

D - import fs;

Answer : A

Explanation

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

Answer : A

Explanation

The __dirname represents the name of the directory that the currently executing script resides in.

Q 6 - Is console a global object?

A - true

B - false

Answer : A

Explanation

Node.js console is a global object and is used to print different levels of messages to stdout and stderr.

Answer : A

Explanation

net.createServer([options][, connectionListener]) creates a new TCP server. The connectionListener argument is automatically set as a listener for the 'connection' event.

Answer : A

Explanation

Error emmitter is executing its code within run method of a domain in case of internal binding.

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