• 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 1Which of following command starts a REPL session?

A - $ node

B - $ node start

C - $ node repl

D - $ node console

Answer : A

Explanation

REPL can be started by simply running node on shell/console without any argument.

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.

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

Explanation

fs.writeFile(path, flags[, mode], callback) is the method which is used to write a file.

Answer : C

Explanation

The setTimeout(cb, ms) global function is used to run callback cb after at least ms milliseconds. The actual delay depends on external factors like OS timer granularity and system load. A timer cannot span more than 24.8 days. This function returns an opaque value that represents the timer which can be used to clear the timer.

Answer : B

Explanation

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

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

Explanation

dns.lookup(hostname[, options], callback) resolves a hostname (e.g. 'google.com') into the first found A (IPv4) or AAAA (IPv6) record. options can be an object or integer. If options is not provided, then IP v4 and v6 addresses are both valid. If options is an integer, then it must be 4 or 6.

Answer : B

Explanation

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

Q 10 - Which of the following is not a valid HTTP method?

A - get

B - put

C - post

D - header

Answer : D

Explanation

header is not a valid HTTP method.

nodejs_questions_answers.htm
Advertisements