uiz Space

September 2025 term · Modern Application Development II · BSCS2006

Modern Application Development II Quiz 1: 26 October 2025 (September 2025 term)

The IIT Madras BS Modern Application Development II (MAD 2) Quiz 1 paper sat on 26 Oct 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
MSQ
7
MCQ
8
Numerical
1

Updated

Official paper: IIT M DIPLOMA AN EXAM QDD2 26 Oct 2025 · No negative marking.

Question 1

+2 marksOne or more correct options

Which of the following Vue 2 template syntaxes are valid?

Select all that apply.

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

Correct answers

  • A
  • B
  • D

Question 2

+2 marksOne or more correct options

Which of the following statements about Vue 2 templates are correct?

Select all that apply.

  1. A

    v-if removes elements from DOM when false

  2. B

    v-show toggle initiates re-render of the Vue component

  3. C

    v-bind can bind attributes and class dynamically

  4. D

    Vue 2 templates must use double curly braces for all text interpolation

Show answer

Correct answers

  • A

    v-if removes elements from DOM when false

  • C

    v-bind can bind attributes and class dynamically

Question 3

+3 marksOne correct option

Consider the following JavaScript code:

javascript
let employees = [
{ name: "Rahul", age: 28 },
{ name: "Priya", age: 24 },
{ name: "Amit", age: 32 }
];
employees.sort((a, b) => a.age - b.age);
console.log(employees.map(e => e.name).join(" - "));

What will be printed on the console?

  1. A

    Rahul - Priya - Amit

  2. B

    Priya - Rahul - Amit

  3. C

    Amit - Rahul - Priya

  4. D

    Priya - Amit - Rahul

Show answer

Correct answer

  • B

    Priya - Rahul - Amit

Question 4

+3 marksOne correct option

Consider the following JavaScript code snippet.

javascript
const users = [
{ name: "Amit", age: 25 },
{ name: "Bhavna", age: 20 },
{ name: "Chirag", age: 30 },
];
const names = users
.filter((u) => u.age >= 25)
.map((u) => u.name.toUpperCase())
.sort();
console.log(JSON.stringify(names));

What is logged on the console?

  1. A

    ['Amit', 'Chirag']

  2. B

    ['CHIRAG', 'AMIT']

  3. C

    ['AMIT', 'CHIRAG']

  4. D

    ['AMIT', 'Bhavna', 'CHIRAG']

Show answer

Correct answer

  • C

    ['AMIT', 'CHIRAG']

Question 5

+3 marksOne correct option

Consider the following JavaScript code snippet.

javascript
let subject = "Dog";
function camera() {
let subject = "Deer";
function click() {
console.log(`clicked picture of ${subject}`);
}
subject = "Cat";
return click;
}
let cameraPicture = camera();
cameraPicture();

What is logged to the console?

  1. A

    clicked picture of Dog

  2. B

    clicked picture of Deer

  3. C

    clicked picture of Cat

  4. D

    clicked picture of undefined

Show answer

Correct answer

  • C

    clicked picture of Cat

Question 6

+3 marksOne correct option
  1. A

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

  2. B

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

  3. C

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

  4. D

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

Show answer

Correct answer

  • C

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

Question 7

+3 marksOne correct option

Consider the following HTML, with the correct Vue 2 CDN links included

html
<body>
<div id="app">
<p>Coffee</p>
<button @click="orderCoffee">Order</button>
<p>Total Cost: {{totalCost}}</p>
<p>Order Count: {{orderCount}}</p>
</div>
<script>
new Vue({
el: '#app',
data() {
return {
totalCost: '0',
unitPrice: 25,
orderCount: 0
}
},
methods: {
orderCoffee() {
this.totalCost += this.unitPrice;
this.orderCount++;
}
}
})
</script>
</body>

What will be displayed for "Total Cost" and "Order Count" when the Order button is clicked three times?

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

Correct answer

  • D

Question 8

+3 marksOne or more correct options

Consider this nested loop is written in JavaScript:

javascript
let result = "";
for (let i = 0; i < 2; i++) {
for (var j = 0; j < 2; j++) {
result += i + j;
}
}
console.log(result);

Which of the following statements is/are true?

Select all that apply.

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

Correct answers

  • B
  • D

Question 9

+3 marksOne or more correct options

Consider the following HTML and JavaScript code.

HTML file

html
<button id="btn">Click Me</button>
<script>
const btn = document.getElementById('btn');
btn.addEventListener('click', () => console.log('A'));
btn.onclick = () => console.log('B');
btn.addEventListener('click', () => console.log('C'));
btn.click();
</script>

