MAD Study Hub

Home / Past papers / MAD1 Quiz 1 / this paper

Modern Application Development I 16 Jul 26 - 19 Jul 2026

MAD1 Quiz 116 questions50 marks12 MCQ · 2 MSQ · 2 SA
Elapsed 00:00
Q1MCQ2 marks
Consider the following HTML/CSS code. question figure What will be rendered by the browser?
Text of the picture (copyable)
File name: home.html

```html
<!DOCTYPE html>
<html lang="en">
<style>
    div{color:green}
    .cdiv{color:red}
    #div1{color:blue}
</style>
<body>
    <div id="div1" class="cdiv">IITM BS Degree in Data Science</div>
</body>
</html>
```
  1. question figure
    text
    IITM BS Degree in Data Science
  2. question figure
    text
    IITM BS Degree in Data Science
  3. question figure
    text
    IITM BS Degree in Data Science
  4. question figure
    text
    1. IITM BS Degree in Data Science
Q2MCQ2 marks
Which of the following pairs correctly identifies one block-level element and one inline element?
  1. text
    Block: `<span>` | Inline: `<div>`
  2. text
    Block: `<div>` | Inline: `<a>`
  3. text
    Block: `<h1>` | Inline: `<p>`
  4. text
    Block: `<span>` | Inline: `<h5>`
Comprehension passage - the questions below it refer to this
Consider the following HTML and Python flask code. question figure Assume that the Flask app is running at http://127.0.0.1:5000. Based on the above data, answer the given subquestions.
Q3MCQ2 marks
Which of the following statements are correct? Statement 1: Accessing the URL: http://127.0.0.1:5000 directly in the browser makes a GET request. Statement 2: Clicking on the Submit button will invoke the POST request method.
  1. Both statements are correct
  2. Both statements are incorrect.
  3. Statement 1 is incorrect, but statement 2 is correct.
  4. Statement 2 is incorrect, but statement 1 is correct.
Q4MCQ4 marks
What will be the rendered output for the following input in the form? question figure
Text of the picture (copyable)
Enter a number :
[text input field with "5" entered]
[Submit button]
  1. 404 Not Found
  2. [0, 1, 2, 3, 4]
  3. [ ]
  4. [1, 2, 3, 4, 5]
Q5MCQ3 marks
A web server has an outgoing bandwidth of 6 Gbps, and each client requires 2 Mbps. What is the maximum number of concurrent requests allowed? (Use: 1KB= 1000Bytes, 1MB=1000KB and so on.)
  1. 3
  2. 30
  3. 3000
  4. 300
Q6MCQ3 marks
Consider the following Flask code. File name: app.py question figure What will be the output when you run the following code in the terminal and then access in the browser with the following link ?
Text of the picture (copyable)
```python
from flask import Flask
import sys

app = Flask(__name__)

MULTIPLIER = int(sys.argv[1]) if len(sys.argv) > 1 else 2

@app.route('/calculate/<int:value>')
def calculate(value):
    return f"Result: {value * MULTIPLIER}"

if __name__ == '__main__':
    app.run()
```
```
python app.py 7
```
http://localhost:5000/calculate/6
  1. Result: 42
  2. Result: 13
  3. Result: 7
  4. Result: 12
Q7MCQ3 marks
Consider the following Python flask code. question figure
Text of the picture (copyable)
```python
from flask import Flask, request
app = Flask(__name__)

@app.route("/total")
def total():
    price = request.args.get("price", 0)
    qty = request.args.get("qty", 1)
    result = price * qty
    return str(result)

app.run()
```

Assume that the above Flask app is running at http://127.0.0.1:5000. What will be rendered for the URL request http://127.0.0.1:5000/total?price=5&qty=2?
  1. 55
  2. 52
  3. 10
  4. TypeError
Q8MCQ3 marks
Consider the following Python code. question figure
Text of the picture (copyable)
File name: app.py
```python
from string import Template

student_record = ["Siya", "Sunita"]

for name in student_record:
    template_layout = "Student Name: $name "
    template = Template(template_layout)
    print(template.substitute(name=name))
```
What text output is generated when this script is executed by the command `python app.py`?
  1. Student Name: Siya Sunita
  2. Student Name: Siya Student Name: Sunita
  3. Student Name: Sunita
  4. Key Error
Q9MCQ3 marks
Consider the following Python flask code. question figure
Text of the picture (copyable)
```python
from flask import Flask

app = Flask(__name__)

@app.route("/user/<name>")
def user(name):
    return f"User: {name}"

@app.route("/user/admin")
def admin():
    return "Admin Panel"

app.run()
```

Assume that the Flask app is running at http://127.0.0.1:5000. What response is returned when http://127.0.0.1:5000/user/admin is accessed?
  1. Admin Panel
  2. User: admin
  3. 404 Error
  4. Internal Server Error
Q10MSQ3 marksselect all that apply
Consider the following Python Flask code. question figure
Text of the picture (copyable)
File name: app.py
```python
from flask import Flask

app = Flask(__name__)

@app.route("/calculate/<int:v1>/<int:v2>")
def compute(v1, v2):
    try:
        return f"{v1 / v2}"
    except:
        return "Arithmetic operation error!"

app.run(debug=True)
```

Assume that the Flask app is running at http://127.0.0.1:5000. Which of the following URL requests will return **Not Found** ?
  1. text
    ```
    http://127.0.0.1:5000/calculate/10/5
    ```
  2. text
    ```
    http://127.0.0.1:5000/calculate/3/0.2
    ```
  3. text
    ```
    http://127.0.0.1:5000/calculate/3/2?v1=1
    ```
  4. text
    ```
    http://127.0.0.1:5000/calculate?v1=5&v2=2
    ```
