uiz Space

September 2025 term · Modern Application Development II · BSCS2006

Modern Application Development II End Term: 21 December 2025 (September 2025 term)

The IIT Madras BS Modern Application Development II (MAD 2) End Term paper sat on 21 Dec 2025, in the September 2025 term: 29 questions for 89 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
29
Marks
89
Duration
180 min
MSQ
5
MCQ
24

Updated

Official paper: Modern Application Development Ii 18 Dec 25 · No negative marking.

Question 1

+2 marksOne or more correct options

Considering the following code snippet, which statements are true about components in Vue?

Select all that apply.

  1. A

    Parent can listen with @update

  2. B

    Parent receives payload via $event

  3. C

    Child can directly modify parent state

  4. D

    $emit triggers a DOM event

Show answer

Correct answers

  • A

    Parent can listen with @update

  • B

    Parent receives payload via $event

Question 2

+3 marksOne correct option

Consider the following JavaScript code snippet.

What will be printed on the console?

  1. A

    2

  2. B

    4

  3. C

    Undefined

  4. D

    Error

Show answer

Correct answer

  • B

    4

Question 3

+2 marksOne correct option

Which of the following is considered a good practice for securing user authentication in a web application?

  1. A

    Storing passwords as plain text in the database for quick lookup

  2. B

    Using hashing algorithms like "bcrypt" or "Argon2" to store passwords securely

  3. C

    Including user passwords directly in SQL queries for verification

  4. D

    All of these

Show answer

Correct answer

  • B

    Using hashing algorithms like "bcrypt" or "Argon2" to store passwords securely

Question 4

+2 marksOne correct option

In the following code snippet, which values should replace option1 and option2 so that the cookie is sent only over HTTPS and is restricted from cross-site requests?

  1. A

    secure=True and samesite='Strict'

  2. B

    secure=False and samesite='Strict'

  3. C

    secure=True and samesite='None'

  4. D

    secure=False and samesite='Lax'

Show answer

Correct answer

  • A

    secure=True and samesite='Strict'

Question 5

+3 marksOne correct option

When comparing Redis with a typical API data store (like a relational database accessed through REST APIs), which of the following statements is true?

  1. A

    Redis can only store strings, unlike API data stores which can handle complex structures.

  2. B

    Redis is an in-memory data structure store, often used as a cache or message broker to complement API-based data stores.

  3. C

    Redis is a relational database and queries data using SQL, just like an API data store.

  4. D

    Redis is slower than API-based databases because it stores everything in memory.

Show answer

Correct answer

  • B

    Redis is an in-memory data structure store, often used as a cache or message broker to complement API-based data stores.

Question 6

+3 marksOne correct option

How can you stop a Cross-Site Scripting (XSS) attack?

  1. A

    Backend validation of user input and make sure any user-provided text is not executed as code.

  2. B

    Store authentication token or jwt in cookies.

  3. C

    Use v-html to show user generated data.

  4. D

    Send cookies with every request to the backend.

Show answer

Correct answer

  • A

    Backend validation of user input and make sure any user-provided text is not executed as code.

Question 7

+2 marksOne or more correct options

Which of the following describe Redis features correctly?

Select all that apply.

  1. A

    In-memory database

  2. B

    Can support publish-subscribe (pub/sub)

  3. C

    Can be used as Celery result backend

  4. D

    Requires SQL to query

Show answer

Correct answers

  • A

    In-memory database

  • B

    Can support publish-subscribe (pub/sub)

  • C

    Can be used as Celery result backend

Question 8

+2 marksOne correct option

Which of the following is true about Vuex state?

  1. A

    It should be modified only through mutations

  2. B

    It should be modified only through actions

  3. C

    It cannot contain nested objects

  4. D

    It should be modified by getters

Show answer

Correct answer

  • A

    It should be modified only through mutations

Question 9

+2 marksOne correct option

What is the purpose of Redis in a Celery-based system?

  1. A

    To automatically retry failed tasks

  2. B

    To execute tasks in parallel

  3. C

    To return computed results in JSON format

  4. D

    To store scheduled tasks and serve as a message broker

Show answer

Correct answer

  • D

    To store scheduled tasks and serve as a message broker

Question 10

+3 marksOne correct option

What happens to the fetch call when it gets a 404 status code (page not found)?

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

Correct answer

  • C

Question 11

+3 marksOne correct option

Consider the following JavaScript snippet.

What will be printed on the browser's console?

  1. A

    [2, 4, 6]

  2. B

    [6]

  3. C

    [4, 6]

  4. D

    [1, 2, 3]

Show answer

Correct answer

  • B

    [6]

Question 12

+3 marksOne correct option

Consider the following JavaScript snippet:

