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

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

A - $ npm --version

B - $ node --version

C - $ npm getVersion

D - $ node getVersion

Answer : B

Explanation

Executing $ node --version command will show the version of Node instance.

Answer : B

Explanation

on property is used to bind a function with the event.

Answer : A

Explanation

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

Answer : B

Explanation

fs.rmdir(path, callback) is the method which is used to remove a directory.

Answer : B

Explanation

os.type() returns the operating system name.

Q 7 - Which of the following module is required for network specific operations?

A - os module

B - fs module

C - net module

D - None of the above.

Answer : C

Explanation

Node.js net module is used to create both servers and clients. This module provides an aynchronous network wrapper.

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.

Q 9 - Which of the following module is required to create a child process?

A - process module

B - child_process module

C - child module

D - web module

Answer : B

Explanation

Node provides child_process module which provides ways to create child process.

Q 10 - Each type of Stream is an EventEmitter.

A - true

B - false

Answer : A

Explanation

Each type of Stream is an EventEmitter instance and throws several events at different instance of times.

nodejs_questions_answers.htm
Advertisements