MAD Study Hub

Home / Past papers / MAD2 Quiz 1 / this paper

IIT M DIPLOMA AN EXAM QDD4 26 Oct 2025 - 26 Oct 2025

MAD2 Quiz 116 questions50 marks8 MCQ · 7 MSQ · 1 SADiploma / afternoon / QDD4
Elapsed 00:00
Q1MSQ2 marksselect all that apply
Which of the following Vue 2 template syntaxes are valid?
  1. question figure
    text
    ```
    {{ message }} for interpolation
    ```
  2. question figure
    text
    ```html
    v-bind:title="msg"
    ```
    for binding attributes
  3. question figure
    text
    ```html
    v-on:@click="doSomething"
    ```
    for click event binding
  4. question figure
    text
    ```html
    <input v-model="inputValue"></input>
    ```
    for two-way binding
Q2MSQ2 marksselect all that apply
Which of the following statements about Vue 2 templates are correct?
  1. v-if removes elements from DOM when false
  2. v-show toggle initiates re-render of the Vue component
  3. v-bind can bind attributes and class dynamically
  4. Vue 2 templates must use double curly braces for all text interpolation
Q3MCQ3 marks
question figure
Text of the picture (copyable)
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. Rahul - Priya - Amit
  2. Priya - Rahul - Amit
  3. Amit - Rahul - Priya
  4. Priya - Amit - Rahul
Q4MCQ3 marks
question figure
Text of the picture (copyable)
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. ['Amit', 'Chirag']
  2. ['CHIRAG', 'AMIT']
  3. ['AMIT', 'CHIRAG']
  4. ['AMIT', 'Bhavna', 'CHIRAG']
Q5MCQ3 marks
question figure
Text of the picture (copyable)
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. clicked picture of Dog
  2. clicked picture of Deer
  3. clicked picture of Cat
  4. clicked picture of undefined
Q6MCQ3 marks
question figure
Text of the picture (copyable)
Match the following Vue 2 directives in Column A with their correct functionality in Column B:

| Column A | Column B |
|---|---|
| 1. v-bind | A. Creates two-way data binding between form inputs and Vue data properties |
| 2. v-model | B. Conditionally shows or hides elements using CSS display property |
| 3. v-on | C. Binds HTML attributes or component properties to Vue data expressions |
| 4. v-show | D. Attaches event listeners to DOM elements for handling user interactions |
| 5. v-cloak | E. Prevents the flash of un-compiled template content before Vue initializes |
  1. 1-C, 2-D, 3-A, 4-E, 5-B
  2. 1-A, 2-C, 3-B, 4-D, 5-E
  3. 1-C, 2-A, 3-D, 4-B, 5-E
  4. 1-E, 2-A, 3-D, 4-C, 5-B
Q7MCQ3 marks
question figure
Text of the picture (copyable)
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. question figure
    text
    Total Cost: 75, Order Count: 3
  2. question figure
    text
    Total Cost: 02525, Order Count: 3
  3. question figure
    text
    Total Cost: 252525, Order Count: 3
  4. question figure
    text
    Total Cost: 0252525, Order Count: 3
Q8MSQ3 marksselect all that apply
question figure
Text of the picture (copyable)
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?
  1. question figure
    text
    The output is "0011".
  2. question figure
    text
    The inner loop runs 2 times for each outer loop iteration.
  3. question figure
    text
    The output is "0123"
  4. question figure
    text
    The values are concatenated into a **string**, not added as numbers.
Q9MSQ3 marksselect all that apply
question figure
Text of the picture (copyable)
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.)
  1. A
  2. B
  3. C
  4. None
