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

Node based server uses a single threaded model and can services much larger number of requests than traditional server like Apache HTTP Server.

Answer : B

Explanation

You can use undercore _ to get the last result.

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

Explanation

Node.js console is a global object and is used to print different levels of messages to stdout and stderr. There are built-in methods to be used for printing informational, warning and error messages. It is used in synchronous way when destination is file or a terminal and asynchronous way when destination is a pipe.

Answer : A

Explanation

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

Answer : A

Explanation

net.connect(options[, connectionListener]) is a factory method, which returns a new 'net.Socket' and connects to the supplied address and port and can be used to create a client.

Q 9 - Which of the following module is required to create a web server?

A - url module

B - net module

C - http module

D - web module

Answer : C

Explanation

Node.js provides http module which can be used to create HTTP client of server.

Q 10 - A stream fires data event when there is data available to read.

A - false

B - true

Answer : B

Explanation

A stream fires data event when there is data available to read.

nodejs_questions_answers.htm
Advertisements