wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Sec-E Quiz-19-4-23

Total questions: 120

Worksheet time: 3600secs

Name
Class
Date
1.

Which programming language is the Google V8 Engine designed for?

a)

Java

b)

JavaScript

c)

Python

d)

R

2.

Which JavaScript library is used to create Desktop apps in Node.js?

a)

React.js

b)

React Native

c)

Electron.js

d)

Express.js

3.

Which JavaScript library is used to create Progressive Web apps in Node.js?

a)

React.js

b)

React Native

c)

Electron.js

d)

Express.js

4.

Node.js is a Closed-source Technology. True or False?

a)

True

b)

False

5.

JavaScript used which of the following I/O model?

a)

Non-Blocking I/O Model

b)

Blocking I/O Model

c)

None.

6.

Node.js is _ Threaded language

a)

Single

b)

Multi

c)

Dual

7.

Which of the following command is used to run a node.js program?

a)

node run main.js

b)

node start main.js

c)

start main.js

d)

node main.js

8.

Which of the following code will print "Hello" on the output screen?

a)

print("Hello");

b)

console.log(Hello);

c)

console.log("Hello");

d)

printf("%s","Hello");

9.

What will be the output

var num = 10

console.log(num + 10)

a)

20

b)

83

c)

None of these

d)

Hello!

10.

Who createad NPM (Node Package Manager)?

a)

Isaac Z. Schlueter

b)

Ryan Dahl

c)

Brendan Eich

d)

Google

11.

JSON was a native construct of which language?

a)

PHP

b)

Java

c)

Ruby On Rails

d)

Javascript

12.

Who made node.js?

a)

Hampton Catlin

b)

Ryan Dahl

c)

Isaac Z. Schlueter

d)

GitHub

13.

Module in Node.js is a simple or complex functionality organized in...

a)

a single JavaScript file

b)

single or multiple JavaScript files

c)

the core built in functionality of Node.js

d)

Node.js doesn't support modules functionality

14.

How can you see all the dependencies for a Node.js app?

a)

All the dependencies are listed down in the package.json file

b)

By executing "npm i" and capturing the dependencies list

c)

You can't have dependencies in a Node.js app

d)

All the dependencies are listed down in the package-dependencies.json file

15.

In Node.js, HTTP Basic Authentication is quite recommended due to its inherent security strongness

a)

True

b)

False

c)

True, and also because it is a straightforward method

d)

False, Node.js doesn't support basic authentication

16.

Node.js is...

a)

modular platform, meaning that much of the functionality is being built in to the platform

b)

modular platform, meaning that much of the functionality is provided by external modules

c)

modular platform, meaning that much of the functionality does not work without angular 2

d)

modular what? I'm sorry, I wasn't paying attention

17.

The reason Node.js uses event callbacks is

a)

not to have to wait for blocking I/O

b)

its creator didn't know how to use async/await

c)

not to perform any I/O tasks from Node.js

d)

to make it possible to work with promises

18.

The "pending callbacks" phase of the event loop

a)

grabs the top item in the event queue and executes it

b)

executes callbacks scheduled by setTimeout() and setInterval()

c)

retrieves new I/O events

d)

executes I/O callbacks deferred to the next loop iteration

19.

When did Ryan Dahl authored Node.js?

a)

2007

b)

2008

c)

2009

d)

2010

20.

Which of the following command is used to run a node.js program?

a)

node run main.js

b)

node start main.js

c)

start main.js

d)

node main.js

21.

Node.js is _ Threaded language

a)

Single

b)

Multi

c)

Dual

22.

Can we execute JavaScript code outside a web browser?

a)

Yes sure

b)

No, because it’s a programming language used to develop Front-end and Back-end applications on the browser

c)

Not sure

23.

What is Node.Js?

a)

A virtual machine software

b)

A Database Development tool

c)

A Runtime Environment

24.

What is a runtime environment?

a)

.An environment in which a program or application is executed

b)

An environment where files can be saved

c)

A Virtual Machine where other operating systems can run

