Node.js Online Quiz


Advertisements


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

Explanation

Being built on Google Chrome's V8 JavaScript Engine, Node.js library is very fast in code execution.

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 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.

Answer : D

Explanation

Piping is a mechanism where we provide output of one stream as the input to another stream. It is normally used to get data from one stream and to pass output of that stream to another stream. There is no limit on piping operations.

Answer : C

Explanation

The setInterval(cb, ms) global function is used to run callback cb repeatedly 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 using the function clearInterval(t).

Q 6 - Is process a global object?

A - true

B - false

Answer : A

Explanation

The process object is a global object and can be accessed from anywhere.

Answer : A

Explanation

os.freemem() returns the free amount of system memory in bytes.

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

Explanation

http.request(options, callback) method can be used to make a request a web server.

Q 10 - A stream fires error event when there is any error receiving or writing data.

A - false

B - true

Answer : B

Explanation

A stream fires error event when there is any error receiving or writing data.


nodejs_questions_answers.htm

Advertisements