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
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
3. A stream fires finish event when all data has been flushed to underlying system.?
- True
- False
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
5. Node.js uses an event-driven, non-blocking I/O model ?
- True
- False
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.
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.
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.
9. Is Node.js free to use?
- Yes
- No
10. Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world. ?
- True
- False
11. In Node.js APIs of Node.JS are which of the following .?
- Asynchronous
- Synchronous
- Both of the above.
- None of the above.
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.
13. In Nodejs net.isIP(input) returns 6 for IP version 6 addresses.?
- False
- True
14. Is Node a single threaded application ?
- Yes
- No
15. Node.js is a single-threaded application, but it can support concurrency via the concept of event and callbacks. ?
- True
- False
16. Node js is a single thread application but it my or can support concurrency. ?
- True
- False
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.
18. Which of the following module is required for path specific operations ?
- Os module
- Path module
- Fs module
- None of the above.
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
20. From the following which are Node.js streams types ?
- Writable
- Duplex
- Readable
- All of the above
21. In node.js from the following which command will show version of node ?
- node getVersion
- $ npm –version
- % node –version
- node –version
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.
23. Where can we use node.js ?
- Web applications ( especially real-time web apps )
- Network applications
- Distributed systems
- All of the above
24. Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine. ?
- True
- False
25. Is it possible to evaluate simple expressions using Node REPL ?
- Yes
- No