wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Sec-E Quiz 26-4-2023

Total questions: 82

Worksheet time: 41mins

Name
Class
Date
1.
1. What is a state in React?
a)
External storage of the component
b)
A permanent storage
c)
Internal storage of the component
d)
None of the above
e)
Answer: Internal storage of the component
2.
2. Does React.js create a VIRTUAL DOM in the memory?
a)
True
b)
False
c)
Cannot say
d)
None of above
e)
Answer: True
3.
3. Which of the following is used to pass data to a component from outside in React.js?
a)
Render with arguments
b)
PropTypes
c)
SetState
d)
Props
e)
Answer: Props
4.
4. What are the two ways to handle data in React?
a)
Services & Components
b)
State & Component
c)
State & Props
d)
State & Services
e)
Answer: State & Props
5.
5. Which of the following is the correct name of React.js?
a)
React.js
b)
React
c)
ReactJS
d)
All of the above
e)
Answer: All of the above
6.
6. What does ES6 stand for?
a)
ECMAJavaScript 6
b)
ECMA 6
c)
ECMAScript 6
d)
EJavaScript 6
e)
Answer: ECMAScript 6
7.
7. What is the use of “web pack” command in React.js?
a)
It is a module bundler
b)
The “webpack” command is used to transpile all the JavaScript down into one file
c)
It runs React local development server
d)
None of the above
e)
Answer: It is a module bundler
8.
8. In which of the following directory React.js components are saved?
a)
Inside the vendor/components/
b)
Inside the vendor/
c)
Inside the js/components/
d)
Inside the external/components/
e)
Answer: Inside the js/components/
9.
9. Which of the following function is used to change the state of the React.js component?
a)
this.setChangeState
b)
this.State{}
c)
this.setState
d)
None of the above
e)
Answer: this.setState
10.
10. In which of the following condition, the React.js Lifecycle method static get Derived Stae From Props(props, state) is called?
a)
The state of the component is updated
b)
The component is created for the first time
c)
All of above
d)
None
e)
Answer: All of above
11.
11. Which of the following option is correct in the case of the Babel?
a)
Babel is a Transpolar
b)
Babel is a Compiler
c)
All of above
d)
None of above
e)
Answer: All of above
12.
12. Which of the following is a must API for every React.js component?
a)
render Component
b)
Setinitial Component
c)
render
d)
All of the above
e)
Answer: render Component
13.
13. Which of the following are the advantages of React.js?
a)
React.js is easy to integrate with other frameworks such as Angular, Backbone JS since it is only a view library
b)
React.js can render both on client and server side
c)
React.js can increase the application’s performance with Virtual DOM
d)
All of the above
e)
Answer: All of the above
14.
14. Which of the following method refers to the parent class in React.js?
a)
this()
b)
self()
c)
inherits()
d)
super()
e)
Answer: super()
15.
15. Which of the following statement is true for uncontrolled components in React.js?
a)
The source of truth is a component state
b)
The source of truth can be anything
c)
The source of truth is DOM
d)
None
e)
Answer: The source of truth is DOM
16.
16. What of the following is used in React.js to increase performance?
a)
Original DOM
b)
Virtual DOM
c)
All of above
d)
None of above
e)
Answer: Virtual DOM
17.
17. What will happen if you render an input element with disabled = {false}?
a)
It will not be rendered at all
b)
It will be rendered as enabled
c)
It will be rendered as disabled
d)
None of above
e)
Answer: It will be rendered as enabled
18.
18. What changes would appear in the component as soon as the state of the React component is changed?
a)
It will re-render the component
b)
It can be created again from scratch
c)
It will do nothing; you have to call render method to render the component again
d)
None
e)
Answer: It will re-render the component
19.
19. Which of the following statement is true for controlled components in React.js?
a)
The source of truth is a component state
b)
The source of truth can be anything
c)
The source of truth is DOM
d)
None
e)
Answer: The source of truth is a component state
20.
20. Which of the following function is called to render HTML to the web page in React?
a)
Prerender()
b)
renderComplete()
c)
render()
d)
ReactDOM_render()
e)
Answer: render()
21.
21. A class is a type of function, but instead of using the keyword function to initiate it, which keyword do we use?
a)
Object
b)
Constructor
c)
Data Object
d)
Class
e)
Answer: Class
22.
22. We can update the state in React.js by calling to setState() method. These calls are__________
a)
Asynchronous in nature
b)
Synchronous in nature
c)
Are asynchronous but can be made synchronous when required
d)
None of the these
e)
Answer: Asynchronous in nature
23.
23. Which of the following lifecycle events React components have at the highest level?
a)
Initialization
b)
State/Property Updates
c)
Destruction
d)
All of the above
e)
Answer: All of the above
24.
24. Which of the following is not a disadvantage of React.js?
a)
The learning curve can be steep in React.js
b)
The JSX in React.js makes code easy to read and write
c)
The library of React.js is pretty large
d)
React.js has only a view layer. We have put your code for Ajax requests, events and so on
e)
Answer: The JSX in React.js makes code easy to read and write
25.
25. What is the default port where web pack-server runs?
a)
8080
b)
6060
c)
3000
d)
3030
e)
Answer: 8080
26.
26. How many ways of defining your variables in ES6?
a)
3
b)
1
c)
4
d)
2
e)
Answer: 3
27.
27. Why is the usage of set State?
a)
Access the previous state before the set State operation
b)
Replace the state completely instead of the default merge action
c)
Invoke code after the set State operation is done
d)
None
e)
Answer: Invoke code after the set State operation is done
28.
28. Which of the following acts as the input of a class-based component?
a)
Factory
b)
Render
c)
Class
d)
Props
e)
Answer: Props
29.
29. Which of the following command is used to install create-react-app?
a)
npm install -f create-react-app
b)
npm install -g create-react-app
c)
npm install create-react-app
d)
install -g create-react-app
e)
Answer: npm install -g create-react-app
30.
30. How many numbers of elements a valid react component can return?
a)
2
b)
1
c)
4
d)
5
e)
Answer: 1
31.
31. Which of the following best defines the “key” prop?
a)
“Key” prop is a way for React to identify a newly added item in a list and compare it during the “diffing” algorithm
b)
It is one of the attributes in HTML
c)
“Key” prop is used to look pretty, and there is no benefit whatsoever
d)
None of these
e)
Answer: “Key” prop is a way for React to identify a newly added item in a list and compare it during the “diffing” algorithm
32.
32. Which of the following keyword is used to create a class inheritance?
a)
Inherits
b)
Create
c)
Extends
d)
None of above
e)
Answer: Extends
33.
33. How can you set a default value for an uncontrolled form field?
a)
By using the defaultValue property
b)
By using the default property
c)
By using the value property
d)
It is assigned automatically
e)
Answer: By using the defaultValue property
34.
34. What is the declarative way to render a dynamic list of components based on values in an array?
a)
Using the Array.map() method
b)
Using the <Each /> component
c)
Using the reduce array method
d)
With a for/while loop
e)
Answer: Using the Array.map() method
35.
35. Which of the following command is used to install create-react-app?
a)
npm install create-react-app
b)
npm install -f create-react-app
c)
npm install -g create-react-app
d)
install -g create-react-app
e)
Answer: npm install -g create-react-app
36.