What will be printed on the browsers' console?

  1. A

    50

  2. B

    undefined

  3. C

    Error

  4. D

    7

Show answer

Correct answer

  • D

    7

Question 13

+4 marksOne correct option

Consider the following Vue Router setup and HTML.

Suppose the webpage is served at http://127.0.0.1:5000. A user visits the URL http://127.0.0.1:5000/\#/user/10/orders. What will be rendered on the browser?

  1. A

    User Orders

  2. B

    User 10 User Overview

  3. C

    User 10 User Orders

  4. D

    Nothing is rendered because sibling routes overwrite the parent route.

Show answer

Correct answer

  • C

    User 10 User Orders

Question 14

+3 marksOne correct option

Consider the following JavaScript code snippet where a web application manages user preferences using localStorage. A user opens the application, sets their theme preference to "dark", refreshes the page once, closes the browser tab, and opens a new tab to reload the page. What will be the behavior of the theme preference?

  1. A

    The theme will be lost because closing the browser tab clears localStorage

  2. B

    The theme will be preserved as "dark" because localStorage persists across browser sessions

  3. C

    The theme will be undefined because localStorage is cleared on refresh

  4. D

    The theme will be reset to "light" when a new tab is opened

Show answer

Correct answer

  • B

    The theme will be preserved as "dark" because localStorage persists across browser sessions

Question 15

+2 marksOne correct option

A developer creates a Vue component using both v-if and v-show directives on different elements with initially false conditions. Later, the conditions are changed to true. What is the key difference in how these two directives handle the DOM?

  1. A

    v-if removes the element from DOM when false, v-show only changes CSS display property

  2. B

    v-show removes the element from DOM when false, v-if only changes CSS display property

  3. C

    Both v-if and v-show re-mount the element and re-run lifecycle hooks

  4. D

    Both directives are identical in their functionality; they just have different naming conventions

Show answer

Correct answer

  • A

    v-if removes the element from DOM when false, v-show only changes CSS display property

Question 16

+3 marksOne correct option

A Promise chain is created as follows. The first Promise resolves with a string, which is then processed through multiple .then() handlers. What will be logged to the console?

  1. A

    hello

  2. B

    hello WORLD

  3. C

    HELLO WORLD

  4. D

    An error will be thrown

Show answer

Correct answer

  • C

    HELLO WORLD

Question 17

+3 marksOne correct option

A JavaScript object is created and then assigned to another variable. Modifications are made through both variables. What will be the final state of the original object?

  1. A

    5000

  2. B

    3000

  3. C

    10000

  4. D

    undefined

Show answer

Correct answer

  • C

    10000

Question 18

+2 marksOne or more correct options

Which of the following statements about the "this" keyword in JavaScript are correct?

Select all that apply.

  1. A

    In a regular function, "this" is always bound to the global object (window in browsers)

  2. B

    In an arrow function, "this" is inherited from the enclosing lexical scope

  3. C

    The .call() method can be used to explicitly set the context of "this" in a function

  4. D

    In a method called on an object, "this" always refers to that object regardless of how the function is defined

Show answer

Correct answers

  • B

    In an arrow function, "this" is inherited from the enclosing lexical scope

  • C

    The .call() method can be used to explicitly set the context of "this" in a function

Question 19

+3 marksOne correct option

A Vue Router application uses lazy-loaded route components. When a user navigates to a route with a dynamic parameter (e.g., /product/:id), and the computed property depends on this route parameter, what could be a potential issue if the component is not properly handling asynchronous operations?

  1. A

    The component will throw a critical error and crash the application

  2. B

    The computed property will return undefined because the component hasn't mounted yet

  3. C

    The route parameter will not be accessible in the computed property

  4. D

    The component will display data from the previously loaded route

Show answer

Correct answer

  • D

    The component will display data from the previously loaded route

Question 20

+3 marksOne correct option

A developer uses sessionStorage to store authentication tokens in a web application. The user logs in, the token is stored, and then they close the browser window completely. When they reopen the browser later, what will happen? Code:

  1. A

    The token will be preserved and available in the new browser session.

  2. B

    The token will be cleared because sessionStorage is cleared when the browser is closed.

  3. C

    The token will be partially available but require re-authentication.

  4. D

    The token will move to localStorage automatically.

Show answer

Correct answer

  • B

    The token will be cleared because sessionStorage is cleared when the browser is closed.

Question 21

+5 marksOne correct option

A developer creates a Vue component with prototype chain inspection. The component uses class-based inheritance with lifecycle hooks. Consider the following scenario. Code:

What will be the output on the browser's console?

  1. A

    true true true true

  2. B

    true false true true

  3. C

    false true true false

  4. D

    true true false false

