Node JS Quiz
1. In Nodejs how node based web servers differ from traditional web servers ?
- 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.
- Node based server process request much faster than traditional server.
- There is no much difference between the two.
- 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 ?
- Output of readable stream can be input to a writable stream.
- writable stream is used for write operation.
- Both of the above.
- 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.?
- True
- 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 ?
- Real time Data intensive.
- Highly scalable servers for Web Applications.
- Builds fast and scalable network Applications.
- 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 ?
- True
- 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?
- to store the result.
- to get the last command used.
- None of the above.
- 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 ?
- Chanining is a mechanism to connect output of one stream to another stream and create a chain of multiple stream operations.
- Chanining is normally used with piping operations.
- Both of the above.
- 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. ?
- The fork method returns object with a built-in communication channel in addition to having all the methods in a normal ChildProcess instance.
- The fork() method method is a special case of the spawn() to create Node processes.
- Both of the above.
- 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?
- Yes
- 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. ?
- True
- 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 .?
- Asynchronous
- Synchronous
- Both of the above.
- 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 ?
- fs.openFile(path, flags[, mode], callback)
- fs.open(path, flags[, mode], callback)
- fs.openPath(path, flags[, mode], callback)
- 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.?
- False
- 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 ?
- Yes
- 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. ?
- True
- 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. ?
- True
- 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 ?
- Global objects are global in nature and they are available in all modules.
- Global objects are nore required to be included in application, rather they can be used directly.
- Both of the above.
- 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 ?
- Os module
- Path module
- Fs module
- 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?
- I/O operations
- Heavy computation
- Anything requiring blocking
- 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 ?
- Writable
- Duplex
- Readable
- 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 ?
- node getVersion
- $ npm –version
- % node –version
- 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 ?
- Console is used in synchronous way when destination is file or a terminal.
- There are built-in methods to be used for printing informational, warning and error messages in console.
- Console is used in asynchronous way when destination is a pipe.
- 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 ?
- Web applications ( especially real-time web apps )
- Network applications
- Distributed systems
- 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. ?
- True
- 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 ?
- Yes
- 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]