Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Modern Application Development II
End Term · 22 Dec 2024 (Forenoon)
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
- Q1MCQ3 Marks·Choose one option
Which of the following statements is true about closures in JavaScript?
- AA closure can access variables from its outer function even after the outer function has returned.
- BA closure can be created when a function is defined inside another function.
- CClosures are useful for data encapsulation and controlling access to private data.
- DAll of these.
- Q2MCQ3 Marks·Choose one option

- AStart Inside Timeout Inside Promise End
- BStart Inside Promise Inside Timeout End
- CStart End Inside Timeout Inside Promise
- DStart End Inside Promise Inside Timeout
- Q3MCQ3 Marks·Choose one option

- AHello, John TypeError: john.greet is not a function
- BHello, John Hello, undefined
- CTypeError: john.greet is not a function TypeError: john.greet is not a function
- DHello, John Hello, John
- Q4MCQ3 Marks·Choose one option

- AThe watcher will not be triggered because “name” is a nested property of “user” object.
- BThe watcher will be triggered and log "User object changed: { name: 'Bob', age: 30 }".
- CThe watcher will be triggered, but it will only log the new “name” value, i.e., “Dev”, and not the entire user object.
- DThe watcher will throw an error because deep watching is not supported on nested objects.
- Q5MCQ3 Marks·Choose one option

- AThe paragraph with the text “This paragraph is visible” will be displayed.
- BThe paragraph with the text “This paragraph is hidden” will be displayed.
- CBoth paragraphs will be displayed because of the v-if and v-else bindings.
- DNo change will happen since v-if and v-else do not update the DOM.
- Q6MCQ3 Marks·Choose one option

- Asecure=True and samesite='Strict'
- Bsecure=False and samesite='Strict'
- Csecure=True and samesite='None'
- Dsecure=False and samesite='Lax'
- Q7MCQ3 Marks·Choose one option

- A[]
- B['Laptop', ‘Laptop’, ‘Laptop’]
- C[{ id: 1, name: 'Laptop' }]
- D[undefined]
- Q8MCQ3 Marks·Choose one option
Which of the following is true regarding long polling?
- ALong polling opens multiple connections between the client and the server, and the server continuously sends updates to the client in real-time.
- BLong polling involves the client repeatedly sending requests at fixed intervals to the server to check for updates, regardless of whether new data is available.
- CLong polling allows the client to make a single request to the server, where the server holds the connection open until new data is available and then sends the response.
- DLong polling uses WebSockets to maintain a persistent, bidirectional connection between the client and the server.
- Q9MCQ3 Marks·Choose one option

- AMultiple state changes in one mutation
- BAsync operation in mutation
- CDirect state mutation
- DBoth Multiple state changes in one mutation and Async operation in mutation
- Q10MCQ3 Marks·Choose one option

- ANo authentication check
- BSQL injection vulnerability
- CUnvalidated user input
- DAll of these
- Q11MCQ3 Marks·Choose one option

- A

- B

- C

- D

- A
- Q12MCQ3 Marks·Choose one option
What will be the output on the console?- Aerror4
- B7
- Cerror
- Dundefined
- Q13MCQ3 Marks·Choose one option

- ABegin, Start, 5, End, Finish
- BBegin, Finish, Start, 5, End
- CBegin, Finish, Start, End, 5
- DBegin, Start, Finish, 5, End
- Q14MCQ3 Marks·Choose one option
Which of the following best describes the difference between @cache.memoize() and @cache.cached() in Flask-Caching?
- A

- B

- C

- D

- A
- Q15MCQ3 Marks·Choose one option

- AIt will display the indices, values and types of all the items of the array.
- BIt will throw error on the console for the very first iteration.
- CIt will display the index, value and type of the value for the first item of array and then will throw error for the next value.
- DNone of these.
- Q16MCQ2 Marks·Choose one option
Which of the following statements is false when using the “async” and “await” keywords in JavaScript?
- AThe “await” keyword can only be used inside an async function.
- BThe “await” keyword pauses the execution of the surrounding async function until the promise resolves.
- CThe async functions always return a promise, even if the return value is not a promise.
- DThe async functions run synchronously, but their await statements execute asynchronously.
- Q17MCQ2 Marks·Choose one option

- A

- B

- C

- D

- E

- A
- Q18MCQ2 Marks·Choose one option

- A

- B

- C

- D

- E

- F

- G

- A
- Q19MCQ2 Marks·Choose one option
Which of the following statements about the beforeDestroy and destroyed lifecycle hooks in Vue is true?
- AThe “beforeDestroy” hook is called after the component is removed from the DOM, and the “destroyed” hook is called before the component is destroyed.
- BThe “beforeDestroy” hook is called before the component is removed from the DOM, and the “destroyed” hook is called after the component is destroyed.
- CThe “beforeDestroy” hook is called when the component is mounted, and the “destroyed” hook is called before the component is destroyed.
- DBoth hooks are called after the component is destroyed.
- Q20MCQ2 Marks·Choose one option

- A5
- B10
- C15
- D20
- Q21MCQ2 Marks·Choose one option
Which of the following statements is FALSE?
- ACache-Control: no-store prevents caching
- BETag helps validate cache freshness
- CData stored in sessionStorage remains available even after the browser is closed and reopened.
- DlocalStorage has larger storage limit than cookies
- Q22MCQ2 Marks·Choose one option

- A

- B

- C

- D

- A
- Q23MCQ4.5 Marks·Choose one option

- AChild Parent GrandParent
- BChild
- CGrandParent Parent Child
- DNone of these
- Q24MCQ4.5 Marks·Choose one option

- AThe increment mutation will be called immediately after the dispatch.
- BThe state will be updated after the asynchronous operation completes.
- CThe incrementAsync action will be executed synchronously, and increment will be committed before the promise resolves.
- DThe action will be skipped since mutations cannot be called inside actions.
- Q25MCQ4.5 Marks·Choose one option

- AParent
- BButton
- CButton Parent
- DParent Button
- Q26MCQ4.5 Marks·Choose one option

- ALikes: 5
- BLikes: 8
- CLikes: 6
- DLikes: 9
- Q27MCQ4.5 Marks·Choose one option

- AThe userData in the store is set to the data from the API.
- BUser: null
- CThe error will be logged, Nothing will be displayed
- DUser: Luke
- Q28MCQ4.5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q29MCQ4.5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q30MSQ3 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q31MSQ4.5 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q32MSQ2 Marks·Choose all correct options

- Athis.$route.params.id
- Bthis.$router.params.id
- Cthis.$route.query.id
- Dthis.$route.params['id']