• 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

Answer : D

Explanation

Node.js is proving itself a perfect technology partner for all of the above mentioned areas.

Answer : D

Explanation

package.json is present in the root directory of any Node application/module and is used to define the properties of a package. It can also be used to update dependencies of a Node application.

Q 3 - Which of the following provides in-built events.

A - events

B - callback

C - throw

D - handler

Answer : A

Explanation

Node has multiple in-built events available through events module.

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 : C

Explanation

fs.ftruncate(fd, len, callback) is the method which is used to truncate a file.

Answer : B

Explanation

os.endianness() returns the endianness of the CPU. Possible values are "BE" or "LE".

Answer : A

Explanation

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

Q 8 - net.isIP(input) returns 4 for IP version 4 addresses.

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 : D

Explanation

child_process.exec method runs a command in a shell and buffers the output. It returns a buffer with a max size and waits for the process to end and tries to return all the buffered data at once.

Q 10 - Child processes always have three streams child.stdin, child.stdout, and child.stderr which may be shared with the stdio streams of the parent process.

A - true

B - false

Answer : A

Explanation

Child processes always have three streams child.stdin, child.stdout, and child.stderr which may be shared with the stdio streams of the parent process.

nodejs_questions_answers.htm
Advertisements