- 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 - What is Callback?
A - Callback is an asynchronous equivalent for a function.
B - Callback is a technique in which a method call back the caller method.
Answer : A
Explanation
Callback is an asynchronous equivalent for a function.
Answer : A
Explanation
True! Node js is a single threaded application but it support concurrency via concept of event and callbacks.
Q 4 - Which method of fs module is used to close a file?
B - fs.closeFile(fd, callback)
Answer : A
Explanation
fs.close(fd, callback) is the method which is used to close a file.
Q 5 - Which of the following is true about __filename global object?
A - The __filename represents the filename of the code being executed.
B - The __filename represents the resolved absolute path of code file.
Answer : C
Explanation
The __filename represents the filename of the code being execute
Q 6 - Which of the following code print the endianness of operating system?
A - console.log('endianness : ' + os.endianness);
B - console.log('endianness : ' + os.endianness());
Answer : B
Explanation
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 an extension of a file?
Answer : B
Explanation
path.extname(p) returns the extension of the path, from the last '.' to end of string in the last portion of the path. If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.
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.
Answer : C
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.
Answer : A
Explanation
Node facilitates creation of child processes to leverage parallel processing on multi-core cpu based systems.
Answer : A
Explanation
Duplex stream can be used for both read and write operation.