25.

________ is a back end web application framework for Node.js, it is fast, unopinionated and minimalist framework.

a)

Emotional.js

b)

Express.js

c)

Nodemon

d)

Doraemon

26.

What module provides utilities for working with file and directory paths?

a)

OS Module

b)

Path Module

c)

FS Module

d)

HTTP Module

27.

________ are the blocks of encapsulated code that communicates with an external application on the basis of their related functionality.

a)

Application

b)

Code

c)

Dependencies

d)

Modules

28.

What module provides information about the computer's operating system?

a)

OS Module

b)

Path Module

c)

FS Module

d)

HTTP Module

29.

What is the right syntax for importing a module?

a)

require()

b)

function()

c)

import()

d)

module.import()

30.

What JavaScript Engine is used by Google Chrome?

a)

Y8

b)

Adobe Flash Player

c)

Friv

d)

V8

31.

Which of the following command is used to run a node.js program?

a)

node run main.js

b)

node start main.js

c)

start main.js

d)

node main.js

32.

_____is used to raise the event.

a)

myEmitter.emitter()

b)

myEmtter.emit()

c)

myEmitter.event()

d)

myEmitter.emitEvent()

33.

Which of the following is correct syntax?

a)

fs.writeFile("filename", data, callback);

b)

fs.writeFile(data ,"filename", callback);

c)

fs.writeFile(callback, data, "filename");

d)

None

34.

Which of the following is correct?

a)

fs.unlink(path)

b)

fs.unlinkSync(path)

c)

fs.delete(path)

d)

fs.deleteSync(path)

35.

To check if a file exists, use

a)

fs.accessFile()

b)

fs.access()

c)

Both

d)

None

36.

Which of the following asynchronously append data to a file

a)

fs.append(path, data[, options])

b)

fs.appendFile(path, data[, options])

c)

fs.append(path, data[, options], callback)

d)

fs.appendFile(path, data[, options], callback)

37.

What is the advantage of using node.js?

a)

Great concurrency

b)

Generally fast

c)

It provides an easy way to build scalable network programs

d)

All of these

38.

Which of the following areas, Node.js is not advised to be used?

a)

Single Page Applications

b)

JSON APIs based Applications

c)

CPU intensive applications

d)

Data Intensive Realtime Applications (DIRT)

39.

3.       Which of the following is an IF statement in JavaScript?

a)

if i = 5

b)

if i = 5 then

c)

if (i == 5)

d)

All of these

40.

What will be the output of following code snippet?

JSON.stringify({ message: "Hello World"});

a)

{message:Hello World}{message:Hello World}

b)

{‘message’:’Hello World’}

c)

{"message":"Hello World"}

d)

None

41.

What is a runtime environment?

a)

.An environment in which a program or application is executed

b)

An environment where files can be saved

c)

A Virtual Machine where other operating systems can run

42.

Can we execute JavaScript code outside a web browser?

a)

Yes sure

b)

No, because it’s a programming language used to develop Front-end and Back-end applications on the browser

c)

Not sure

43.

JavaScript used which of the following I/O model?

a)

Non-Blocking I/O Model

b)

Blocking I/O Model

c)

None.

44.

Which of the following command is used to run a node.js program?

a)

node run main.js

b)

node start main.js

c)

start main.js

d)

node main.js

45.

Which of the following code will print "Hello" on the output screen?

a)

print("Hello");

b)

console.log(Hello);

c)

console.log("Hello");

d)

printf("%s","Hello");

46.

Who made node.js?

a)

Hampton Catlin

b)

Ryan Dahl

c)

Isaac Z. Schlueter

d)

GitHub

47.

When did Ryan Dahl authored Node.js?

a)

2007

b)

2008

c)

2009

d)

2010

48.

What will be the output

var num = 10

console.log(num + 10)

a)

20

b)

83

c)

None of these

d)

Hello!

49.

JSON was a native construct of which language?

a)

PHP

b)

Java

c)

Ruby On Rails

d)

Javascript

50.

