Following quiz provides Multiple Choice Questions (MCQs) related to Node.js Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - All APIs of Node.JS are.
All APIs of Node.js library are aynchronous that is non-blocking.
Q 2 - What is Callback?
Callback is an asynchronous equivalent for a function.
Q 3 - Which of the following is true about EventEmitter.emit property?
emit property is used to fire an event.
Q 4 - Which of the following is true about Piping streams?
Piping is a mechanism where we provide output of one stream as the input to another stream. It is normally used to get data from one stream and to pass output of that stream to another stream. There is no limit on piping operations.
Q 5 - Which method of fs module is used to read a directory?
fs.readdir(path, callback)is the method which is used to read a directory.
Q 6 - Which of the following code print the endianness of operating system?
os.endianness() returns the endianness of the CPU. Possible values are "BE" or "LE".
Q 7 - Which of the following is the correct way to get a normalized path?
path.normalize(p) normalizes a string path, taking care of '..' and '.' parts.
Q 8 - Which of the following method resolves an ip address to an array of hostnames?
dns.reverse(ip, callback) resolves an ip address to an array of hostnames.
Q 9 - Which of the following is true about exec methd of child_process module.
child_process.exec method runs a command in a shell and buffers the output. It returns a buffer with a max size and waits for the process to end and tries to return all the buffered data at once.
Duplex stream can be used for both read and write operation.