Node JS/Nodejs Mcq Question Set 2 Sample Test,Sample questions

Question:
 How can we check the cujrrent version of NPM?

1.npm --version

2. npm --ver

3.npm help

4.none of the above


Question:
 How can we create instance of http module ?

1. var http = require("http");

2. var http = new require("http");

3. var http = new http();

4.none of the above


Question:
 In Node.js APIs of Node.JS are which of the following?

1.Asynchronous

2.Synchronous

3.Both of the above

4.none of the above


Question:
 Node.js uses _______ programming.

1.asynchronous

2. synchronous

3.Both A and B

4.none of the above


Question:
 The $ npm ls -g statement is used to list down all the locally installed module?

1.True

2.False

3.all of the above

4.none of the above


Question:
 What are the key features of Node.js?

1.Real time Data intensive

2.Highly scalable servers for Web Applications

3.Builds fast and scalable network Applications

4.All of the above


Question:
 What should you do in your code to improve your application's performance?

1.Use gzip compression

2.Don't use synchronous functions

3. Do logging correctly

4. Handle exceptions properly


Question:
 Which method to create an HTTP server?

1.createServer()

2.getServer()

3.putServer()

4.setServer()


Question:
 Which of following are a valid form of route path?

1. strings

2.string patterns

3.regular expressions

4.all of above


Question:
 Which of the following class is used to create and consume custom events in Node.js?

1.EventEmitter

2. Events

3.NodeEvent

4.none of the above


Question:
A package in Node.js contains all the files you need for a module.

1.TRUE

2.FALSE

3.Can be true or false

4.Can not say


Question:
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.

1.false

2.true

3. All the above

4. None of these


Question:
Find output of the following program ? 
                                                                          
  $ node
>  15 + ( 2 * 4 ) - 8


                                                

1. 15

2.Error

3.undefined

4.none of the above


Question:
Guess the output of the following program ? 
                                                                          
  $ node
> var k=10
undefined
> y=10
10
> k+y

1. Error

2.20

3. undefined

4.none of the above


Question:
How can we check the current version of NPM?

1.. npm --version

2.npm --ver

3.npm help

4. None of the above


Question:
In Nodejs what is use of underscore variable in REPL session?

1. to store the result

2. to get the last command used

3.None of the above

4.to get the last result


Question:
Is console a global object?

1.null

2.false

3.true

4.none of the above


Question:
Node.js files have extension?

1..njs

2..node

3. .js

4..nj


Question:
Node.js files must be initiated in the?

1.Command Prompt

2.nodejs Editor

3.Both A and B

4.none of the above


Question:
Node.js has a built-in module called?

1.https

2.http

3. server

4.module


Question:
Node.js runs?

1.single-threaded

2.non-blocking

3.asynchronously programming

4.All of the above


Question:
Node.js supports which of the following platform?

1.Windows

2.Macintosh

3.. Unix/Linux

4.All of the above


Question:
package.json is is used to define the properties of a package?

1.True

2.False

3.all of the above

4.none of the above


Question:
Syntax to Initiate the Node.js File is?

1. filename.js

2. javascript filename.js

3.node filename.js

4.node filename


Question:
The $ npm ls statement is used to list down all the locally installed module?

1. True

2.False

3.all of the above

4.none of the above


Question:
The fs.read() method is used to read files on your computer.

1.TRUE

2. FALSE

3. Can be true or false

4.Can not say


Question:
The URL module splits up a web address into readable parts.

1.TRUE

2. FALSE

3.Can be true or false

4.Can not say


Question:
To include a module, use the _______ function with the name of the module.

1. function()

2. require()

3.exports()

4. module()


Question:
To install Node.js express module

1.$ npm install express

2. $ node install express

3.$ install express

4.None of above


Question:
What is REPL in Node.js?

1.Eval

2.Print

3. Loop

4. All of these


Question:
What is the advantage of using node.js?

1.It provides an easy way to build scalable network programs

2.Generally fast

3.All of these

4.Great concurrency


Question:
What would be the output of the below code ? 
                                                                          
  $ node
>  y = 10

1. 10

2. Error

3.undefined

4.none of the above


Question:
What would be the output of the below code ? 
                                                                          
  $ node
> var y = 10

1.10

2.Error

3.undefined

4.none of the above


Question:
What would be the output of the below code ? 
                                                                          
  var http = require("http");
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Welcome to the nodejs
');
}).listen(8083);
console.log('Server running at http://127.0.0.1:8083/');

1.Welcome to the nodejs

2.Error

3.Server running at http://127.0.0.1:8083/

4.none of the above


Question:
Which keyword is used to make properties and methods available outside the module file?

1. import

2.module

3.exports

4.require


Question:
Which method appends specified content to a file.

1.fs.appendFile()

2.fs.open()

3.fs.writeFile()

4.none of the above


Question:
Which module is used to serve static resources in Node.js?

1.node-static

2.http

3.node-resource

4. static


Question:
which of the following areas, Node.js is not advised to be used?

1.Single Page Applications

2.JSON APIs based Applications

3.CPU intensive applications

4.Data Intensive Realtime Applications (DIRT)


Question:
Which of the following command will show version of Node?

1. $ npm --version

2. $ npm getVersion

3. $ node getVersion

4. $ node --version


Question:
Which of the following is false?

1.Node.js can create, open, read, write, delete, and close files on the server

2.Node.js can generate static page content

3.Node.js can collect form data

4.Node.js can add, delete, modify data in your database


Question:
Which of the following is true about Node.js?

1. Node.js is an open source server environment.

2.Node.js allows you to run JavaScript on the server.

3.Node.js runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)

4.All of the above


Question:
Which of the following is true about process global object?

1.The process object is an instance of EventEmitter.

2.process emits exit event when process is about to exit.

3.process emits uncaughtException when when an exception bubbles all the way back to the event loop.

4.All of the above


Question:
Which of the following statements holds good with respect to Node?

1.Node being a single thread, and uses async function calls to maintain the concurrency

2.Every API of Node js are asynchronous

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

4.All of these


Question:
Which of the following tool automates various tasks of Node.js application?

1.Express.js

2.GruntJS

3.NPM

4.none of the above


Question:
Which of the followings are valid languages for Node.js?

1.JavaScript

2.Java

3.C++

4.C#


Question:
Which statement execute the code of sample.js file?

1.nodejs sample.js

2.node sample.js

3. sample.js

4.none of the above


Question:
Which statement is valid in using a Node module fs in a Node based application?

1. var fs = import("fs")

2.import fs

3. package fs

4.var fs = require("fs")


Question:
Why a Node.JS code is pretty fast although being written in JavaScript?

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

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

3.Being built on Google Chrome's V8 JavaScript Engine

4.none of the above


More MCQS

  1. Nodejs Mcq Question Set 1
  2. Nodejs Mcq Question Set 2
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!