Question Bank 2
Question Bank 2
Odd Semester
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<title>Document</title>
</head>
<body bgcolor="aliceblue">
<div class="card">
Card content
</div>
</body>
</html>
CSS:
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
.card{
background: orange;
width: 200px;
height: 200px;
padding: 10px;
}
Initial View:
Final View:
67. How many ways are there to insert CSS in your document? Explain all of them.
68. What are the key differences between flexbox and grid?
69. Why should we perform external API requests from our backend server instead of
directly from the frontend?
70. When inserting HTML from JavaScript why should we use innerText instead of
innerHTML?
71. What is the difference between setTimeout and setInterval?
72. Why do we need asynchronous functions?
73. How do we write an asynchronous function?
74. What are the differences between declaring a variable with let and var.
75. What are callback functions? Tell use cases where you have seen callback functions
being used.
MCQs
1. What will be the result of this following JS line - `console.log(1 == "1")`
A. True
B. False
A. <target></target>
B. <html></html>
C. <a></a>
D. <link />
A. link
B. Img
C. src
D. image
4. We want to create a multi-row image gallery, which display will be best for this case
A. flex
B. block
C. inline
D. grid
A. No
B. Yes
6. What is the function of JavaScript in web development
A. Interactivity
B. Declaring the layout
C. Stylizing the layout
D. Paint Pictures
7. What kind of API request we can use for updating user password
A. GET
B. PATCH
C. POST
D. DELETE
A. map
B. size
C. reduce
D. sort
A. position: relative;
B. width: 500px;
C. @media (max-width: <insert value here>){}
D. display: none;
10.What will be the result of this following JS line - `console.log(1 === "1")`
A. False
B. true
A. True
B. False
13.Which of the following CSS property can be used to change the background colour of an
HTML element?
A. color
B. bg
C. fill
D. background-color
A. To render HTML
B. To do API calls to servers
C. To listen to DOM events
D. To create illusions
A. array.loop()
B. array.forEach()
C. array.for()
D. array.while()
16.Let's say we have a file called "main.js". How can we link it to HTML?
A. <script name="main.js">
B. <script href="main.js">
C. <script src="main.js">
D. None of the above
17.Suppose we have a component with a specific ID, what is the function we are using to
reference that component in JS
A. document.getElementsByClassName()
B. document.getElementsById()
C. document.getElementById()
D. document.getElementByClassName()
18.What is NPM?
A. PUT
B. DELETE
C. POST
D. GET
20.Which of the following selector can be used for selecting an HTML element with the
class of "hello" in CSS
A. hello
B. :hello
C. #hello
D. .hello
22.Which of the following can be used to get all the elements with the same class name in
JS
A. document.getElementById
B. document.getElementsByClassName
C. All of the above
D. None of the above
23.What is node.js