Quiz Space

May 2023 term · Modern Application Development II · BSCS2006

MAD 2 End Term: 3 September 2023, Set QPD1-S2 (May 2023 term)

The IIT Madras BS Modern Application Development II (MAD 2) End Term paper sat on 3 Sept 2023, in the May 2023 term, set QPD1-S2: 32 questions for 100 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
32
Marks
100
Duration
180 min
MCQ
20
MSQ
12

Updated

Official paper: IIT M FOUNDATION ET1 EXAM QPF1 S1 03 Sep · No negative marking.

Question 1

+3 marksOne correct option

Consider the below HTML document.

index.html:

html
<table id ="table_id">
<tr>
<th>Name</th>
<th>Standard</th>
</tr>
<tr>
<td id = "cell_id_1">Pihu</td>
<td id = "cell_id_2">BA</td>
</tr>
<tr>
<td id = "cell_id_3">Sonali</td>
<td id = "cell_id_4">BCA</td>
</tr>
</table>
<script>
document.getElementById("table_id").addEventListener("click", () =>
console.log("Table Clicked !!"), true);
document.getElementById("cell_id_1").addEventListener("click", () =>
console.log("Cell Clicked !!"), true);
</script>

Suppose you open the “index.html” file in a browser, and click on the table cell with the text “Pihu”. Which of the following shows the correct sequence of output?

  1. A

    Cell Clicked !!
    Table Clicked !!

  2. B

    Table Clicked !!
    Cell Clicked !!

  3. C

    Cell Clicked !!

  4. D

    Table Clicked !!

Show answer

Correct answer

  • B

    Table Clicked !!
    Cell Clicked !!

Question 2

+3 marksOne correct option

Consider the below HTML document.

index.html:

html
<table id ="table_id">
<tr>
<th>Name</th>
<th>Standard</th>
</tr>
<tr>
<td id = "cell_id_1">Pihu</td>
<td id = "cell_id_2">BA</td>
</tr>
<tr>
<td id = "cell_id_3">Sonali</td>
<td id = "cell_id_4">BCA</td>
</tr>
</table>
<script>
document.getElementById("table_id").addEventListener("click", () =>
console.log("Table Clicked !!"));
document.getElementById("cell_id_1").addEventListener("click", () =>
console.log("Cell Clicked !!"));
</script>

Suppose you open the “index.html” file in a browser, and click on the table cell with the text “Pihu”. Which of the following shows the correct sequence of output?

  1. A

    Cell Clicked !!
    Table Clicked !!

  2. B

    Table Clicked !!
    Cell Clicked !!

  3. C

    Cell Clicked !!

  4. D

    Table Clicked !!

Show answer

Correct answer

  • A

    Cell Clicked !!
    Table Clicked !!

Question 3

+3 marksOne correct option

Consider the following JavaScript program, and predict the output if executed.

javascript
var first = 1;
obj1 = {
'first' : 2,
'second' : function some () {
console.log(first);
}
}
obj2 = {
'first' : 3,
'second' : function some () {
console.log("Function Invoked !!");
this.second();
}
}
obj2.second.call(obj1);
  1. A

    Function Invoked !!
    1

  2. B

    Function Invoked !!
    2

  3. C

    Function Invoked !!
    3

  4. D

    The program will cause an infinite loop and keep printing the message “Function Invoked !!”

Show answer

Correct answer

  • A

    Function Invoked !!
    1

Question 4

+3 marksOne correct option

Match the Vue directives / constructs with their function.

  1. A

    1-A, 2-B, 3-C, 4-D

  2. B

    1-C, 2-B, 3-D, 4-A

  3. C

    1-C, 2-D, 3-A, 4-B

  4. D

    1-C, 2-B, 3-A, 4-D

Show answer

Correct answer

  • D

    1-C, 2-B, 3-A, 4-D

Question 5

+3 marksOne correct option

Consider the below Vue application with markup file “index.html” and javascript file “app.js”.

app.js:

javascript
const First = Vue.component("first", {
template: `<div>Hello First Component !!</div>`
})
const Second = Vue.component("second", {
template: `<div>Hello Second Component !!</div>`
})
const router = new VueRouter({
base: '/myapp/',
routes: [
{
path: "/endpoint1",
component: First,
},
{
path: "/endpoint2",
component: Second,
},
]
});
const app = new Vue({
el: '#app',
router,
data: {},
methods: {}
});

