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

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

Explanation

fs.writeFile(path, flags[, mode], callback) is the method which is used to write a file.

Answer : A

Explanation

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

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 : 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 - Child processes always have three streams child.stdin, child.stdout, and child.stderr which may be shared with the stdio streams of the parent process.

A - true

B - false

Answer : A

Explanation

Child processes always have three streams child.stdin, child.stdout, and child.stderr which may be shared with the stdio streams of the parent process.


nodejs_questions_answers.htm

Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.