- Node.js Tutorial
- Node.js - Home
- Node.js - Introduction
- Node.js - Environment Setup
- Node.js - First Application
- Node.js - REPL Terminal
- Node.js - Package Manager (NPM)
- Node.js - Callbacks Concept
- Node.js - Event Loop
- Node.js - Event Emitter
- Node.js - Buffers
- Node.js - Streams
- Node.js - File System
- Node.js - Global Objects
- Node.js - Utility Modules
- Node.js - Web Module
- Node.js - Express Framework
- Node.js - RESTFul API
- Node.js - Scaling Application
- Node.js - Packaging
- Node.js - Built-in Modules
- Node.js Useful Resources
- Node.js - Quick Guide
- Node.js - Useful Resources
- Node.js - Dicussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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.
Answer : C
Explanation
Being built on Google Chrome's V8 JavaScript Engine, Node.js library is very fast in code execution.
Q 2 - Which of the following command will show version of npm?
Answer : A
Explanation
Executing $ npm --version command will show the version of npm instance.
Q 3 - Which of the following code converts a buffer buf to JSON object?
Answer : A
Explanation
buf.toJSON() converts a buffer buf to JSON object.
Q 4 - Which of the following is true about Piping streams?
A - Piping is a mechanism where we provide output of one stream as the input to another stream.
Answer : D
Explanation
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 remove a directory?
A - fs.deleteDirectory(path[, mode], callback)
Answer : B
Explanation
fs.rmdir(path, callback) is the method which is used to remove 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());
Answer : B
Explanation
os.type() returns the operating system name.
Q 7 - Which of the following is the correct way to get an absolute path?
Answer : B
Explanation
path.resolve([from ...], to) resolves to an absolute path.
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 code can create a web server?
A - http.createServer(callback)
B - http.createWebServer(callback)
Answer : A
Explanation
http.createServer(callback) method can be used to create a web server.
Answer : A
Explanation
A stream fires end event when there is no more data to read.