How can you see all the dependencies for a Node.js app?

a)

All the dependencies are listed down in the package.json file

b)

By executing "npm i" and capturing the dependencies list

c)

You can't have dependencies in a Node.js app

d)

All the dependencies are listed down in the package-dependencies.json file

51.

Which is the correct syntax for Arrow Function?

a)

->

b)

<--!

c)

=>

d)

function arrow()

52.

________ are the blocks of encapsulated code that communicates with an external application on the basis of their related functionality.

a)

Application

b)

Code

c)

Dependencies

d)

Modules

53.

What module provides utilities for working with file and directory paths?

a)

OS Module

b)

Path Module

c)

FS Module

d)

HTTP Module

54.

NodeJS is

a)

Asynchronous

b)

Synchronous

55.

How Node.js modules are available externally

a)

module.exports

b)

module.spread

c)

module.expose

d)

none of these

56.

What is Callback

a)

It is a technique in which a function is executed after executing the calling function

b)

Only calls a specific function

c)

Node of these

57.

Which of the following needs to be updated to achieve dynamic UI updates?

a)

State

b)

Props

58.

React considers everything as _______.

a)

User interface

b)

elements

c)

components

d)

Objects

59.

React is mainly for building _____________.

a)

Database

b)

Connectivity

c)

User interface

d)

Design platform

60.

To connect Mongo dB Database from NodeJS which middleware we require?

a)

Body-parser

b)

Mongoose

c)

Express

d)

None of these

61.

What are core features of Express framework?

a)

Allows to set up middle-ware to respond to HTTP Requests

b)

Defines a routing table which can works as per HTTP Method and URL

c)

Dynamically render HTML Pages

d)

All of the above

62.

Which field is always first field in document?

a)

Any field

b)

id

c)

_id

d)

Objid

63.

How to create a model?

a)

Using Schema

b)

Using model

c)

Both Schema & model

d)

None of these

64.

Where we should specify the MongoDB collection name in NodeJS Code?

a)

Anywhere in the NodeJS code

b)

When we create Models Object in NodeJS

c)

When we create the Model

d)

Create Manually

65.

REST API works between

a)

Client (UI) --- Server(Express)

b)

Server(Express) --- Mongoose

c)

Mongoose --- MONGODB

d)

None

66.

Which Statement is TRUE

a)

In a Project, Model Class and MongoDB Documents have same no of fields

b)

In a Project, MongoDB Documents have more fields than Model Class fields

c)

In a Project, MongoDB Documents have less fields than Model Class fields

67.

Status Code 404 means resource not found

a)

True

b)

False

68.

When was MongoDB created?

a)

In January 2008

b)

In February 2009

c)

In March 2010

d)

In April 2011

69.

When was NPM created?

a)

In January 2010

b)

In August 2011

c)

In February 2012

d)

In April 2013

70.

What platform popularized RESTful JSON API's?

a)

Web Market

b)

Mobile Game

c)

Social Media

71.

When was the first non-Beta version of node was released?

a)

2014

b)

2013

c)

2015

d)

2016

72.

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

a)

Single Page Applications

b)

JSON APIs based Applications

c)

D - Data Intensive Realtime Applications (DIRT)

Answe

d)

Data Intensive Realtime Applications (DIRT)

73.

Which method of fs module is used to write a file?

a)

fs.write(path, flags[, mode], callback)

b)

fs.writeFile(path, flags[, mode], callback)

c)

fs.writePath(path, flags[, mode], callback)

d)

None of the above.

74.

Which method of fs module is used to remove a directory?

a)

fs.deleteDirectory(path[, mode], callback)

b)

fs.rmdir(path, callback)

c)

fs.removeDirectory(path[, mode], callback)

d)

None of the above.

75.

Which of the following is not a valid HTTP method?

a)

get

b)

put

c)

post

d)

header

76.

NodeJs is ----------- by default

a)

Synchronous

b)

Asynchronous

c)

multi-thread

d)

none of the above

77.

what is the default scope in NodeJs application

a)

