- 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 Mock Test
This section presents you various set of Mock Tests related to Node.js Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Node.js Mock Test I
Q 1 - Which of the following is true about Node.JS?
A - Node.js is a JavaScript based framework/platform built on Google Chrome's JavaScript V8 Engine.
Answer : D
Explanation
Node.js is a very powerful JavaScript based framework/platform built on Google Chrome's JavaScript V8 Engine. It is used to delevop I/O intensive web applications like video streaming sites, single page applications and other web application. Node.js is open source, completely free, and used by thousands of developers around the world.
Q 2 - What is Node.JS?
B - Node.js is a JavaScript based framework/platform built on Google Chrome's JavaScript V8 Engine.
Answer : B
Explanation
Node.js is a JavaScript based framework/platform built on Google Chrome's JavaScript V8 Engine.
Q 3 - All APIs of Node.JS are.
Answer : A
Explanation
All APIs of Node.js library are aynchronous that is non-blocking.
Q 4 - 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 5 - How Node based web servers are different from traditional web servers?
A - Node based server process request much faster than traditional server.
Answer : B
Explanation
Node based server uses a single threaded model and can services much larger number of requests than traditional server like Apache HTTP Server.
Q 6 - In which of the following areas, Node.js is perfect to use?
B - Data Streaming Applications
Answer : D
Explanation
Node.js is proving itself a perfect technology partner for all of the above mentioned areas.
Q 7In which of the following areas, Node.js is not advised to be used?
B - JSON APIs based Applications
Answer : C
Explanation
It is not advisable to use Node.js for CPU intensive applications.
Q 8 - Which of the following statement is valid to use a Node module http in a Node based application?
A - var http = require("http");
Answer : A
Explanation
Require directive is used to load a Node module(http) and store returned its instance(http) into its variable(http).
Q 9REPL stands for.
Answer : B
Explanation
REPL stands for Read Eval Print Loop and it represents a computer environment like a window console or Unix/Linux shell where a command is entered and system responds with an output in interactive mode.
Q 10Which 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 11 - What is use of Underscore Variable in REPL session?
Answer : B
Explanation
You can use undercore _ to get the last result.
Q 12 -What npm stands for?
Answer : A
Explanation
npm stands for Node Package Manager.
Q 13 - 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 14 - Which of the following command will show version of npm?
Answer : A
Explanation
Executing $ npm --version command will show the version of npm instance.
Answer : A
Explanation
By default, npm installs any dependency in the local mode.
Answer : B
Explanation
By default, npm installs any dependency in the local mode.
Q 17 - Which of the following command will show all the modules installed globally?
Answer : A
Explanation
Executing $ npm ls -g command will show all the modules installed globally.
Q 18 - Which of the following command will show all the modules installed locally.
Answer : B
Explanation
Executing $ npm ls command will show all the modules installed locally.
Q 19 - Which of the following is true about package.json?
A - package.json is present in the root directory of any Node application/module.
B - package.json is used to define the properties of a package.
C - package.json can be used to update dependencies of a Node application.
Answer : D
Explanation
package.json is present in the root directory of any Node application/module and is used to define the properties of a package. It can also be used to update dependencies of a Node application.
Q 20 - 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 22 - Which of the following is true with respect to Node.
A - Every API of Node js are asynchronous.
B - Node being a single thread, and uses async function calls to maintain the concurrency.
Answer : D
Explanation
Node js is a single threaded application but it support concurrency via concept of event and callbacks. As every API of Node js are asynchronous and being a single thread, it uses async function calls to maintain the concurrency. Node uses observer pattern. Node thread keeps an event loop and whenever any task get completed, it fires the corresponding event which signals the event listener function to get executed.
Q 23 - Which of the following provides in-built events.
Answer : A
Explanation
Node has multiple in-built events available through events module.
Q 24 - Which of the following is true about EventEmitter.on property?
A - on property is used to fire event.
B - on property is used to bind a function with the event.
Answer : B
Explanation
on property is used to bind a function with the event.
Q 25 - Which of the following is true about EventEmitter.emit property?
A - emit property is used to locate an event handler.
B - emit property is used to bind a function with the event.
Answer : C
Explanation
emit property is used to fire an event.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | B |
3 | A |
4 | C |
5 | B |
6 | D |
7 | C |
8 | A |
9 | B |
10 | A |
11 | B |
12 | A |
13 | B |
14 | A |
15 | A |
16 | B |
17 | A |
18 | B |
19 | D |
20 | A |
21 | A |
22 | B |
23 | A |
24 | B |
25 | C |