Show answer

Correct answer

  • A

    true true true true

Question 22

+3 marksOne or more correct options

In a web application using webhooks and Redis for real-time data synchronization:
Scenario: An order management system where:
• When an order is created, a webhook is sent to a notification service
• Redis stores the current order cache
• Multiple concurrent requests update the cache
Which statements about this architecture are true?

Select all that apply.

  1. A

    Webhooks guarantee that the notification service will process events in the exact order they were triggered

  2. B

    Redis is suitable for this use case because it's an in-memory data structure store that provides fast access to cached data

  3. C

    The webhook will automatically retry if the notification service is temporarily unavailable

  4. D

    Webhooks use HTTP POST requests to communicate events asynchronously

Show answer

Correct answers

  • B

    Redis is suitable for this use case because it's an in-memory data structure store that provides fast access to cached data

  • D

    Webhooks use HTTP POST requests to communicate events asynchronously

Question 23

+3 marksOne correct option

Consider the Vue application.

Based on the above data, answer the given subquestions.

What happens when the user clicks the calculate button?

  1. A

    expensive() runs again because the DOM updates

  2. B

    expensive() does NOT run again because its dependencies did not change

  3. C

    Vue recomputes all computed properties on any state change

  4. D

    Nothing is displayed

Show answer

Correct answer

  • B

    expensive() does NOT run again because its dependencies did not change

Question 24

+3 marksOne correct option

Consider the Vue application.

Based on the above data, answer the given subquestions.

Under which condition will the computed property expensive() re-run?

  1. A

    When this.time changes

  2. B

    The user clicks anywhere on the DOM

  3. C

    Either this.a or this.b changes

  4. D

    When Date.now() changes

Show answer

Correct answer

  • C

    Either this.a or this.b changes

Question 25

+3 marksOne or more correct options

Consider the Vue application.

Based on the above data, answer the given subquestions.

What are the benefits of computed caching in Vue?

Select all that apply.

  1. A

    Reduced CPU usage

  2. B

    Faster rendering

  3. C

    Avoids unnecessary recomputation

  4. D

    Makes all computations asynchronous

Show answer

Correct answers

  • A

    Reduced CPU usage

  • B

    Faster rendering

  • C

    Avoids unnecessary recomputation

Question 26

+5 marksOne correct option

Consider the following Vue 2 (CDN) code. html code:

script:

Based on the above data, answer the given subquestions.

What happens when the user clicks on "User 2" after initially opening "User 1"?

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

Correct answer

  • B

Question 27

+5 marksOne correct option

Consider the following Vue 2 (CDN) code. html code:

script:

Based on the above data, answer the given subquestions.

Why is the watcher on $route.params.id necessary in this code?

  1. A

    Without it, the userId in data would never change when the route changes.

  2. B

    It is required because Vue Router does not automatically update component data.

  3. C

    It prevents the component from being destroyed and recreated on every navigation.

  4. D

    Both Without it, the userId in data would never change when the route changes and It is required because Vue Router does not automatically update component data are correct.

Show answer

Correct answer

  • D

    Both Without it, the userId in data would never change when the route changes and It is required because Vue Router does not automatically update component data are correct.

Question 28

+5 marksOne correct option

Consider the following Vue.js application with two different route scenarios and a component that uses reactive data binding:
Scenario: An e-commerce application where:
• Product list component displays products filtered by category
• Category changes through router parameters: /products/:category
• When a user navigates from /products/electronics to /products/books, the product list should update

Based on the above data, answer the given subquestions.

What will be rendered when the user first navigates to /products/electronics?

  1. A

    An empty array because displayedProducts is initialized as null

  2. B

    All three products because the watch handler hasn't been triggered yet

  3. C

    Only the Laptop and Phone (both electronics)

  4. D

    The data will show an error because the category doesn't exist in the array

Show answer

Correct answer

  • C

    Only the Laptop and Phone (both electronics)

Question 29

+4 marksOne correct option

Consider the following Vue.js application with two different route scenarios and a component that uses reactive data binding:
Scenario: An e-commerce application where:
• Product list component displays products filtered by category
• Category changes through router parameters: /products/:category
• When a user navigates from /products/electronics to /products/books, the product list should update

Based on the above data, answer the given subquestions.

When the user navigates from /products/electronics to /products/books, what will happen and why?

  1. A

    The computed property will not update because it's being used in a watch handler

  2. B

    The computed property will automatically re-evaluate because the route parameter dependency changed

  3. C

    The displayedProducts variable will update, but the computed property will display stale data

  4. D

    Both the computed property and displayedProducts will update to show books

Show answer

Correct answer

  • B

    The computed property will automatically re-evaluate because the route parameter dependency changed