Global

b)

Local

c)

Global Function

d)

Local to object

78.

third party package can be install/update/delete using ---------

a)

node package manager

b)

Node.exe

c)

Module.exports

d)

REPL

79.

how to import module in NodeJs?

a)

Using the require() function

b)

using module.exports

c)

using the enclude() function

d)

using the app.use() function

80.

which of the following is used to create and consume custom events in NodeJs?

a)

EventEmitter

b)

Events

c)

NodeEvent

d)

None of the above

81.

which module is used to serve static resources in nodejs?

a)

node-static

b)

http

c)

node-resource

d)

static

82.

_____ is an interactive shell that processes Node.

a)

REPL

b)

REAL

c)

RESP

d)

None of the above

83.

What is the full form of REPL?

a)

Read Eval Print Loop

b)

Research Eval Program Learn

c)

Read Earn Print Learn

84.

which node module used to handle binary data

a)

binary

b)

buffer

c)

crypto

d)

dgram

85.

what happens when you click the rendred button?

a)

Nothing

b)

The rendred button whithin Button will change to Jack

c)

infinite Loop

86.

Which of the following is the correct way to rewrite this using useState?

a)

const [count, setCount] = useState(0)

b)

count [count, setCount] = useState(0)

c)

const setCount = useState(0)

d)

const setCount = useState()

87.

Which of the following is NOT true of hooks?

a)

hooks allows the conversion of class components to functional components

b)

hook can not be used inside loops

c)

hooks can be used whithin class components

d)

you can make you own custom hooks

88.

The following React code renders a button where the button text is generated through an inefficient function that takes the variable mult as an argument. The variable mult is set whenever value is a multiple of 5. What can you add to this function to make the rerenders less costly?

Assume no variables can be removed and you do not have access to source code of someCodeThatTakesLongTime.

a)

write you own version of someCodeThatTakesLongTime that is faster

b)

make an {a} into a state variable and set it when value changes

c)

use useMemo to only compute when the value of mult change

89.

How many times will the console print Hello?

a)

once every time the compnents update

b)

only once

c)

Zero

90.

Asynchronous functions can trigger the callback of the catch part using what keyword?

a)

return

b)

throw

c)

await

d)

await

91.

What global variable is used to access the environment variables of a NodeJS application?

a)

env

b)

ENV

c)

process.env

d)

Process.getEnv()

92.

HTTPS is

a)

Hypertext transfer protocol secure (HTTPS) is the secure version of HTTP, which is the primary protocol used to send data between a web browser and a website

b)

Hypertext transfer primary secure (HTTPS) is the secure version of HTTP, which is the primary protocol used to send data between a web browser and a website

c)

Can I drop off the meeting now?

93.

filters the document stream to allow only matching documents to pass unmodified into the next pipeline stage

a)

$regex

b)

$reg

c)

$match

d)

none of the mentioned

94.

the ................. method limits the number of documents in the result set?

a)

limit()

b)

limitOf()

c)

limitBy()

d)

none of the montioned

95.

which of the following line skips the first 5 documents in the bios collection and returns all remaining documents?

a)

db.bios.find.limit(5)

b)

db.bios.find.skip(1)

c)

db.bios.find.skip(5)

d)

db.bios.find.sort(5)

96.

React component can return how many html tags

a)

one

b)

multiple

c)

two

d)

three

97.

const [x, y] = useState(0) -> what is the y

a)

Setter function

b)

Getter function (state variable)

98.

what is the output

a)

[[1, 2, 3, 4, 5]]

b)

[1, 2, 3, 4, 5]

c)

1

d)

[1]

99.

How is a Middleware built?

a)

app.use(<PATH>, (req, res) => {

// validations

});

b)

app.use(<PATH>, (req, res, next) => {

// validations

next()

});

c)

app.middleware(<PATH>, (req, res, next) => {

// validations

next()

});

d)

app.middleware(<PATH>, (req, res) => {

// validations

});

100.

Which one of the following argument is used to call next middle ware in stack?

a)

