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

Explanation

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

Answer : A

Explanation

Callback is an asynchronous equivalent for a function.

Answer : C

Explanation

emit property is used to fire an event.

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

fs.readdir(path, callback)is the method which is used to read a directory.

Answer : B

Explanation

os.endianness() returns the endianness of the CPU. Possible values are "BE" or "LE".

Answer : A

Explanation

path.normalize(p) normalizes a string path, taking care of '..' and '.' parts.

Q 8 - Which of the following method resolves an ip address to an array of hostnames?

A - dns.reverse(ip, callback)

B - dns.resolve(hostname[, rrtype], callback)

C - dns.resolve4(hostname, callback)

D - None of the above.

Answer : A

Explanation

dns.reverse(ip, callback) resolves an ip address to an array of hostnames.

Answer : D

Explanation

child_process.exec method runs a command in a shell and buffers the output. It returns a buffer with a max size and waits for the process to end and tries to return all the buffered data at once.

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