________ 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

37.

Creator of Node.js

a)

Ryan Dahl

b)

Ryan Bang

c)

Ryan Agoncillo

d)

Ryan Reynolds

38.

Which is the correct syntax for Arrow Function?

a)

->

b)

<--!

c)

=>

d)

function arrow()

39.

________ 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

40.

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

a)

OS Module

b)

Path Module

c)

FS Module

d)

HTTP Module

41.

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

a)

OS Module

b)

Path Module

c)

FS Module

d)

HTTP Module

42.

What is the right syntax for importing a module?

a)

require()

b)

function()

c)

import()

d)

module.import()

43.

Middleware functions are functions

a)

Execute any code.

b)

Make changes to the request and the response objects.

c)

End the request-response cycle.

d)

All mentioned

44.

var express = require('express')

var app = express()

var myLogger = function (req, res, next) {

  console.log('LOGGED')

  next()

}

app.use(myLogger)

app.get('/', function (req, res) {

  res.send('Hello World!')

})

app.listen(3000)

What will be outpiut on localhost:2000?

a)

Hello World!

b)

None of mentioned

c)

There is error in code

45.

app.use is used for

a)

The middleware function is executed when the base of the requested path matches path.

b)

Routes HTTP GET requests to the specified path with the specified callback functions.

c)

