Node JS Quiz

Node JS Quiz




1. In Nodejs how node based web servers differ from traditional web servers ?

  1. Node based server uses a single threaded model and can serve much larger number of requests compared to any traditional server like Apache HTTP Server.
  2. Node based server process request much faster than traditional server.
  3. There is no much difference between the two.
  4. All Of The Above

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is A-Node based server uses a single threaded model and can services much larger number of requests than traditional server like Apache HTTP Server.[/bg_collapse]
 
2. In Node.js from the following which is true about writable stream ?

  1. Output of readable stream can be input to a writable stream.
  2. writable stream is used for write operation.
  3. Both of the above.
  4. None of the above

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is C-Both of the above[/bg_collapse]
 
3. A stream fires finish event when all data has been flushed to underlying system.?

  1. True
  2. False

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ] Correct answer is True[/bg_collapse]
 
4. What are the key features of Node.js ?

  1. Real time Data intensive.
  2. Highly scalable servers for Web Applications.
  3. Builds fast and scalable network Applications.
  4. All of the above

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is D-All of the above.[/bg_collapse]
 
5. Node.js uses an event-driven, non-blocking I/O model ?

  1. True
  2. False

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is A-True.[/bg_collapse]
 
6. In Nodejs what is use of underscore variable in REPL session?

  1. to store the result.
  2. to get the last command used.
  3. None of the above.
  4. to get the last result.

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is D[/bg_collapse]
 



7. Which of the following is true about Chaining streams ?

  1. Chanining is a mechanism to connect output of one stream to another stream and create a chain of multiple stream operations.
  2. Chanining is normally used with piping operations.
  3. Both of the above.
  4. None of the above.

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is C- Both of the above.[/bg_collapse]
 
8. Which of the following is true about fork methd of child_process module. ?

  1. The fork method returns object with a built-in communication channel in addition to having all the methods in a normal ChildProcess instance.
  2. The fork() method method is a special case of the spawn() to create Node processes.
  3. Both of the above.
  4. None of the above.

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct asnwer is C-Both of the above.[/bg_collapse]
 
9. Is Node.js free to use?

  1. Yes
  2. No

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is A-Yes its absolutely free to use.[/bg_collapse]
 
10. Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world. ?

  1. True
  2. False

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is A-True.[/bg_collapse]



11. In Node.js APIs of Node.JS are which of the following .?

  1. Asynchronous
  2. Synchronous
  3. Both of the above.
  4. None of the above.

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is A-Asynchronous[/bg_collapse]
 
12. Which method of fs module is used to open a file ?

  1. fs.openFile(path, flags[, mode], callback)
  2. fs.open(path, flags[, mode], callback)
  3. fs.openPath(path, flags[, mode], callback)
  4. None of the above.

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is B- fs.open(path, flags[, mode], callback) is the method which is used to open a file.[/bg_collapse]
 
13. In Nodejs net.isIP(input) returns 6 for IP version 6 addresses.?

  1. False
  2. True

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is B-True[/bg_collapse]
 
14. Is Node a single threaded application ?

  1. Yes
  2. No

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is A-Yes Node a single threaded application[/bg_collapse]
 
15. Node.js is a single-threaded application, but it can support concurrency via the concept of event and callbacks. ?

  1. True
  2. False

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is A-True[/bg_collapse]
 
16. Node js is a single thread application but it my or can support concurrency. ?

  1. True
  2. False

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is A- True[/bg_collapse]
 
17. Which of the following is true about global objects in Node applications ?

  1. Global objects are global in nature and they are available in all modules.
  2. Global objects are nore required to be included in application, rather they can be used directly.
  3. Both of the above.
  4. None of the above.

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is C-Both of the above.[/bg_collapse]



18. Which of the following module is required for path specific operations ?

  1. Os module
  2. Path module
  3. Fs module
  4. None of the above.

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is B-Path module.[/bg_collapse]
 
19. What types of tasks can be done asynchronously using the event loop?

  1. I/O operations
  2. Heavy computation
  3. Anything requiring blocking
  4. All of the above

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is D-All of the above.[/bg_collapse]
 
20. From the following which are Node.js streams types ?

  1. Writable
  2. Duplex
  3. Readable
  4. All of the above

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is D-All of the above.[/bg_collapse]
 
21. In node.js from the following which command will show version of node ?

  1. node getVersion
  2. $ npm –version
  3. % node –version
  4. node –version

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is C-node –version[/bg_collapse]
 
22. Which of the following is true about console global object ?

  1. Console is used in synchronous way when destination is file or a terminal.
  2. There are built-in methods to be used for printing informational, warning and error messages in console.
  3. Console is used in asynchronous way when destination is a pipe.
  4. All of the above.

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is D- All fo the above.[/bg_collapse]
 
23. Where can we use node.js ?

  1. Web applications ( especially real-time web apps )
  2. Network applications
  3. Distributed systems
  4. All of the above

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is D-All of the above.[/bg_collapse]
 
24. Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine. ?

  1. True
  2. False

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is A-True.[/bg_collapse]
 
25. Is it possible to evaluate simple expressions using Node REPL ?

  1. Yes
  2. No

[bg_collapse view=”button-green” color=”#FFF” icon=”arrow” expand_text=”Show Answer” collapse_text=”Hide Answer” ]Correct answer is A- Yes. You can evaluate simple expressions using Node REPL.[/bg_collapse]