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 - By default, npm installs any dependency in the local mode.

A - true

B - false

Answer : A

Explanation

By default, npm installs any dependency in the local mode.

Answer : C

Explanation

emit property is used to fire an event.

Answer : B

Explanation

fs.stat(path, callback) is the method which is used to get information about a file.

Answer : C

Explanation

fs.unlink(path, callback) is the method which is used to delete a file.

Answer : D

Explanation

Node.js console is a global object and is used to print different levels of messages to stdout and stderr. There are built-in methods to be used for printing informational, warning and error messages. It is used in synchronous way when destination is file or a terminal and asynchronous way when destination is a pipe.

Answer : A

Explanation

os.totalmem() returns the total amount of system memory in bytes.

Q 8 - net.isIP(input) returns 4 for IP version 4 addresses.

A - true

B - false

Answer : A

Explanation

net.isIP(input) tests if input is an IP address. Returns 0 for invalid strings, returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses.

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 - 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
E-Books Store