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

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.

 
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

Correct answer is C-Both of the above

 
3. A stream fires finish event when all data has been flushed to underlying system.?

  1. True
  2. False

 Correct answer is True

 
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

Correct answer is D-All of the above.

 
5. Node.js uses an event-driven, non-blocking I/O model ?

  1. True
  2. False

Correct answer is A-True.

 
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.

Correct answer is D

 



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.

Correct answer is C- Both of the above.

 
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.

Correct asnwer is C-Both of the above.

 
9. Is Node.js free to use?

  1. Yes
  2. No

Correct answer is A-Yes its absolutely free to use.

 
10. Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world. ?

  1. True
  2. False

Correct answer is A-True.




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.

Correct answer is A-Asynchronous

 
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.

Correct answer is B- fs.open(path, flags[, mode], callback) is the method which is used to open a file.

 
13. In Nodejs net.isIP(input) returns 6 for IP version 6 addresses.?

  1. False
  2. True

Correct answer is B-True

 
14. Is Node a single threaded application ?

  1. Yes
  2. No

Correct answer is A-Yes Node a single threaded application

 
15. Node.js is a single-threaded application, but it can support concurrency via the concept of event and callbacks. ?

  1. True
  2. False

Correct answer is A-True

 
16. Node js is a single thread application but it my or can support concurrency. ?

  1. True
  2. False

Correct answer is A- True

 
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.

Correct answer is C-Both of the above.




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.

Correct answer is B-Path module.

 
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

Correct answer is D-All of the above.

 
20. From the following which are Node.js streams types ?

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

Correct answer is D-All of the above.

 
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

Correct answer is C-node –version

 
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.

Correct answer is D- All fo the above.

 
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

Correct answer is D-All of the above.

 
24. Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine. ?

  1. True
  2. False

Correct answer is A-True.

 
25. Is it possible to evaluate simple expressions using Node REPL ?

  1. Yes
  2. No

Correct answer is A- Yes. You can evaluate simple expressions using Node REPL.