Question 1
Consider the Flask SQLAlchemy data model.
What is the output after the following Python code is executed ? (Assume all entries are successfully committed to the database)
4
3
2
1

The IIT Madras BS Modern Application Development I (MAD 1) Quiz 2 paper sat on 16 Aug 2026, in the May 2026 term: 13 questions for 39 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.
Consider the Flask SQLAlchemy data model.
What is the output after the following Python code is executed ? (Assume all entries are successfully committed to the database)
4
3
2
1
Correct answer
1
Consider the following models: Course and Enrollment corresponding to tables course and enrollment in SQLite database.
Based on the model schemas, what relationship do the classes Course and Enrollment share?
Many-to-Many
One-to-Many
One-to-One
The tables are not at all related
Correct answer
One-to-Many
Which of the following statements is correct?
Statement 1: In Server-Side Rendering (SSR), the client's browser receives a nearly empty HTML skeleton and relies heavily on client-side JavaScript execution to fetch data and construct the Document Object Model (DOM).
Statement 2: Client-Side Rendering (CSR) reduces the immediate processing load on the web server by offloading UI layout rendering tasks to the user's browser engine.
Both are incorrect
Both are correct
Only Statement 1 is correct
Only Statement 2 is correct
Correct answer
Only Statement 2 is correct
A recipe webpage needs to display two distinct sections: A list of ingredients where the order does not matter.1. A sequence of cooking steps that must be followed in order.2. Which combination of HTML list container tags is most appropriate for these sections?
Correct answer
Consider the following Python jinja2 templating code.
Nothing will be rendered in place of x
0
1
2
Correct answer
Nothing will be rendered in place of x
Consider the following Flask application structure and code.
Which of the following statements about the template rendering behavior is correct?
All routes fail because Flask requires templates to be in a default folder
Correct answer
Sends a PUT request to update data using form format.
Sends a PUT request using JSON encoding.
Sends a GET request to retrieve user information.
Sends a DELETE request to remove user data.
Correct answer
Sends a PUT request to update data using form format.
In the context of asynchronous updates, which of the following statements is correct?
It updates a web page without reloading the whole page
It leads to better user experience as it involves quick response on the main page with minimal data to refresh
Both It updates a web page without reloading the whole page and It leads to better user experience as it involves quick response on the main page with minimal data to refresh are correct
None of these
Correct answer
Both It updates a web page without reloading the whole page and It leads to better user experience as it involves quick response on the main page with minimal data to refresh are correct
Consider the following Flask RESTful API code.
What will be the response?
{"n": 3}
Runtime error
400 Bad Request
{ }
Correct answer
{"n": 3}
A magnetic disk can spin only in one direction with a constant speed of 6000rpm. What is the maximum delay (worst-case latency) before data transfer starts (in milliseconds)?
Correct answer: 10
Consider the following Flask app code.
The above flask app is running on "http://127.0.0.1:5000". Which of the following commands will return a runtime error?
Correct answers
Which of the following statements is/are true about Document Object Model (DOM)?
It is the programming interface for web documents.
It is the abstract model of the document.
Its structure is rigid and cannot be changed once created.
It can only be manipulated with the help of JavaScript.
Correct answers
It is the programming interface for web documents.
It is the abstract model of the document.
An e-commerce web application stores user shopping cart information as server-side session state. Each active user session occupies an average of 4 KB of memory. During a flash sale, the application is expected to handle 1.5 million concurrent active sessions, all stored in a centralized Redis cache server. What is the minimum RAM capacity (in GB) required solely to store these session states? (Assume that 1000B=1KB, 1000KB=1MB and so on)
Correct answer: 6