req

b)

res

c)

next

d)

get

101.
a)

useEffect(() => { setDone(true); });

b)

useEffect(() => { setDone(true); }, []);

c)

useEffect(() => { setDone(true); }, [setDone]);

d)

useEffect(() => { setDone(true); }, [done, setDone]);

102.
a)

Remove this

b)

Capitalize clock

c)

Remove the render method

d)

Add quotes around the return value

103.

Why might you use a ref?

a)

to directly access the DOM node

b)

to refer to another JS file

c)

to bind the function

d)

to call a function

104.
a)

{{name: "Venkat", age: 30}}

b)

{name: "Venkat", age: 30}

c)

{person: "Venkat", person: 30}}

d)

{person: {name: "Venkat", age: 30}}

105.
a)

Error. Cannot use direct JavaScript code in JSX

b)

Error. Should be replaced with a for..loop for correct output

c)

Displays the list of languages in the array

d)

Displays nothing

106.

What does this React element look like given the following function?

React.createElement('h1', null, "What's happening?");

a)

<h1 props={null}>What's happening?</h1>

b)

<h1>What's happening?</h1>

c)

<h1 id="component">What's happening?</h1>

d)

<h1 id="element">What's happening?</h1>

107.

How do you write an inline style specifying the font-size:12px and color:red; in JSX?

a)

style={{font-size:12,color:'red'}}

b)

style={{fontSize:'12px',color:'red'}}

c)

style={fontSize:'12px',color:'red'}

d)

style={{font-size:12px,color:'red'}}

108.

How can you see all the dependencies for a Node.js app?

a)

All the dependencies are listed down in the package.json file

b)

By executing "npm i" and capturing the dependencies list

c)

You can't have dependencies in a Node.js app

d)

All the dependencies are listed down in the package-dependencies.json file

109.

In Node.js, HTTP Basic Authentication is quite recommended due to its inherent security strongness

a)

True

b)

False

c)

True, and also because it is a straightforward method

d)

False, Node.js doesn't support basic authentication

110.

The reason Node.js uses event callbacks is

a)

not to have to wait for blocking I/O

b)

its creator didn't know how to use async/await

c)

not to perform any I/O tasks from Node.js

d)

to make it possible to work with promises

111.

The "pending callbacks" phase of the event loop

a)

grabs the top item in the event queue and executes it

b)

executes callbacks scheduled by setTimeout() and setInterval()

c)

retrieves new I/O events

d)

executes I/O callbacks deferred to the next loop iteration

112.

What is the buffer in Node.js?

a)

Memory allocated outside V8 to store raw binary data

b)

In-memory location inside V8 used for streaming

c)

Client side storage used to store local data

113.

What are streams in Node.js

a)

process of flow of data from source to buffer

b)

a raw memory storage for streaming data

c)

transport channels for tcp/ip sockets

114.

What is not built-in node module?

a)

util

b)

os

c)

zlib

d)

express

115.

Streams are similar to event emitters?

a)

true

b)

false

116.

How many types of streams are there?

a)

3, readable, writeable and both

b)

2, readable, writeable

c)

1 read only

117.

Which of the following code can create a web server ?

a)

A. http.createServer(callback)

b)

B. http.createWebServer(callback)

c)

C. http.createHTTPServer(callback)

d)

D. None of the above

118.

Which of the following is true about fs module of Node?

a)

A. Every method in fs module have synchronous as well as asynchronous form

b)

B. Asynchronous methods of fs module take last parameter as completion function callback and first parameter of the callback function as error

c)

C. Both of the above

d)

D. None of the above

119.

Which method of fs module is used to read a file?

a)

A - fs.open(path, flags[, mode], callback)

b)

B - fs.openFile(path, flags[, mode], callback)

c)

C - fs.openPath(path, flags[, mode], callback)

d)

D - fs.read(fd, buffer, offset, length, position, callback)

120.

Where is captured values are populated regarding route parameters?

a)

req.params object

b)

app.locals object

c)

req.data object

d)

none of the above