Suppose the application is deployed under a subdirectory named “/myapp/” of a domain named “https://appdev2-may2023.com”, and you want to navigate to a page that renders “Hello First Component !!”. What should be the correct URL to get the desired output?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 6

+3 marksOne correct option

Consider the below Vue application with markup file “index.html” and javascript file “app.js”.

app.js:

javascript
const First = Vue.component("first", {
template: `<div>Hello First Component !!</div>`
})
const Second = Vue.component("second", {
template: `<div>Hello Second Component !!</div>`,
mounted() {
this.$router.push("/endpoint1");
}
})
const router = new VueRouter({
routes: [
{
path: "/endpoint1",
component: First,
},
{
path: "/endpoint2",
component: Second,
},
]
});
const app = new Vue({
el: '#app',
router,
data: {},
methods: {}
});

Suppose you open the “index.html” file in a browser, and click on the link with the text “Home”. What will be rendered by the browser except the router links in the navigation menu?

  1. A

    Hello First Component !!

  2. B

    Hello Second Component !!

  3. C

    404

  4. D

    Blank Page

Show answer

Correct answer

  • A

    Hello First Component !!

Question 7

+3 marksOne correct option

Consider the below javascript program, and predict the output, if executed.

javascript
new Promise((reject, resolve) => {
if ("iitmiitm".split("iitm").length == 2)
resolve("Promise is rejected")
else
reject("Promise is resolved")
}).then(data => console.log("Promise Rejected :", data),
data => console.log("Promise Resolved :", data)
).then(data => {
console.log("Value received from previous block :", data)
return 34
}).catch(error => console.log("Error caused :", error)).finally(data => {
console.log("In Finally Block :", data)
return 39
}).then(data => console.log("Value received from previous block :", data))
  1. A

    Promise Resolved : Promise is resolved
    Value received from previous block : undefined
    In Finally block : undefined
    Value received from previous block : 39

  2. B

    Promise Resolved : Promise is rejected
    Value received from previous block : undefined
    In Finally block : 34
    Value received from previous block : 39

  3. C

    Promise Resolved : Promise is rejected
    Value received from previous block : undefined
    In Finally block : undefined
    Value received from previous block : 34

  4. D

    Promise Rejected : Promise is resolved
    Value received from previous block : undefined
    In Finally block : undefined
    Value received from previous block : 34

Show answer

Correct answer

  • D

    Promise Rejected : Promise is resolved
    Value received from previous block : undefined
    In Finally block : undefined
    Value received from previous block : 34

Question 8

+3 marksOne correct option

Which of the following statements is true regarding long polling?

  1. A

    The server does not close the connection until it has a message to send.

  2. B

    The server sends the response immediately, even if the requested data is not available.

  3. C

    The server will always close the connection if the response data is not available.

  4. D

    None of these.

Show answer

Correct answer

  • A

    The server does not close the connection until it has a message to send.

Question 9

+3 marksOne correct option

Consider the following flask application.

app.py:

python
from flask import Flask
from flask_caching import Cache
import time
config = {
"DEBUG": True,
"CACHE_TYPE": "RedisCache",
"CACHE_REDIS_URL": "redis://localhost:6379/1",
"CACHE_DEFAULT_TIMEOUT": 300
}
app = Flask(__name__)
app.config.from_mapping(config)
cache = Cache(app)
@app.get('/name/<name>')
@cache.cached(timeout=100)
def get_name(name):
time.sleep(50)
return name
if __name__ == '__main__':
app.run()

Suppose the application is running on “http://localhost:5000”. If the client makes two requests (one after another) to URL “http://localhost:5000/name/mohan” first at 11:30PM and second at 12:30PM. What will be the approximate absolute difference between their latencies?

  1. A

    50 Seconds

  2. B

    60 Seconds

  3. C

    0 Seconds

  4. D

    None of these

Show answer

Correct answer

  • C

    0 Seconds

Question 10

+3 marksOne correct option

What will be the output of the following javascript code.

javascript
function promoter(cgpa) {
return new Promise((res, rej) => {
if (cgpa < 9.0) {
res()
} else {
rej()
}
})
}
promoter(8)
.then(
() => {
console.log('Promoted')
},
() => {
console.log('Not Promoted')
}
)
.finally(() => {
console.log('Job Done')
})
  1. A

    Not Promoted

  2. B

    Promoted

  3. C

    Not Promoted
    Job Done

  4. D

    Promoted
    Job Done

Show answer

Correct answer

  • D

    Promoted
    Job Done

Question 11

+3 marksOne correct option

