Question 1
In Vue 2, what happens when you update a data property?
DOM is immediately updated without virtual DOM
The page reloads
The virtual DOM detects changes and updates efficiently
A full component re-renders from scratch
In Vue 2, what happens when you update a data property?
DOM is immediately updated without virtual DOM
The page reloads
The virtual DOM detects changes and updates efficiently
A full component re-renders from scratch
Consider the following HTML, with the correct Vue 2 CDN links included:
Html code.
<div id="app"> <h3>Shopping Cart</h3> <p>Items: {{itemCount}}</p> <p>Total Cost: ${{totalCost}}</p> <button @click="addItem">Add Item ($15)</button> <button @click="removeItem">Remove Item</button> <p>Status: {{status}}</p></div>script:
const app = new Vue({ el: '#app', data() { return { itemCount: 0, itemPrice: 15, totalCost: 0 } }, computed: { status() { if (this.itemCount === 0) { return 'Empty Cart'; } else if (this.itemCount < 3) { return 'Few Items'; } else { return 'Full Cart';
} } }, methods: { addItem() { this.itemCount++; this.totalCost += this.itemPrice; }, removeItem() { if (this.itemCount > 0) { this.itemCount--; this.totalCost -= this.itemPrice; } } }})If the user clicks the "Add Item" button 3 times, then clicks the "Remove Item" button 1 time, what will be displayed for Items, Total Cost, and Status?
Items: 2, Total Cost: $30, Status: Few Items
Items: 2, Total Cost: $45, Status: Few Items
Items: 3, Total Cost: $30, Status: Full Cart
Items: 2, Total Cost: $30, Status: Full Cart
Items: 1, Total Cost: $15, Status: Few Items
Consider the following code.
const arr = [1, 2, 3];const result = arr.map(function(item, index) { return this[index] * item;}, [10, 20, 30]);console.log(result);What will be the output?
[1, 2, 3]
[10, 40, 90]
[10, 20, 30]
[NaN, NaN, NaN]
Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.
The IIT Madras BS Modern Application Development II (MAD 2) Quiz 1 paper sat on 13 Jul 2025, in the May 2025 term: 16 questions for 50 marks in 120 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.
| Feature | MAD 2 Quiz 1 13 Jul 2025 at a glance |
|---|---|
| Term | May 2025 term |
| Subject | Modern Application Development II |
| Course code | BSCS2006 |
| Questions | 16 |
| Marks | 50 |
| Duration | 120 min |
| MCQ | 15 |
| MSQ | 1 |
| Official paper | IIT M DIPLOMA AN EXAM QDD2 13 July 2025 |
| Negative marking | No negative marking. |
| Updated |