Q10SA3 marks
question figure
Text of the picture (copyable)
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" ></script>
```

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?
Q11MCQ4.5 marks
question figure
Text of the picture (copyable)
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. question figure
    text
    ```
    3
    Laptop
    ```
  2. question figure
    text
    2
    Laptop
  3. question figure
    text
    1
    Phone
  4. question figure
    text
    2
    Phone
Q12MCQ4.5 marks
question figure
Text of the picture (copyable)
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. question figure
    text
    ```
    50 100
    50 100
    50 undefined
    50 undefined
    ```
  2. question figure
    text
    ```
    50 100
    50 100
    50 undefined
    50 200
    ```
  3. question figure
    text
    ```
    100 50
    100 50
    200 50
    200 50
    ```
  4. question figure
    text
    ```
    50 100
    50 100
    50 undefined
    50 this
    ```
Q13MSQ4.5 marksselect all that apply
question figure
Text of the picture (copyable)
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**?
  1. question figure
    text
    Calling r.describe() prints "Asia is a region."
  2. question figure
    text
    Calling c.describe() prints "Germany is in Europe."
  3. question figure
    text
    Calling f() directly will still print "Germany is in Europe."
  4. question figure
    text
    The Country class overrides both the **constructor** and the **describe()** method from Region.
  5. question figure
    text
    The call to super (region) inside Country's constructor is **not required** to initialize this.region.
Q14MSQ4.5 marksselect all that apply
question figure
Text of the picture (copyable)
Consider the following JavaScript function definitions. Which of the following will correctly return the product of three numbers and handle the case where any parameter is undefined by treating it as 1?
  1. question figure
    text
    ```javascript
    let multiply = (a, b, c) => {
        a = a || 1;
        b = b || 1;
        c = c || 1;
        return a * b * c;
    }
    ```
  2. question figure
    text
    ```javascript
    function multiply(a = 1, b = 1, c = 1) {
      return a * b * c;
    }
    ```
  3. question figure
    text
    ```javascript
    let multiply = (a, b, c) => {
      return (a ?? 1) * (b ?? 1) * (c ?? 1);
    }
    ```
  4. question figure
    text
    ```javascript
    const multiply = function(a, b, c) {
        if(a === undefined) a = 1;
        if(b === undefined) b = 1;
        if(c === undefined) c = 1;
        a * b * c;
    }
    ```
Comprehension passage - the questions below it refer to this
question figure
Q15MCQ2 marks
question figure
Text of the picture (copyable)
If the user types "hi" into the input box,
what happens on the page, choose
the closest to correct?
  1. question figure
    text
    Only `<p>` updates to "hi", but `<h2>` remains "Hello Vue".
  2. question figure
    text
    Both `<p>` and `<h2>` update and display "h1".
  3. question figure
    text
    Only `<h3>` changes to "HI", but `<p>` and `<h2>` remain unchanged.
  4. question figure
    text
    Nothing updates at all.
Q16MSQ2 marksselect all that apply
question figure
Text of the picture (copyable)
Which Vue.js features are shown in the code?
  1. question figure
    text
    Two-way data binding using v-model.
  2. question figure
    text
    Use of a named `slot` inside a child component.
  3. question figure
    text
    Passing values from parent to child using props.
  4. question figure
    text
    Use of lifecycle hooks.

Answer key

  1. Q1 (MSQ, 2 marks): A, B, D
  2. Q2 (MSQ, 2 marks): A, C
  3. Q3 (MCQ, 3 marks): B
  4. Q4 (MCQ, 3 marks): C
  5. Q5 (MCQ, 3 marks): C
  6. Q6 (MCQ, 3 marks): C
  7. Q7 (MCQ, 3 marks): D
  8. Q8 (MSQ, 3 marks): B, D
  9. Q9 (MSQ, 3 marks): A, B, C
  10. Q10 (SA, 3 marks): 3
  11. Q11 (MCQ, 4.5 marks): B
  12. Q12 (MCQ, 4.5 marks): A
  13. Q13 (MSQ, 4.5 marks): A, B, D
  14. Q14 (MSQ, 4.5 marks): B, C
  15. Q15 (MCQ, 2 marks): B
  16. Q16 (MSQ, 2 marks): A, B, C

Concepts this paper tests

Auto-generated summary from the source site. Handy as a checklist; the lessons above explain each idea from scratch.

Based on the provided question paper for "Diploma Level: Modern Application Development II", the core topics, concepts, and principles revolve around Vue.js 2 (a progressive JavaScript framework for building user interfaces). Below is a structured summary of the key areas to focus on for the exam, along with a Mermaid knowledge graph to visualize the relationships between topics.


Core Topics & Concepts

1. Vue.js 2 Template Syntax

2. Conditional Rendering

3. Dynamic Attribute Binding (v-bind)

4. Event Handling (v-on)

5. Two-Way Data Binding (v-model)

6. List Rendering (v-for)

7. Computed Properties vs Methods vs Watchers

FeatureComputed PropertiesMethodsWatchers
Use CaseCached, reactive dataGeneric functions (not cached).Reactive to specific data changes.
Syntaxcomputed: { fullName() { ... } }methods: { greet() { ... } }watch: { dataProp(newVal) { ... } }
PerformanceEfficient (cached until dependencies change).Re-evaluates on every render.Runs asynchronously.

8. Vue Instance Lifecycle Hooks

9. Components & Props

10. Event Bus (for Cross-Component Communication)

// In component B: this.$on('custom-event', (data) => { ... }); ```

11. Vue CLI & Project Structure

12. Vue Router (Client-Side Routing)

13. State Management (Vuex)

14. Axios for HTTP Requests

15. Form Handling & Validation


Key Equations/Code Snippets (Math/Logic)

While this exam is primarily Vue.js-focused, some questions (e.g., Q11) may involve basic JavaScript logic or array methods. Here are essential snippets:

  1. Array Filtering: ``javascript const names = ['Amit', 'Chirag', 'Bhavna']; const filtered = names.filter(name => name.toUpperCase().startsWith('A')); // Result: ['Amit'] ``
  1. Object/Array Destructuring: ``javascript const user = { name: 'Amit', age: 25 }; const { name } = user; // name = 'Amit' ``
  1. Arrow Functions: ``javascript const greet = (name) => Hello, ${name}!; ``
  1. Promise Handling: ``javascript fetch('https://api.example.com') .then(response => response.json()) .then(data => console.log(data)); ``
  1. Async/Await: ``javascript async function fetchData() { const response = await fetch('https://api.example.com'); const data = await response.json(); return data; } ``

1. Vue.js Core Concepts

2. Vue Ecosystem Tools


Exam Preparation Tips

  1. Practice Vue.js Syntax:

    • Write small components using v-if, v-for, v-bind, and v-model.
    • Experiment with computed properties vs methods.
  1. Understand Lifecycle Hooks:

    • Know when each hook is called (e.g., created vs mounted).
  1. Master Component Communication:

    • Props (parent → child), events ($emit child → parent), and Event Bus.
  1. Vue Router & Vuex:

    • Set up a mini project with routes and a central store.
  1. Debugging:

    • Use Vue DevTools to inspect component hierarchy and state.
  1. Review Official Docs:

  1. Solve Practical Problems:

    • Build a to-do app with:

      • Add/delete tasks (v-model, v-for).
      • Filter tasks (computed).
      • Persist to localStorage (watch or created hook).