Consider the below Vue application with markup file “index.html” and javascript file “app.js”.

index.html:

html
<div id="app"></div>

app.js:

javascript
new Vue({
el: '#app',
template: `<div>{{message}}</div>`,
data: {
message: null,
},
created() {
this.message = 'Hello from created'
},
beforeCreate() {
this.message = 'Hello from before create'
},
})

Suppose the application is running on “http://localhost:8080”. What will be rendered by the browse in the div of the template?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 12

+3 marksOne correct option

Consider the below Vue application with markup file “index.html” and javascript file “app.js”.

app.js:

javascript
const Home = {
template: `<div> This is home <router-view /></div>`,
}
const NotFound = {
template: `<div>Not Found</div>`,
}
const Students = {
template: `<ul><li v-for='student in
allStudents'>{{student.name}}</li></ul>`,
data() {
return {
students: [
{ id: 1, name: 'std1', course: 'mad1' },
{ id: 2, name: 'std2', course: 'mad2' },
{ id: 3, name: 'std3', course: 'mad1' },
],
}
},
computed: {
allStudents() {
return this.students.filter((std) => {
return std.id % 2 == 1
})
},
},
}
const Student = {
template: `<div>Name: {{student.name}}, Course: {{student.course}}</div>`,
props: ['id'],
computed: {
student() {
return Students.data().students.find((std) => {
return std.id == (this.id % 5) + 1
})
},
},
}
javascript
const router = new VueRouter({
routes: [
{
path: '/',
component: Home,
children: [
{ path: '', component: Students },
{ path: 'student/:id', component: Student, props: true },
{ path: '*', component: NotFound },
],
},
],
})
new Vue({
el: '#app',
template: `<div><router-view /></div>`,
router,
})

Suppose the application is running on “http://localhost:8080”. What will be rendered by the browser inside the “router-view” component of “Home” Component for the URL “http://localhost:8080/students”?

  1. A

    Name: std1, Course: mad1

  2. B

    Name: std2, Course: mad2

  3. C

    Name: std3, Course: mad1

  4. D

    Not Found

Show answer

Correct answer

  • D

    Not Found

Question 13

+2 marksOne or more correct options

Which of the following is/are not the example(s) of ephemeral state?

Select all that apply.

  1. A

    Currently selected tab/page in a multi page/tab document

  2. B

    User Preferences

  3. C

    Loading Icons

  4. D

    Shopping Cart

Show answer

Correct answers

  • B

    User Preferences

  • D

    Shopping Cart

Question 14

+2 marksOne or more correct options

Which of the following statement(s) is/are true in general?

Select all that apply.

  1. A

    As an application developer, it is not possible to hide javascript from the user.

  2. B

    “Denail of Service” is an attack that injects malicious client side scripts.

  3. C

    CORS is a mechanism used to control and manage cross-origin requests in a web application.

  4. D

    The terms “privacy” and “security” are the same when it comes to web applications.

Show answer

Correct answers

  • A

    As an application developer, it is not possible to hide javascript from the user.

  • C

    CORS is a mechanism used to control and manage cross-origin requests in a web application.

Question 15

+2 marksOne or more correct options

Which of the following statement(s) is/are correct regarding the execution context in JavaScript?

Select all that apply.

  1. A

    All the code that is not inside any function is run inside Global execution context.

  2. B

    A global execution context is created when a function is called.

  3. C

    A function execution context is created when the function is called.

  4. D

    All of these

Show answer

Correct answers

  • A

    All the code that is not inside any function is run inside Global execution context.

  • C

    A function execution context is created when the function is called.

Question 16

+2 marksOne or more correct options

Which of the following statements is/are correct regarding the prototype in javascript?

Select all that apply.

  1. A

    Prototype is used by objects to inherit features.

  2. B

    Prototype of an object can be null.

  3. C

    Inheritance is not possible in JavaScript.

  4. D

    Every object may not have a prototype.

Show answer

Correct answers

  • A

    Prototype is used by objects to inherit features.

  • B

    Prototype of an object can be null.

Question 17

+2 marksOne or more correct options

Which of the following statements is/are correct?

Select all that apply.

  1. A

    Caching can reduce the number of calls to the database

  2. B

    CDN is a group of servers that cache content

  3. C

    Caching can only be done at the browser level

  4. D

    All of these

Show answer

Correct answers

  • A

    Caching can reduce the number of calls to the database

  • B

    CDN is a group of servers that cache content

Question 18

+2 marksOne or more correct options

