uiz Space

September 2025 term · Modern Application Development II · BSCS2006

Modern Application Development II Quiz 2: 23 November 2025 (September 2025 term)

The IIT Madras BS Modern Application Development II (MAD 2) Quiz 2 paper sat on 23 Nov 2025, in the September 2025 term: 16 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
16
Marks
50
Duration
120 min
MCQ
11
MSQ
5

Updated

Official paper: IIT M DIPLOMA AN EXAM QDD2 23 Nov 2025 NEW · No negative marking.

Question 1

+5 marksOne correct option

Consider the following Vue application with markup "index.html" and JavaScript file "app.js".

index.html:

html
<div id="app">
<card-component>
<template #title>
Welcome Message
</template>
<p>Main card content here</p>
<template #default>
Default slot content
</template>
<template #actions>
<button>Click Me</button>
</template>
</card-component>
</div>
<script src="app.js"></script>

app.js:

javascript
Vue.component("cardComponent", {
template: `<div class="card">
<h2>
<slot name="title"></slot>
</h2>
<div class="content">
<slot></slot>
</div>
<div class="footer">
<slot name="footer"></slot>
</div>
</div>`,
})
const app = new Vue({
el: "#app",
})

Suppose you open the "index.html" file in a browser. What will be rendered by the browser?

  1. A

    Welcome Message
    Main card content here
    Default slot content
    Click Me

  2. B

    Welcome Message
    Default slot content

  3. C

    Welcome Message
    Main card content here
    Default slot content

  4. D

    Welcome Message
    Main card content here

  5. E

    Welcome Message
    Default slot content
    Click Me

Show answer

Correct answer

  • B

    Welcome Message
    Default slot content

Question 2

+5 marksOne correct option

Consider the below JavaScript program.

javascript
new Promise((resolve, reject) => {
if (10 > 5) reject(15)
else resolve(25)
})
.then(d => {
console.log("Success handler", d);
return d * 2;
}, d => {
console.log("Error handler", d);
throw new Error(30);
})
.catch(e => {
console.log("Catch block", e.message);
return e.message / 2;
})
.then(d => {
console.log("Next then", d);
return d + 10;
})
.finally(d => {
console.log("Finally block", d);
return d * 100;
})
.then(d => {
console.log("Final then", d);
return d * 3;
})

What will be the output of the above program?

  1. A

    Error handler 15
    Catch block 30
    Next then 15
    Finally block 30
    Final then 25

  2. B

    Success handler 25
    Next then 50
    Finally block undefined
    Final then 60

  3. C

    Error handler 15
    Catch block 30
    Next then 15
    Finally block 25
    Final then 75

  4. D

    Error handler 15
    Catch block 30
    Next then 15
    Finally block undefined
    Final then 25

Show answer

Correct answer

  • D

    Error handler 15
    Catch block 30
    Next then 15
    Finally block undefined
    Final then 25

Question 3

+3 marksOne correct option

Consider the below Vue component.

html
<template>
<div>
<p>{{ counter }}</p>
<button @click="incrementCounter">Increment</button>
</div>
</template>
html
<script>
export default {
data() {
return {
counter: 0
};
},
methods: {
incrementCounter() {
this.counter = this.counter + 2;
this.counter = this.counter * 2;
this.counter = this.counter - 5;
}
}
};
</script>

What will be displayed in the <p> element after the button with text "Increment" is clicked twice?

  1. A

    0

  2. B

    -1

  3. C

    -5

  4. D

    -3

  5. E

    2

Show answer

Correct answer

  • D

    -3

Question 4

+2 marksOne or more correct options

Which of the following statement(s) is/are true about Vue.js event handling and communication?

Select all that apply.

  1. A

    The $emit method is used by child components to send custom events to parent components.

  2. B

    Event modifiers like .prevent and .stop can be chained together on the same event listener.

  3. C

    The v-on directive can only be used with native DOM events and cannot handle custom events.

  4. D

    Parent components can listen to child component events using the v-on or @ syntax in the template.

