Node | Fresco Play

Node | Fresco Play

Monday, May 22, 2023
~ 5 min read
Node | Fresco Play

Question 1: Which of the following is true about Node.JS?

Answer: All the options


Question 2: REPL stands for?

Answer: Read Eval Print Loop


Question 3: How Node based web servers are different from traditional web servers?

Answer: Node based server uses a single threaded model and can services much larger number of requests than traditional server like Apache HTTP Server.


Question 4: What is Node.JS?

Answer: Node.js is a JavaScript based framework/platform built on Google Chrome's JavaScript V8 Engine.


Question 5: What is use of Underscore Variable in REPL session?

Answer: to get the last result.


Question 6: Print the directory name of your script using the pre defined global object?

Answer: console.log( __dirname );


Question 7: Print the relative path of your script using the pre defined global object?

Answer: console.log( __filename );


Question 8: Which of the following is true about __dirname global object? (I) The __dirname represents the name of the directory that the currently executing script resides in. (II) The __dirname represents the resolved absolute path of code file

Answer: I


Question 9: Which of the following command will show all the modules installed globally?

Answer: $ npm ls -g


Question 10: Which of the following command will show all the modules installed locally?

Answer: $ npm ls


Question 11: Which of the following is true about EventEmitter.on property?

Answer: on property is used to bind a function with the event.


Question 12: Which of the following statement is valid to use a Node module http in a Node based application?

Answer: var http = require("http");


Question 13: Which method of fs module is used to close a file?

Answer: fs.close(fd, callback)


Question 14: Which of the following is true about EventEmitter.emit property?

Answer: emit property is used to fire an event.


Question 15: Which method of fs module is used to write a file?

Answer: fs.writeFile(path, flags[, mode], callback)


Question 16: Which method of fs module is used to truncate a file?

Answer: fs.ftruncate(fd, len, callback)


Question 17: Each type of Stream is an EventEmitter?

Answer: True


Question 18: A stream fires end event when there is no more data to read. Is this correct ?

Answer: True


Question 19: A stream fires data event when there is data available to read.

Answer: True


Question 20: Which of the following is true about writable stream? (I) writable stream is used for write operation. (II) Output of readable stream can be input to a writable stream.

Answer: I & II


Question 21: Which of the following is true about Piping streams?

Answer: All the options


Question 22: Which of the following is true about readable stream? (I) Readable stream is used for read operation. (II) Output of readable stream can be input to a writable stream.

Answer: Both


Question 23: Which of the following command will show version of Node?

Answer: $ node --version


Question 24: Which of the following provides in-built events?

Answer: events


Question 25: Which of the following is true about __filename global object? (I) The __filename represents the filename of the code being executed. (II) The __filename represents the resolved absolute path of code file.

Answer: I & II


Question 26: Which of the following is true about RESTful webservices? (I) Webservices based on REST Architecture are known as RESTful web services. (II) Webservices uses HTTP methods to implement the concept of REST architecture.

Answer: I & II


Question 27: Can we create child processes in Node applications

Answer: True


Question 28: Which of the following code can make a request to a web server?

Answer: http.request(options, callback)


Question 29: Which of the following is true about setTimeout(cb, ms) global function? (I) The setTimeout(cb, ms) global function is used to run callback cb after at least ms milliseconds. (II) The setTimeout(cb, ms) function returns an opaque value that represents the timer which can be used to clear the timer.

Answer: both


Question 30: Which of the following is true about console global object?

Answer: All the options


Question 31: Which of the following is true about File I/O in Node applications? (I) Node implements File I/O using simple wrappers around standard POSIX functions. (II) Node File System (fs) module should be imported for File I/O operations.

Answer: I & II


Question 32: Which of the following module is required for operating system specific operations?

Answer: os module


Post a comment

Comments

Join the conversation and share your thoughts! Leave the first comment.

Get your FREE PDF on "100 Ways to Try ChatGPT Today"

Generating link, please wait for: 60 seconds

Checkout all hot deals now 🔥

Search blogs

No blog posts found