Node Js(Engineering > Computer Science And Engineering ) Questions and Answers
Question 1. Which of following are a valid form of route path?
strings
string patterns
regular expressions
All of above
Explanation:-
Answer: Option D. -> All of above
Question 2. Which of the following statements holds good with respect to Node?
Node being a single thread, and uses async function calls to maintain the concurrency
Every API of Node js are asynchronous
Node thread keeps an event loop and whenever any task get completed, it fires the corresponding event which signals the event listener function to get executed
All of these
Explanation:-
Answer: Option A. -> Node being a single thread, and uses async function calls to maintain the concurrency
Question 3. 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
Explanation:-
Answer: Option D. -> to get the last result
Question 4. Which statement is valid in using a Node module fs in a Node based application?
var fs = import("fs")
import fs
package fs
var fs = require("fs")
Explanation:-
Answer: Option A. -> var fs = import("fs")
Question 5. Child processes always have three streams child.stdin, child.stdout, and child.stderr which may be shared with the stdio streams of the parent process.
false
true
All the above
None
Explanation:-
Answer: Option A. -> false
Question 6. Which of the following is true about RESTful web services?
Webservices based on REST Architecture are known as RESTful web services
Webservices uses HTTP methods to implement the concept of REST architecture
Both of the above
None of the above
Explanation:-
Answer: Option C. -> Both of the above
Question 7. 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
Explanation:-
Answer: Option A. -> 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.
Question 8. The Node.js modules can be exposed using
module.expose
module
module.exports
All of the above
Explanation:-
Answer: Option C. -> module.exports
Question 9. Which statement executes the code of sample.js file?
nodejs sample.js
node sample.js
sample.js
None of the above
Explanation:-
Answer: Option B. -> node sample.js
Question 10. What are the key features of Node.js?