Show answer

Correct answers

  • A

    The $emit method is used by child components to send custom events to parent components.

  • B

    Event modifiers like .prevent and .stop can be chained together on the same event listener.

  • D

    Parent components can listen to child component events using the v-on or @ syntax in the template.

Question 5

+3 marksOne or more correct options

Consider the below Vue class binding and select the most appropriate option(s)

Select all that apply.

  1. A

    The class "active" will be applied to the div element only when the variable "isActive" evaluates to true.

  2. B

    The class "text-bold" will always be applied to the div element regardless of the value of "isBold".

  3. C

    The class "hidden" will be applied to the div element when the variable "isVisible" evaluates to false.

  4. D

    All three classes will be applied simultaneously if "isActive", "isBold", and "isVisible" are all true.

Show answer

Correct answers

  • A

    The class "active" will be applied to the div element only when the variable "isActive" evaluates to true.

  • C

    The class "hidden" will be applied to the div element when the variable "isVisible" evaluates to false.

Question 6

+3 marksOne correct option

Consider the below Vue router setup.

javascript
const User = {
template: `<div><h1>User Profile</h1><router-view></router-view></div>`
};
const UserPosts = {
template: `<div><h2>Posts by {{ $route.params.username }}</h2></div>`
};
const UserSettings = {
template: `<div><h2>Settings</h2></div>`
};
const routes = [
{
path: '/user/:username',
component: User,
children: [
{
path: 'posts',
component: UserPosts
},
{
path: 'settings',
component: UserSettings
}
]
}
];
const router = new VueRouter({
routes
});

What will be the behavior when the user visits "/user/john/posts"?

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

Correct answer

  • C

Question 7

+3 marksOne correct option

Consider the following Flask application configuration for Flask-Security, with the User and Role models properly defined with flask-sqlalchemy.

A user successfully logs in to the application. Based on this configuration, which of the following statements is MOST ACCURATE?

  1. A

    The user's authentication token will be sent in the response header named "X- Auth-Token" and can be used for subsequent API requests.

  2. B

    CSRF protection blocks cross-origin requests to protect against malicious applications accessing sensitive data.

  3. C

    The authentication token will be generated using the SECRET_KEY = “production-secret- key".

  4. D

    The authentication token will be generated using the argon2 algorithm, since SECURITY_PASSWORD_HASH is set to "argon2".

Show answer

Correct answer

  • A

    The user's authentication token will be sent in the response header named "X- Auth-Token" and can be used for subsequent API requests.

Question 8

+2 marksOne correct option

When using Vue 2 via CDN in a plain HTML file, which of the following is the correct practice?

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

Correct answer

  • B

Question 9

+3 marksOne or more correct options

Considering that in this code Vue.js 2 CDN is used.

Index.html

html
<div id="app">
<input v-model="username">
<p>Hello, {{ username }}</p>
</div>
<script>
var app = new Vue({
el: "#app",
data: {
username: "Guest"
}
});
</script>

Which of the following statements is/are true?

Select all that apply.

  1. A

    Typing in the input updates the paragraph instantly.

  2. B

    This demonstrates one-way data binding.

  3. C

    If the username value is changed from the console, the input field also updates.

  4. D

    If the directive v-model is replaced with v-bind, the code will work the same way as it was working before.

Show answer

Correct answers

  • A

    Typing in the input updates the paragraph instantly.

  • C

    If the username value is changed from the console, the input field also updates.

Question 10

+2 marksOne correct option

Which of the following is NOT true about Vuex compared to a Vue component?

  1. A

    Vuex stores data globally and can be accessed across components.

  2. B

    Vuex requires actions, mutations, and state separation.

  3. C

    Vuex avoids deeply nested prop-passing.

  4. D

    Vuex makes every component completely independent, with no shared data.

Show answer

