• 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

Answer : A

Explanation

All APIs of Node.js library are aynchronous that is non-blocking.

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 converts a buffer buf to JSON object?

A - buf.toJSON()

B - buf.json()

C - buf.covertToJson()

D - buf.jsonify()

Answer : A

Explanation

buf.toJSON() converts a buffer buf to JSON object.

Answer : C

Explanation

Node implements File I/O using simple wrappers around standard POSIX functions. Node File System (fs) module should be imported for File I/O opearations.

Answer : A

Explanation

The clearTimeout( t ) global function is used to stop a timer that was previously created with setTimeout(). Here t is the timer returned by setTimeout() function.

Answer : B

Explanation

process.version can be used to get the current process version.

Answer : A

Explanation

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

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

Explanation

http.createServer(callback) method can be used to create a web server.

Q 10 - Duplex stream can be used for both read and write operation.

A - true

B - false

Answer : A

Explanation

Duplex stream can be used for both read and write operation.

nodejs_questions_answers.htm
Advertisements