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 - Which of the following is true about Node.JS?
By default, npm installs any dependency in the local mode.
Q 3 - Which of the following is true about EventEmitter.emit property?
emit property is used to fire an event.
Q 4 - Which method of fs module is used to open a file?
fs.open(path, flags[, mode], callback) is the method which is used to open a file.
Q 5 - Which of the following is true about setInterval(cb, ms) global function?
The setInterval(cb, ms) global function is used to run callback cb repeatedly after at least ms milliseconds. The actual delay depends on external factors like OS timer granularity and system load. - A timer cannot span more than 24.8 days. This function returns an opaque value that represents the timer which can be used to clear the timer using the function clearInterval(t).
Q 6 - Which of the following code prints process version?
process.version can be used to get the current process version.
Q 7 - Which of the following code print the total free memory of operating system?
os.freemem() returns the free amount of system memory in bytes.
Q 8 - Which of the following stands true for dns.lookup(hostname[, options], callback) method?
dns.lookup(hostname[, options], callback) resolves a hostname (e.g. 'google.com') into the first found A (IPv4) or AAAA (IPv6) record. options can be an object or integer. If options is not provided, then IP v4 and v6 addresses are both valid. If options is an integer, then it must be 4 or 6.
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.
Q 10 - 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.
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.