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.js is a JavaScript based framework/platform built on Google Chrome's JavaScript V8 Engine.

Q 2 - Which of the following command will show version of npm?

A - $ npm --version

B - $ node --version

C - $ npm getVersion

D - $ node getVersion

Answer : A

Explanation

Executing $ npm --version command will show the version of npm instance.

Q 3 - Which of the following code gets length of a buffer buf?

A - buf.length

B - buf.size

C - buf.length()

D - buf.size()

Answer : A

Explanation

buf.length returns size of a node buffer in bytes.

Answer : A

Explanation

fs.close(fd, callback) is the method which is used to close a file.

Answer : C

Explanation

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

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

Explanation

os.platform() returns the operating system platform.

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.

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 - A stream fires end event when there is no more data to read.

A - true

B - false

Answer : A

Explanation

A stream fires end event when there is no more data to read.

nodejs_questions_answers.htm
Advertisements