Which of the following statements is/are true regarding the celery in python?

Select all that apply.

  1. A

    Celery stores the result of a task in a result backend.

  2. B

    Celery typically runs the tasks asynchronously.

  3. C

    Celery beat is used to schedule tasks.

  4. D

    None of these.

Show answer

Correct answers

  • A

    Celery stores the result of a task in a result backend.

  • B

    Celery typically runs the tasks asynchronously.

  • C

    Celery beat is used to schedule tasks.

Question 19

+2 marksOne correct option

Which of the following statements is false regarding async and await?

  1. A

    The “await” can be used inside any function.

  2. B

    The “await” keyword is typically used to wait for a promise and get its fulfilment value.

  3. C

    The “await” keyword pauses the execution of code of the async function till the promise is in pending state, and executes the code outside the function, in the meantime.

  4. D

    The “await” can only be used inside an async function, except browser console.

Show answer

Correct answer

  • A

    The “await” can be used inside any function.

Question 20

+2 marksOne correct option

Which of the following statements is false regarding HTTP and fetch API?

  1. A

    A fetch call is capable of sending image data.

  2. B

    The “Accept” HTTP header is used by HTTP clients to tell the server which type of content they expect/prefer as response.

  3. C

    The HTTP headers “Accept” and “Content-Type” are essentially the same.

  4. D

    A fetch call allows a developer to add custom headers in the request.

Show answer

Correct answer

  • C

    The HTTP headers “Accept” and “Content-Type” are essentially the same.

Question 21

+4.5 marksOne correct option

Consider the following Vue application with markup “index.html” and javascript file “app.js”.

index.html:

html
<div id = "app">
<input v-model = "name" @input = "do_something">
<p> {{age}} </p>
</div>
<script scr = "app.js"></script>

app.js:

javascript
new Vue({
el: "#app",
data: {
name: "",
age: 0,
},
mounted() {
try {
localStorage.setItem("age", localStorage.getItem("age") +
localStorage.getItem("age"))
this.name += localStorage.getItem("age")
this.name, this.age = localStorage.getItem("name").split(" ");
}
catch {
this.name = "Default";
this.age = "Default";
}
},
methods: {
do_something() {
localStorage.setItem("name", this.name);
localStorage.setItem("age", this.age);
}
}
})

Suppose you open “index.html” file in a browser, and type the text “App Dev II” in the text box shown (after removing the previous text, if any), and hard refresh the page once, without clicking anywhere. What will be the value shown in the text box, and the “age” placeholder, respectively?

  1. A

    Text Box: DefaultDefault
    age Placeholder: Default

  2. B

    Text Box: DefaultDefaultDefaultDefault
    age Placeholder: Default

  3. C

    Text Box: DefaultDefaultDefaultDefault
    age Placeholder: [ "App", "Dev", "II" ]

  4. D

    Text Box: DefaultDefault
    age Placeholder: [ "App", "Dev", "II" ]

Show answer

Correct answer

  • D

    Text Box: DefaultDefault
    age Placeholder: [ "App", "Dev", "II" ]

Question 22

+4.5 marksOne correct option

Consider the below flask app, and an HTML file named “index.html”.

app.py:

python
from flask import Flask
import time
app = Flask(__name__)
@app.route("/endpoint1")
def method1():
time.sleep(20)
return "Endpoint 1 Accessed", 200, {'Access-Control-Allow-Origin' :
'*'}
@app.route("/endpoint2")
def method2():
time.sleep(30)
return "Endpoint 2 Accessed", 200, {'Access-Control-Allow-Origin' :
'*'}
if __name__ == "__main__":
app.run()

index.html:

html
<div>
Hello World !!
<script>
const data1 = fetch("http://127.0.0.1:5000/endpoint1").then(res =>
res.json()).then(data => console.log(data))
const data2 = fetch("http://127.0.0.1:5000/endpoint2").then(res =>
res.json()).then(data => console.log(data))
</script>
</div>

Suppose you open the “index.html” in a browser. What will be the approximate time taken by the second fetch call (i.e., "http://127.0.0.1:5000/endpoint2") to complete and log the data on the console?

  1. A

    20 seconds

  2. B

    30 seconds

  3. C

    10 seconds

  4. D

    50 seconds

Show answer

Correct answer

  • B

    30 seconds

Question 23

+4.5 marksOne correct option

Consider the flask application.

app.py:

python
from flask import Flask
from flask_caching import Cache
import time
config = {
"DEBUG": True,
"CACHE_TYPE": "RedisCache",
"CACHE_REDIS_URL": "redis://localhost:6379/1",
"CACHE_DEFAULT_TIMEOUT": 300
}
app = Flask(__name__)
app.config.from_mapping(config)
cache = Cache(app)
@app.get('/name/<name>')
@cache.cached(timeout=100)
def get_name(name):
time.sleep(50)
return name
if __name__ == '__main__':
app.run()

Suppose the application is running on “http://localhost:5000”. If the client makes two requests to URL “http://localhost:5000/name/mohan” and “http://localhost:5000/name/sohan” within 50 seconds. What will be the approximate absolute difference between their latencies?

  1. A

    30 Seconds

  2. B

    40 Seconds

  3. C

    0 Seconds

  4. D

    None of these

Show answer

Correct answer

  • C

    0 Seconds

Question 24

+4.5 marksOne correct option

Consider the below Vue application with markup file “index.html” and javascript file “app.js”.

app.js:

javascript
new Vue({
el: '#app',
template: `<div>
Enter a point: <input v-model='point' />
<div id='content'>{{isOnCircle?"On the circle":"Not on the circle"}}</div>
</div>`,
data: {
point: null,
},
computed: {
isOnCircle() {
if (!this.point) {
return false
}
const [x, y] = this.point.split(',')
return x ** 2 + y ** 2 < 25
},
},
})

If the application is running on “http://localhost:8080”. What will be rendered by the browser in div with id “content” when user enters “3,5” in the input box?

  1. A

    On the circle

  2. B

    Not on the circle

  3. C

    true

  4. D

    False

Show answer

Correct answer

  • B

    Not on the circle

Question 25

+4.5 marksOne correct option

Consider the below Vue application with markup file “index.html” and javascript file “app.js”.

app.js:

javascript
const Home = {
template: `<div> This is home <router-view /></div>`,
}
const NotFound = {
template: `<div>Not Found</div>`,
}
const Students = {
template: `<ul><li v-for='student in
allStudents'>{{student.name}}</li></ul>`,
data() {
return {
students: [
{ id: 1, name: 'std1', course: 'mad1' },
{ id: 2, name: 'std2', course: 'mad2' },
{ id: 3, name: 'std3', course: 'mad1' },
],
}
},
computed: {
allStudents() {
return this.students.filter((std) => {
return std.id % 2 == 1
})
},
},
}
const Student = {
template: `<div>Name: {{student.name}}, Course: {{student.course}}</div>`,
props: ['id'],
computed: {
student() {
return Students.data().students.find((std) => {
return std.id == (this.id % 5) + 1
})
},
},
}
javascript
const router = new VueRouter({
routes: [
{
path: '/',
component: Home,
children: [
{ path: '', component: Students },
{ path: 'student/:id', component: Student, props: true },
{ path: '*', component: NotFound },
],
},
],
})
new Vue({
el: '#app',
template: `<div><router-view /></div>`,
router,
})

Suppose the application is running on “http://localhost:8080”. What will be rendered by the browser inside the “router-view” component of “Home” Component for the URL “http://localhost:8080/”?

  1. A

    Name: std1, Course: mad1

  2. B

    Name: std2, Course: mad2

  3. C

    std1
    std3

  4. D

    std1
    std2
    std3

Show answer

Correct answer

  • C

    std1
    std3

Question 26

+4.5 marksOne correct option

Consider the below Vue application with markup file “index.html” and javascript file “app.js”.

app.js:

javascript
const Home = {
template: `<div> This is home <router-view /></div>`,
}
const NotFound = {
template: `<div>Not Found</div>`,
}
const Students = {
template: `<ul><li v-for='student in
allStudents'>{{student.name}}</li></ul>`,
data() {
return {
students: [
{ id: 1, name: 'std1', course: 'mad1' },
{ id: 2, name: 'std2', course: 'mad2' },
{ id: 3, name: 'std3', course: 'mad1' },
],
}
},
computed: {
allStudents() {
return this.students.filter((std) => {
return std.id % 2 == 1
})
},
},
}
const Student = {
template: `<div>Name: {{student.name}}, Course: {{student.course}}</div>`,
props: ['id'],
computed: {
student() {
return Students.data().students.find((std) => {
return std.id == (this.id % 5) + 1
})
},
},
}
javascript
const router = new VueRouter({
routes: [
{
path: '/',
component: Home,
children: [
{ path: '', component: Students },
{ path: 'student/:id', component: Student, props: true },
{ path: '*', component: NotFound },
],
},
],
})
new Vue({
el: '#app',
template: `<div><router-view /></div>`,
router,
})