Q11MSQ3 marksselect all that apply
Consider the following Python Jinja2 template code. question figure
Text of the picture (copyable)
File name: main.py

```python
from jinja2 import Template
import sys

t = """
Better learning path of App Dev courses:
=>{{course[0]}} => {{course[1]}} => {{course[2]}} => {{course[3]}}
"""

course = sys.argv[1:]
render_t = Template(t)
output = render_t.render(course=course)
print(output)
```

Which of the following is the correct command to render the following **output**?
**Output**:

Better learning path of App Dev courses:
=>MAD1 => MAD2 => MAD1_Project => MAD2_Project
  1. python main.py MAD1 MAD2 MAD1_ Project MAD2_ Project
  2. python main.py MAD1 MAD2 MAD1_Project MAD2_Project
  3. python main.py "MAD1 MAD2 MAD1_Project MAD2_Project"
  4. python main.py MAD1 MAD2 "MAD1_Project" "MAD2_Project"
Q12SA3 marks
Suppose a client machine C is communicating with a data center D located 12,500 km away from C. Assume that the TCP connection has been established and is kept alive. Calculate the RTT (Round trip time) in ms for an HTTP request. (Assume speed of light in cable is 2e8 m/s).
Q13SA2 marks
Suppose you have a document which contains only lower case alphabets. How many bits are required to encode a character such that the size of the document is minimum? ( The document contains all lower case alphabets. Code for each alphabet should be of the same length )
Q14MCQ4 marks
Consider the following Python code. question figure Which of the following code snippets should be placed at such that the output generated in the terminal when rendered will be as shown below? question figure
Text of the picture (copyable)
```python
from jinja2 import Template
output = """
<!DOCTYPE html>
<html>
<body>
    <ul>
        <!--Missing Jinja2 implementation-->
    </ul>
</body>
</html>
"""

l = [6, 8, 5, 2, 4]
t = Template(output)
output = t.render(sl=l)
print(output)
```
```html
<!--Missing Jinja2 implementation-->
```
- 8
- 6
- 5
- 4
- 2
  1. question figure
    text
    ```html
    {%for item in sl|sort(reverse=True)%}
        <li>{{item}}</li>
    {%endfor%}
    ```
  2. question figure
    text
    ```html
    {%for item in sl%}
        <li>{{item}}</li>
    {%endfor%}
    ```
  3. question figure
    text
    ```html
    {%for item in sl|sort%}
        <li>{{item}}</li>
    {%endfor%}
    ```
  4. question figure
    text
    ```
    {%for item in sl.sort()%}
        <li>{{item}}</li>
    {%endfor%}
    ```
Q15MCQ5 marks
Consider the following HTML and CSS code. question figure Which of the following will be the correct rendered output ?
Text of the picture (copyable)
```html
<!DOCTYPE html>
<html>
<head>
<style>
.container{
    display: flex;
    width: 250px;
    border: 2px solid black;
}
.box{
    width: 80px;
    height: 40px;
    border: 1px solid blue;
    margin: 5px;
    text-align: center;
}
</style>
</head>
<body>
<div class="container">
    <div class="box">1</div>
    <div class="box">2</div>
    <div class="box">3</div>
</div>
</body>
</html>
```
  1. question figure
    text
    This is a diagram showing three rectangular boxes stacked vertically within a larger outer rectangle. Each inner box is outlined in blue and contains a single number.
    - The top box is labeled "1".
    - The middle box is labeled "2".
    - The bottom box is labeled "3".
  2. question figure
    text
    This is a diagram of a rectangle with a nested rectangle.
    The outer rectangle is black.
    The inner rectangle is blue.
    Inside the inner rectangle, the text "1 2 3" is displayed.
  3. question figure
    text
    This is a diagram of three rectangular boxes arranged horizontally, each containing a number.
    - The first box on the left contains the number "1".
    - The second box in the middle contains the number "2".
    - The third box on the right contains the number "3".
    All boxes are outlined with a dark blue border, and the vertical lines separating the boxes are also dark blue.
  4. question figure
    text
    The image displays a diagram with a black rectangular outer border. Inside this border, there are three smaller, identical rectangular boxes arranged horizontally. Each of these inner boxes has a blue border. The boxes are labeled with numbers: "1" in the leftmost box, "2" in the middle box, and "3" in the rightmost box. There is a small gap between each of the inner boxes.
Q16MCQ5 marks
Consider the following Python code. question figure Which of the following students is classified as "Pass" by the template?
Text of the picture (copyable)
```python
from jinja2 import Template

students = [
    {"name": "Alice", "marks": [80, 90]},
    {"name": "Bob", "marks": [50, 40]},
    {"name": "Kittu", "marks": [51,66]},
    {"name": "Carol", "marks": [100]}
]

template = Template("""
{% for student in students %}
    {% set avg = (student.marks | sum) / (student.marks | length) %}
    {{ student.name }} :
    {% if avg > 75 %}
        Distinction
    {% elif avg > 50 %}
        Pass
    {% else %}
        Fail
    {% endif %}
{% endfor %}
""")

print(template.render(students=students))
```
  1. Alice
  2. Bob
  3. Kittu
  4. Carol

Answer key

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

Concepts this paper tests

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

Here's a summary of the core topics, concepts, principles, and equations essential to study for the exam, followed by a knowledge graph.


Summary of Core Topics and Concepts

The questions cover fundamental aspects of Web Development, specifically focusing on Frontend Technologies (HTML, CSS) and Backend Development with Python Flask, alongside core Python Programming concepts and some Mathematical/Networking Fundamentals.


1. Web Technologies (HTML, CSS, HTTP)


2. Python Web Framework (Flask)


3. Python Core Concepts


4. Jinja2 Templating Language


5. Mathematical and Networking Fundamentals