Both mentioned

d)

None mentioned

46.

A template engine...

a)

replaces variables in a template file with actual values, and transforms the template into an JSON file sent to the server

b)

replaces variables in a template file with actual values, and transforms the template into an HTML file sent to the client

c)

replaces variables in a template file with actual values, and transforms the template into an HTML file sent to the server

d)

replaces variables in a template file with actual values, and transforms the template into an JSON file sent to the client

47.

PM2 is...

a)

A simple command-line interface tool to ensure that a script runs continuously

b)

A project manager above of a normal project managers (PM) and with a better salary

c)

A fast and lightweight HTML-based templating engine that compiles templates to CommonJS modules and supports streaming, async rendering and custom tags. (render directly to the HTTP response stream)

d)

A production process manager for Node.js applications that has a built-in load balancer

48.

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)

I'm not sure, but I liked the slide with Britney Spears

d)

Can I drop off the meeting now?

49.

Why secure HTTP headers?

a)

To add the X-Powered-By attribute informing the browser which server vendor and version you’re using

b)

Hackers typically cross-reference this information with a list of publicly disclosed known vulnerabilities

c)

To make the responses more faster and lightweight

d)

For debugging and for logging app activity while running the application in production environments

50.

What command is used to manage different NodeJS veresions?

a)

npm

b)

node

c)

nvm

d)

js

51.

Which of the following routes is considered a RESTful configuration for ExpressJS?

a)

/{id}

b)

/:id

c)

/?id=val

d)

/id=val

52.

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

a)

return

b)

throw

c)

await

d)

await

53.

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

a)

env

b)

ENV

c)

process.env

d)

Process.getEnv()

54.

Collection is a group of MongoDB ___________?

a)

Document

b)

Database

c)

Table

d)

Row

55.

What is Mongoose?

a)

An object document mapping

b)

An object-relational mapping

c)

A small terrestrial carnivorous

56.

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?

57.

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

58.

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

a)

limit()

b)

limitOf()

c)

limitBy()

d)

none of the montioned

59.

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)

60.

point out the correct statement?

a)

collection is a group of MongoDB documents

b)

collections do not enforce a schema

c)

all the mentoned

61.

BSON is a binary representation of .............. documents?

a)

JSON

b)

XML

c)

JScript

d)

all the mentioned

62.

ReactJs cover

a)

User Interface layer in an application

b)

Data layer in an application

c)

Both A and B

d)

None of the above

63.

React component can return how many html tags

a)

one

b)

multiple

c)

two

d)

three

64.

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

a)

Setter function

b)

Getter function (state variable)

65.

what is the output

a)

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

b)

[1, 2, 3, 4, 5]

c)

1

d)

[1]

66.

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

});

67.

Part of a program that does not work correctly.

a)

Loop

b)

Bug

c)

Debug

d)

Program

68.

A bug can really mess up the program, so it's important to learn to_______your code.

a)

Reset

b)

Start over

c)

Debug

d)

Remove

69.

The action of doing something over and over again.

a)

Run

b)

Step

c)

Loop

d)

Event

70.

A list of steps to finish a task.

a)

Sequence

b)

Algorithm

c)

Start Over

d)

Play Area

71.

An algorithm that has been coded into something that can be run by a machine.

a)

Loop

b)

Debug

c)

Program

d)

Bug

72.

Do something again

a)

Run

b)

Repeat

c)

Start Over

d)

Step

73.

The area where you run your code.

a)

Workspace

b)

Play Area

c)

Instructions

d)

Start over

74.

A repeat block within a repeat block

a)

Loopy Loop

b)

Condition Loop

c)

Nested Loop

d)

Event

75.

The art of creating a program

a)

Debugging

b)

Blockly

c)

Programming

d)

Program

76.

The very first step in debugging is to

a)

raise your hand to ask the teacher

b)

keep going like nothing is wrong

c)

find the error in the program

d)

give up

77.

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

78.

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

79.

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

80.

What is not built-in node module?

a)

util

b)

os

c)

zlib

d)

express

81.

Streams are similar to event emitters?

a)

true

b)

false

82.

How many types of streams are there?

a)

3, readable, writeable and both

b)

2, readable, writeable

c)

1 read only