uiz Space

January 2026 term · Modern Application Development II · BSCS2006

Modern Application Development II Quiz 2: 12 April 2026 (January 2026 term)

The IIT Madras BS Modern Application Development II (MAD 2) Quiz 2 paper sat on 12 Apr 2026, in the January 2026 term: 15 questions for 47 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
15
Marks
47
Duration
120 min
MCQ
13
MSQ
2

Updated

Official paper: Modern Application Development Ii 06 Apr 26 · No negative marking.

Question 1

+3 marksOne correct option

You are building a login feature for a web application. The frontend sends the user’s email and password to the backend API. The backend validates credentials against a database. Which security issues exist in the code given below?
Frontend: script.js

Backend: app.py

  1. A

    The SQL query is vulnerable to SQL injection attacks

  2. B

    Passwords are stored and compared in plain text

  3. C

    No authentication token (session/JWT) mechanism is implemented

  4. D

    All of these.

Show answer

Correct answer

  • D

    All of these.

Question 2

+3 marksOne correct option

Consider the following Vue.js code.

What will be printed on the console first?

  1. A

    0

  2. B

    done

  3. C

    1

  4. D

    Error

Show answer

Correct answer

  • C

    1

Question 3

+3 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 • Component Code:

If the developer changed the template to use displayedProducts instead of filteredProducts, What would be the most likely issue?

  1. A

    Performance would improve because computed properties are slower than data

  2. B

    The initial page load would show an empty list, and only after navigation would data appear correctly

  3. C

    There would be no difference because both will update at the same time

  4. D

    The application would crash because displayedProducts is reactive

Show answer

Correct answer

  • B

    The initial page load would show an empty list, and only after navigation would data appear correctly

Question 4

+3 marksOne correct option

Consider the following JavaScript code:

What will be printed to the console?

  1. A

    12

  2. B

    10

  3. C

    5

  4. D

    3

Show answer

Correct answer

  • D

    3

Question 5

+3 marksOne correct option

Match the following web dev concept given below:

Which of the following options correctly matches Concept / Issue and Description?

  1. A

    A→2, B→4, C→1, D→3

  2. B

    A→1, B→2, C→3, D→4

  3. C

    A→2, B→1, C→4, D→3

  4. D

    A→4, B→2, C→1, D→3

Show answer

Correct answer

  • A

    A→2, B→4, C→1, D→3

Question 6

+3 marksOne correct option

Consider the following Vuex store setup for a user management system:

Suppose the following mutation is committed:store.commit("updateUserStatus", { userId: 2, status: "active" });. Which of the following statements is TRUE after this mutation is executed?

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

    The mutation will not affect any getter output

Show answer

Correct answer

  • A

Question 7

+2 marksOne correct option

In Vue 2 (CDN), which of the following correctly describes the timing of the beforeDestroy and destroyed lifecycle hooks?

  1. A

    beforeDestroy runs after the component has been removed from the DOM, while destroyed runs before destruction.

  2. B

    beforeDestroy runs just before the component is torn down and removed from the DOM, while destroyed runs after the component is fully destroyed.

  3. C

    beforeDestroy runs when the component is first mounted, while destroyed runs before the component is removed.

  4. D

    both hooks run only after the component is destroyed.

Show answer

Correct answer

  • B

    beforeDestroy runs just before the component is torn down and removed from the DOM, while destroyed runs after the component is fully destroyed.

Question 8

+2 marksOne correct option

Consider the following HTML:

And JavaScript code:

What are the values of id and action respectively?

  1. A

    id = 42 (number), action = "delete" (string)

  2. B

    id = 42 (string), action = "delete" (string)

  3. C

    id = undefined, action = undefined

  4. D

    id = 42 (number), action = undefined

Show answer

Correct answer

  • B

    id = 42 (string), action = "delete" (string)

Question 9

+2 marksOne correct option

