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.

Answer : A

Explanation

Callback is an asynchronous equivalent for a function.

Answer : C

Explanation

emit property is used to fire an event.

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.

Q 6 - Is process a global object?

A - true

B - false

Answer : A

Explanation

The process object is a global object and can be accessed from anywhere.

Q 7 - Which of the following is the correct way to get an extension of a file?

A - fs.extname('main.js')

B - path.extname('main.js')

C - os.extname('main.js')

D - None of the above.

Answer : B

Explanation

path.extname(p) returns the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.

Q 8 - net.isIP(input) returns 0 for invalid input.

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.

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 - A stream fires end event when there is no more data to read.

A - true

B - false

Answer : A

Explanation

A stream fires end event when there is no more data to read.


nodejs_questions_answers.htm

Advertisements