Among the following console log statements, which ones will be logged when the code executes?

(Select all that apply, irrespective of the order.)

Select all that apply.

  1. A

    A

  2. B

    B

  3. C

    C

  4. D

    None

Show answer

Correct answers

  • A

    A

  • B

    B

  • C

    C

Question 10

+3 marksNumerical answer

Consider the following HTML and JavaScript, assume Vue 2 CDN link to be already included.

index.html:

html
<div id="app">
<p v-for="n in numbers">{{ n }}</p>
</div>
<script src="app.js" />

app.js:

javascript
var app = new Vue({
el: "#app",
data: { numbers: [1, 2, 3] },
});
app.data.numbers.push(4);

How many <p> elements will be rendered?

Show answer

Correct answer: 3

Question 11

+4.5 marksOne correct option

Consider the following JavaScript code snippet:

javascript
const products = [
{ name: 'Laptop', price: 1200, category: 'Electronics', inStock: true },
{ name: 'Book', price: 25, category: 'Education', inStock: false },
{ name: 'Phone', price: 800, category: 'Electronics', inStock: true },
{ name: 'Pen', price: 5, category: 'Stationery', inStock: true },
{ name: 'Tablet', price: 600, category: 'Electronics', inStock: false }
];
const result = products
.filter(item => item.category === 'Electronics' && item.inStock)
.map(item => ({ ...item, discountedPrice: item.price * 0.9 }))
.filter(item => item.discountedPrice > 500);
console.log(result.length);
console.log(result[0].name);

What will be the output of the above code on the browser's console?

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

Correct answer

  • B

Question 12

+4.5 marksOne correct option

Consider the below JavaScript program:

javascript
const globalVar = 50;
const object1 = {
globalVar: 100,
method1: function() {
console.log(globalVar, this.globalVar);
return () => {
console.log(globalVar, this.globalVar);
}
}
}
const object2 = {
globalVar: 200,
method2: () => {
console.log(globalVar, this.globalVar);
return function() {
console.log(globalVar, this.globalVar);
}
}
}
const fn1 = object1.method1();
fn1();
const fn2 = object2.method2();
fn2();

What will be the output of the above program on the browser's console, if executed?

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

Correct answer

  • A

Question 13

+4.5 marksOne or more correct options

Consider the following JavaScript code:

javascript
class Region {
constructor(region) {
this.region = region;
}
describe() {
return `${this.region} is a region.`;
}
}
class Country extends Region {
constructor(region, name) {
super(region);
this.name = name;
}
describe() {
return `${this.name} is in ${this.region}.`;
}
}
let r = new Region("Asia");
let c = new Country("Europe", "Germany");
let f = c.describe;

Which of the following statements are true?

Select all that apply.

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

Correct answers

  • A
  • B
  • D

Question 14

+4.5 marksOne or more correct options

Select all that apply.

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

Correct answers

  • B
  • C

Question 15

+2 marksOne correct option

Read the Vue.js code and answer the given subquestions. The parent binds an input with v-model and passes the value as a prop to a child component; the child contains a named slot that shows the message in uppercase.

html
<div id="app">
<p>{{ message }}</p>
<input v-model="message" />
<child-component :title="message">
<template slot="header">
<h3>{{ message.toUpperCase() }}</h3>
</template>
</child-component>
</div>
<script>
Vue.component('child-component', {
props: ['title'],
template: `
<div>
<h2>{{ title }}</h2>
<slot name="header"></slot>
<p>Child Content</p>
</div>
`
});
new Vue({
el: '#app',
data: {
message: 'Hello Vue'
}
});
</script>
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 16

+2 marksOne or more correct options

Read the Vue.js code and answer the given subquestions. The parent binds an input with v-model and passes the value as a prop to a child component; the child contains a named slot that shows the message in uppercase.

html
<div id="app">
<p>{{ message }}</p>
<input v-model="message" />
<child-component :title="message">
<template slot="header">
<h3>{{ message.toUpperCase() }}</h3>
</template>
</child-component>
</div>
<script>
Vue.component('child-component', {
props: ['title'],
template: `
<div>
<h2>{{ title }}</h2>
<slot name="header"></slot>
<p>Child Content</p>
</div>
`
});
new Vue({
el: '#app',
data: {
message: 'Hello Vue'
}
});
</script>

Select all that apply.

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

Correct answers

  • A
  • B
  • C