Which of the following statements best describes a permalink?

  1. A

    A temporary URL generated for a single browsing session

  2. B

    A stable URL that uniquely identifies a specific resource and is not expected to change

  3. C

    A human-readable URL used only for navigation menus

  4. D

    A URL that depends on the user’s login session or device

Show answer

Correct answer

  • B

    A stable URL that uniquely identifies a specific resource and is not expected to change

Question 10

+4.5 marksOne correct option

Consider the following code snippet running in a browser.

What will be the output on the console?

  1. A

    Shield 99 99 42

  2. B

    Shield 10 99 42

  3. C

    Sword 99 99 42

  4. D

    Shield 99 42 42

Show answer

Correct answer

  • A

    Shield 99 99 42

Question 11

+4.5 marksOne correct option

Consider the following code snippet running on a browser. What is the output on the console?

  1. A

    42 42 42

  2. B

    42 undefined undefined

  3. C

    42 undefined 42

  4. D

    undefined undefined undefined

Show answer

Correct answer

  • B

    42 undefined undefined

Question 12

+4.5 marksOne correct option

Consider the following markup index.html and JavaScript app.js for a Vue application.
app.js:

index.html:

Suppose the application is running on http://localhost:8080, and the user visit the URL “http://localhost:8080/\#/player/rohit/t20”. What will be rendered by the browser?

  1. A

    Name: Rohit Oneday Runs: 10000

  2. B

    Test Runs: 5000

  3. C

    Name: Rohit Test Runs: 5000

  4. D

    Oneday Runs: 10000

Show answer

Correct answer

  • B

    Test Runs: 5000

Question 13

+4.5 marksOne correct option

Consider the following html index.html and JavaScript app.js for a Vue application:
File : index.html

File : app.js

Suppose the application is running on http://localhost:8080, and the user visits the URL http://localhost:8080/\#/b. What will be rendered by the browser?

  1. A

    Shivamogga

  2. B

    South Goa

  3. C

    Rewa

  4. D

    Satara

Show answer

Correct answer

  • C

    Rewa

Question 14

+3 marksOne or more correct options

Consider a scenario involving localStorage, Promise chains, and Vue lifecycle hooks:
Scenario: A user authentication system where: On app initialization, the app checks localStorage for a stored user token• If a token exists, it validates the token asynchronously (via a Promise)• Based on validation, different UI components are rendered• The user navigates between different views• Code in mounted() hook:

Which of the following statements is/are CORRECT about this implementation?

Select all that apply.

  1. A

    If the page is refreshed while the Promise is pending, the token will be lost because localStorage is cleared on refresh

  2. B

    If token validation fails, the token is removed from storage, preventing automatic login on future page loads

  3. C

    The isAuthenticated flag might be false even though a storedToken exists, until the Promise validation completes

  4. D

    sessionStorage should be used instead of localStorage because user tokens should not persist across browser sessions

  5. E

    If the user navigates to a different route while validation is pending, the Promise will still complete and update the user data

Show answer

Correct answers

  • B

    If token validation fails, the token is removed from storage, preventing automatic login on future page loads

  • C

    The isAuthenticated flag might be false even though a storedToken exists, until the Promise validation completes

  • E

    If the user navigates to a different route while validation is pending, the Promise will still complete and update the user data

Question 15

+2 marksOne or more correct options

Consider the following HTML index.html and JavaScript app.js for a Vue application:
File: index.html

File: app.js

Which of the following statements is/are TRUE?

Select all that apply.

  1. A

    On initial page load, neither “Hello” nor “World” is visible in the browser.

  2. B

    On initial page load, the element using v-show exists in the DOM but is hidden.

  3. C

    After clicking the Toggle button once, both “Hello” and “World” become visible.

  4. D

    The v-if directive hides elements using CSS.

  5. E

    The v-show directive removes elements from the DOM when the condition is false.

Show answer

Correct answers

  • A

    On initial page load, neither “Hello” nor “World” is visible in the browser.

  • B

    On initial page load, the element using v-show exists in the DOM but is hidden.

  • C

    After clicking the Toggle button once, both “Hello” and “World” become visible.