Suppose the application is running on “http://localhost:8080”. What will be rendered by the browser inside the “router-view” component of “Home” Component for the URL “http://localhost:8080/student/20”?

  1. A

    Name: std1, Course: mad1

  2. B

    Name: std2, Course: mad2

  3. C

    Name: std3, Course: mad1

  4. D

    std1
    std2
    std3

Show answer

Correct answer

  • A

    Name: std1, Course: mad1

Question 27

+4.5 marksOne or more correct options

Consider the below Vue component and a Vuex store implementation.

javascript
const store = new Vuex.Store({
state: {
count: 0,
total_cost: 0,
products: [],
},
mutations: {
update_total_cost : Placeholder2
}
})
Vue.component("product", {
template : `<div>
Assume some code
</div>`,
methods : {
update_store_cost : function (count, price) {
Placeholder1
},
}
})

You are supposed to invoke the mutation function “update_total_cost” from the method named “update_store_cost” of the Vue component “product”. The “update_total_cost” mutation function should update the store data variable “total_cost” with an appropriate value. The cost is the product of “count” and “price” parameters of the function “update_store_cost”. Assume that both these parameters are of Numeric type, and need not be typecasted.
Which of the following is/are the possible replacements for “placeholder1” and “placeholder2”?

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • A
  • C

Question 28

+4.5 marksOne or more correct options

Consider the given 2 implementations.

Approach 1:

driver code:

python
import tasks
def generate_reports():
users = User.query.all()
for user in users:
tasks.job_report.delay(user)

celery job:

python
@celery.task
def job_report(user):
'''
This function fetches the statistics of a given user and generates an
HTML report
'''

Approach 2:

driver code:

python
import tasks
def generate_reports():
tasks.job_report.delay()

celery job:

python
@celery.task
def job_report():
users = User.query.all()
for user in users:
'''
This loop fetches the statistics of a given user and generates an HTML
report
'''

Suppose there are currently 1000 users in the database, and the application is supposed to generate 1000 HTML reports. Which of the following statement(s) is/are true (assuming there are more than 1 worker available in the celery system)?

Select all that apply.

  1. A

    Approach 1 will finish the task in less time than approach 2.

  2. B

    Approach 2 will finish the task in less time than approach 1.

  3. C

    Both the approaches are comparable.

  4. D

    Both the approaches will be comparable if there is only 1 worker available.

Show answer

Correct answers

  • A

    Approach 1 will finish the task in less time than approach 2.

  • D

    Both the approaches will be comparable if there is only 1 worker available.

Question 29

+3 marksOne or more correct options

Which of the following statement(s) is/are true regarding flask_caching and caching in general?

Select all that apply.

  1. A

    The cache decorator does not include the function parameters in the cache key.

  2. B

    The memoize decorator does not include the function parameters in the cache key.

  3. C

    The requests without request bodies are generally not cacheable.

  4. D

    Hard refreshing a web page clears the browser cache for that specific web page.

Show answer

Correct answers

  • A

    The cache decorator does not include the function parameters in the cache key.

  • D

    Hard refreshing a web page clears the browser cache for that specific web page.

Question 30

+3 marksOne or more correct options

Which of the following statements is/are true?

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • A
  • C

Question 31

+3 marksOne or more correct options

Select all that apply.

  1. A

    Caching all the players of a country on a backend server.

  2. B

    Caching all the players of a country in the user's browser.

  3. C

    Caching will not improve the performance.

  4. D

    None of these.

Show answer

Correct answers

  • A

    Caching all the players of a country on a backend server.

  • B

    Caching all the players of a country in the user's browser.

Question 32

+3 marksOne or more correct options

Which of the following statement is/are true in context of lighthouse?

Select all that apply.

  1. A

    “First contentful paint” for a webpage is the size of the smallest visible element on a webpage.

  2. B

    “First contentful paint” for a webpage is the time the browser takes to paint the first visible content on the webpage.

  3. C

    “Largest contentful paint” for a webpage is the time the browser takes to paint the largest visible content on the webpage.

  4. D

    “Largest contentfull paint” for a webpage is the size of the largest visible content on the webpage.

Show answer

Correct answers

  • B

    “First contentful paint” for a webpage is the time the browser takes to paint the first visible content on the webpage.

  • C

    “Largest contentful paint” for a webpage is the time the browser takes to paint the largest visible content on the webpage.