
- Node.js - Home
- Node.js - Introduction
- Node.js - Environment Setup
- Node.js - First Application
- Node.js - REPL Terminal
- Node.js - Command Line Options
- Node.js - Package Manager (NPM)
- Node.js - Callbacks Concept
- Node.js - Upload Files
- Node.js - Send an Email
- Node.js - Events
- Node.js - Event Loop
- Node.js - Event Emitter
- Node.js - Debugger
- Node.js - Global Objects
- Node.js - Console
- Node.js - Process
- Node.js - Scaling Application
- Node.js - Packaging
- Node.js - Express Framework
- Node.js - RESTFul API
- Node.js - Buffers
- Node.js - Streams
- Node.js - File System
- Node.js MySQL
- Node.js - MySQL Get Started
- Node.js - MySQL Create Database
- Node.js - MySQL Create Table
- Node.js - MySQL Insert Into
- Node.js - MySQL Select From
- Node.js - MySQL Where
- Node.js - MySQL Order By
- Node.js - MySQL Delete
- Node.js - MySQL Update
- Node.js - MySQL Join
- Node.js MongoDB
- Node.js - MongoDB Get Started
- Node.js - MongoDB Create Database
- Node.js - MongoDB Create Collection
- Node.js - MongoDB Insert
- Node.js - MongoDB Find
- Node.js - MongoDB Query
- Node.js - MongoDB Sort
- Node.js - MongoDB Delete
- Node.js - MongoDB Update
- Node.js - MongoDB Limit
- Node.js - MongoDB Join
- Node.js Modules
- Node.js - Modules
- Node.js - Built-in Modules
- Node.js - Utility Modules
- Node.js - Web Module
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 1Which of following command starts a REPL session?
Answer : A
Explanation
REPL can be started by simply running node on shell/console without any argument.
Q 2 - Which of the following command will show version of Node?
Answer : B
Explanation
Executing $ node --version command will show the version of Node instance.
Q 3 - Which of the following is true about readable stream?
A - Readable stream is used for read operation.
B - Output of readable stream can be input to a writable stream.
Answer : C
Explanation
Readable stream is used for read operation and its output can be input to a writable stream.
Q 4 - Which of the following is true about fs module of Node?
A - Every method in fs module have synchronous as well as asynchronous form.
Answer : C
Explanation
Every method in fs module have synchronous as well as asynchronous form. Asynchronous methods of fs module take last parameter as completion function callback and first parameter of the callback function as error.
Q 5 - Which of the following is true about __dirname global object?
B - The __dirname represents the resolved absolute path of code file.
Answer : A
Explanation
The __dirname represents the name of the directory that the currently executing script resides in.
Q 6 - Which of the following code prints memory usage?
A - console.log(process.memoryUsage());
B - console.log('Current version: ' + process.memory());
Answer : A
Explanation
process.memoryUsage() can be used to get the memory usage.
Q 7 - Which of the following API creates a server?
A - net.createServer([options][, connectionListener])
B - net.connect(options[, connectionListener])
Answer : A
Explanation
net.createServer([options][, connectionListener]) creates a new TCP server. The connectionListener argument is automatically set as a listener for the 'connection' event.
Answer : A
Explanation
net.isIP(input) tests if input is an IP address. Returns 0 for invalid strings, returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses.
Q 9 - Which of the following is true about exec methd of child_process module.
A - The exec() method runs a command in a shell and buffers the output.
Answer : D
Explanation
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 - A stream fires error event when there is any error receiving or writing data.
Answer : B
Explanation
A stream fires error event when there is any error receiving or writing data.