Node Js(Engineering > Computer Science And Engineering ) Questions and Answers

Question 1. Which of following are a valid form of route path?
  1.    strings
  2.    string patterns
  3.    regular expressions
  4.    All of above
Explanation:-
Answer: Option D. -> All of above





Question 2. Which of the following statements holds good with respect to Node?
  1.    Node being a single thread, and uses async function calls to maintain the concurrency
  2.    Every API of Node js are asynchronous
  3.    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
  4.    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?
  1.    to store the result
  2.    to get the last command used
  3.    None of the above
  4.    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?
  1.    var fs = import("fs")
  2.    import fs
  3.    package fs
  4.    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.
  1.    false
  2.    true
  3.    All the above
  4.    None
Explanation:-
Answer: Option A. -> false





Question 6. Which of the following is true about RESTful web services?
  1.    Webservices based on REST Architecture are known as RESTful web services
  2.    Webservices uses HTTP methods to implement the concept of REST architecture
  3.    Both of the above
  4.    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?
  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
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
  1.    module.expose
  2.    module
  3.    module.exports
  4.    All of the above
Explanation:-
Answer: Option C. -> module.exports





Question 9. Which statement executes the code of sample.js file?
  1.    nodejs sample.js
  2.    node sample.js
  3.    sample.js
  4.    None of the above
Explanation:-
Answer: Option B. -> node sample.js





Question 10. 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
Explanation:-
Answer: Option D. -> All of the above