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

Posted Date:-2022-01-22 06:24:15


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

Posted Date:-2022-01-22 06:23:24


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

Posted Date:-2022-01-22 05:35:18


Question:
 Node.js uses _______ programming.

1.asynchronous

2. synchronous

3.Both A and B

4.none of the above

Posted Date:-2022-01-22 05:44:57


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

Posted Date:-2022-01-22 06:23:50


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

Posted Date:-2022-01-22 05:28:49


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

Posted Date:-2022-01-22 05:32:56


Question:
 Which method to create an HTTP server?

1.createServer()

2.getServer()

3.putServer()

4.setServer()

Posted Date:-2022-01-22 05:52:30


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

1. strings

2.string patterns

3.regular expressions

4.all of above

Posted Date:-2022-01-22 05:36:58


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

Posted Date:-2022-01-22 05:35:42


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

Posted Date:-2022-01-22 06:08:56


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

Posted Date:-2022-01-22 05:38:39


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


                                                

1. 15

2.Error

3.undefined

4.none of the above

Posted Date:-2022-01-22 06:26:48


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

Posted Date:-2022-01-22 06:27:10


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

1.. npm --version

2.npm --ver

3.npm help

4. None of the above

Posted Date:-2022-01-22 05:29:34


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

Posted Date:-2022-01-22 05:37:52


Question:
Is console a global object?

1.null

2.false

3.true

4.none of the above

Posted Date:-2022-01-22 05:33:20


Question:
Node.js files have extension?

1..njs

2..node

3. .js

4..nj

Posted Date:-2022-01-22 05:50:38


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

Posted Date:-2022-01-22 05:41:42


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

1.https

2.http

3. server

4.module

Posted Date:-2022-01-22 05:52:06


Question:
Node.js runs?

1.single-threaded

2.non-blocking

3.asynchronously programming

4.All of the above

Posted Date:-2022-01-22 05:51:03


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

1.Windows

2.Macintosh

3.. Unix/Linux

4.All of the above

Posted Date:-2022-01-22 05:36:27


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

Posted Date:-2022-01-22 06:25:11


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

1. filename.js

2. javascript filename.js

3.node filename.js

4.node filename

Posted Date:-2022-01-22 05:42:08


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

Posted Date:-2022-01-22 06:24:52


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

Posted Date:-2022-01-22 06:09:20


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

Posted Date:-2022-01-22 05:44:17


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

1. function()

2. require()

3.exports()

4. module()

Posted Date:-2022-01-22 05:51:40


Question:
To install Node.js express module

1.$ npm install express

2. $ node install express

3.$ install express

4.None of above

Posted Date:-2022-01-22 05:33:46


Question:
What is REPL in Node.js?

1.Eval

2.Print

3. Loop

4. All of these

Posted Date:-2022-01-22 05:31:56


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

Posted Date:-2022-01-22 05:30:01


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

1. 10

2. Error

3.undefined

4.none of the above

Posted Date:-2022-01-22 06:27:32


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

Posted Date:-2022-01-22 06:26:18


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

Posted Date:-2022-01-22 06:25:52


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

1. import

2.module

3.exports

4.require

Posted Date:-2022-01-22 05:42:28


Question:
Which method appends specified content to a file.

1.fs.appendFile()

2.fs.open()

3.fs.writeFile()

4.none of the above

Posted Date:-2022-01-22 05:42:54


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

1.node-static

2.http

3.node-resource

4. static

Posted Date:-2022-01-22 05:32:18


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)

Posted Date:-2022-01-22 05:43:54


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

1. $ npm --version

2. $ npm getVersion

3. $ node getVersion

4. $ node --version

Posted Date:-2022-01-22 05:43:18


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

Posted Date:-2022-01-22 05:41:17


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

Posted Date:-2022-01-22 05:40:42


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

Posted Date:-2022-01-22 06:08:32


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

Posted Date:-2022-01-22 05:37:27


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

Posted Date:-2022-01-22 05:34:45


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

1.JavaScript

2.Java

3.C++

4.C#

Posted Date:-2022-01-22 05:34:11


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

Posted Date:-2022-01-22 06:22:59


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")

Posted Date:-2022-01-22 05:38:15


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

Posted Date:-2022-01-22 05:31:31


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!