0% found this document useful (0 votes)
36 views

Node - Js Online Quiz

Uploaded by

Akshay Vanjeri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Node - Js Online Quiz

Uploaded by

Akshay Vanjeri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

11/5/24, 4:30 PM Node.

js Online Quiz

Node.js Online Quiz


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 - Why code written in Node.JS is pretty fast although being written in


JavaScript?

A - Node.JS internally converts JavaScript code to Java based code and then
execute the same.

B - Node.JS internally converts JavaScript code to C based code and then execute
the same.

C - Being built on Google Chrome's V8 JavaScript Engine.

D - None of the above.

Answer : C

Explanation
Being built on Google Chrome's V8 JavaScript Engine, Node.js library is very fast
in code execution.

Q 2 - What is Callback?

https://www.tutorialspoint.com/nodejs/nodejs_online_quiz.htm 1/6
11/5/24, 4:30 PM Node.js Online Quiz

A - Callback is an asynchronous equivalent for a function.

B - Callback is a technique in which a method call back the caller method.

C - Both of the above.

D - None of the above.

Answer : A

Explanation
Callback is an asynchronous equivalent for a function.

Q 3 - Which of the following is true about writable stream?

A - writable stream is used for write operation.

B - Output of readable stream can be input to a writable stream.

C - Both of the above.

D - None of the above.

Answer : C

Explanation
Writable stream is used for write operation and it can take output of readable
stream as input.

Q 4 - Which of the following is true about File I/O in Node applications?

A - Node implements File I/O using simple wrappers around standard POSIX
functions.

B - Node File System (fs) module should be imported for File I/O opearations.

https://www.tutorialspoint.com/nodejs/nodejs_online_quiz.htm 2/6
11/5/24, 4:30 PM Node.js Online Quiz

C - Both of the above.

D - None of the above.

Answer : C

Explanation
Node implements File I/O using simple wrappers around standard POSIX
functions. Node File System (fs) module should be imported for File I/O
opearations.

Q 5 - Which method of fs module is used to read a directory?

A - fs.readDirectory(path[, mode], callback)

B - fs.read(path[, mode], callback)

C - fs.readdir(path, callback)

D - None of the above.

Answer : C

Explanation
fs.readdir(path, callback)is the method which is used to read a directory.

Q 6 - Which of the following code print the name of operating system?

A - console.log('type : ' + os.type);

B - console.log('type : ' + os.type());

C - console.log('type : ' + os.getType());

D - None of the above.

https://www.tutorialspoint.com/nodejs/nodejs_online_quiz.htm 3/6
11/5/24, 4:30 PM Node.js Online Quiz

Answer : B

Explanation
os.type() returns the operating system name.

Q 7 - Which of the following code print the total system memory of operating
system?

A - console.log('total memory : ' + os.totalmem() + " bytes.");

B - console.log('total memory : ' + os.totalmem + " bytes.");

C - console.log('total memory : ' + os.getTotalMemory() + " bytes.");

D - None of the above.

Answer : A

Explanation
os.totalmem() returns the total amount of system memory in bytes.

Q 8 - Which of the following stands true for dns.lookup(hostname[, options],


callback) method?

A - Resolves a hostname (e.g. 'google.com') into the first found A (IPv4) or AAAA
(IPv6) record.

B - 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.

C - Both of the above.

D - None of the above.

Answer : C

https://www.tutorialspoint.com/nodejs/nodejs_online_quiz.htm 4/6
11/5/24, 4:30 PM Node.js Online Quiz

Explanation
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 - What is Express?

A - Express is a application framework that provides a robust set of features to


develop desktop based applications.

B - Express is a minimal and flexible Node.js web application framework that


provides a robust set of features to develop web and mobile applications.

C - Both of the above.

D - None of the above.

Answer : B

Explanation
Express is a minimal and flexible Node.js web application framework that provides
a robust set of features to develop web and mobile applications.

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.

A - true

B - false

Answer : A

Explanation

https://www.tutorialspoint.com/nodejs/nodejs_online_quiz.htm 5/6
11/5/24, 4:30 PM Node.js Online Quiz

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.

New Quiz

https://www.tutorialspoint.com/nodejs/nodejs_online_quiz.htm 6/6

You might also like