Correct answer

  • D

    Vuex makes every component completely independent, with no shared data.

Question 11

+3 marksOne or more correct options

Consider in this code Vue.js 2 CDN is used.

Index.html

html
<div id="app">
<ul>
<li v-for="user in users">{{ user.name }}</li>
</ul>
<button @click="fetchUsers">Load Users</button>
</div>
<script>
new Vue({
el: "#app",
data: { users: [] },
methods: {
fetchUsers() {
fetch("https://jsonplaceholder.typicode.com/users")
.then(res => res.json())
.then(data => { this.users = data; });
}
}
});
</script>

Which of the following statements is/are correct, assuming the given API is working?

Select all that apply.

  1. A

    Clicking the button fetches users and updates DOM.

  2. B

    Vue automatically re-renders the list when users changes.

  3. C

    v-for is used for conditional rendering.

  4. D

    The code demonstrates Vue’s reactivity system.

Show answer

Correct answers

  • A

    Clicking the button fetches users and updates DOM.

  • B

    Vue automatically re-renders the list when users changes.

  • D

    The code demonstrates Vue’s reactivity system.

Question 12

+2 marksOne or more correct options

Which statements are correct about cross-browser testing in Vue.js applications?

Select all that apply.

  1. A

    Ensures UI works consistently in Chrome, Firefox, Safari, Edge etc.

  2. B

    Tools like Cypress, Selenium, and BrowserStack can be used.

  3. C

    It is unnecessary since Vue handles all rendering.

  4. D

    Some CSS/JavaScript features may behave differently across browsers.

Show answer

Correct answers

  • A

    Ensures UI works consistently in Chrome, Firefox, Safari, Edge etc.

  • B

    Tools like Cypress, Selenium, and BrowserStack can be used.

  • D

    Some CSS/JavaScript features may behave differently across browsers.

Question 13

+4 marksOne correct option

Consider this Vue 2 (CDN) method inside a component.

javascript
methods: {
async submit() {
const response = await fetch('/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username: 'Asha' })
});
const data = response.json();
localStorage.setItem('userId', data.id);
}
}

If the ID of the user “Asha” in the database is 7, What will be stored in localStorage under the key "userId" after submit() runs?

  1. A

    "7" (string)

  2. B

    7 (number)

  3. C

    "undefined" (string)

  4. D

    "[object Promise]" (string)

Show answer

Correct answer

  • C

    "undefined" (string)

Question 14

+3 marksOne correct option

Which one of the following statements about Vuex is correct?

  1. A

    Getters are used to modify the store’s state and must be synchronous.

  2. B

    Mutations are the only way to directly modify Vuex state, and they should be synchronous.

  3. C

    Actions directly modify state and must not return Promises.

  4. D

    You can call mutations asynchronously (e.g., use setTimeout inside a mutation) without side effects.

Show answer

Correct answer

  • B

    Mutations are the only way to directly modify Vuex state, and they should be synchronous.

Question 15

+4 marksOne correct option

Consider the following Vue SFC.

html
<template>
<div>
<p v-if="loading">Loading...</p>
<p v-else>{{ data }}</p>
</div>
</template>
<script>
export default {
data() {
return { data: null, loading: true }
},
async mounted() {
this.data = await Promise.resolve('Hello MAD2');
this.loading = false;
}
}
</script>

What finally appears on the browser?

  1. A

    Nothing renders

  2. B

    “Loading…” remains

  3. C

    Hello MAD2

  4. D

    Error (await in mounted)

Show answer

Correct answer

  • C

    Hello MAD2

Question 16

+3 marksOne correct option

Consider the following JavaScript code.

What will be logged on the browser’s console?

  1. A

    Error: Network Down
    Done

  2. B

    Done
    Error: Network Down

  3. C

    Error: Network Down

  4. D

    Error: Unhandled Promise rejection

Show answer

Correct answer

  • A

    Error: Network Down
    Done