MAD Study Hub

Home / MAD1 / Week 12 / Real questions

MAD1 week 12 - real exam questions

33 questions pulled from past papers whose wording matches this week's topics, newest first, duplicates removed. Pick your answers, then press Check answers. Figures and answer keys are the originals.

Elapsed 00:00
MAD1 Quiz 2 · 16 Aug 2026 · open the full paper
Practice 1MCQ3 marks
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?
  1. text
    Ingredients: <ol> | Cooking Steps: <ol>
  2. text
    Ingredients: `<ul>` | Cooking Steps: `<ul>`
  3. text
    Ingredients: `<d1>` | Cooking Steps: `<u1>`
  4. text
    Ingredients: `<ul>` | Cooking Steps: `<ol>`
MAD1 Quiz 2 · 16 Aug 2026 · open the full paper
Practice 2MCQ4 marks
Consider the following Flask RESTful API code. question figure What will be the response?
Text of the picture (copyable)
File name: app.py
```python
from flask_restful import reqparse, Resource, Api
from flask import Flask

parser = reqparse.RequestParser()
parser.add_argument("n", type=int, required=True)
app = Flask(__name__)
api = Api(app)

class MyResponse(Resource):
    def post(self):
        args = parser.parse_args()
        return args

api.add_resource(MyResponse, "/")
app.run(debug=True)
```

Assume that the Flask app is running at http://127.0.0.1:5000. The client sends the below CURL request in the git bash terminal.

```bash
curl -X POST http://127.0.0.1:5000 -H "Content-Type: application/json" -d "{\"n\":3}"
```
  1. {"n": 3}
  2. Runtime error
  3. 400 Bad Request
  4. { }
MAD1 Quiz 1 · 19 Jul 2026 · open the full paper
Practice 3MCQ5 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.
MAD1 End Term · 10 May 2026 · open the full paper
Practice 4MSQ3 marksselect all that apply
Which of the following statements are correct regarding git?
  1. Files in the staging area can be committed.
  2. The command converts a local folder into a Git repository.
    text
    ```
    "git init"
    ```
  3. The command moves the local repository to the remote repository.
    text
    ```
    "git add"
    ```
  4. Git can be used only online.
  5. Git branches are pointers to commits.
MAD1 End Term · 10 May 2026 · open the full paper
Practice 5MCQ4 marks
Consider the following Flask RESTful API code. question figure Assume that the Flask app is running at http://127.0.0.1:5000. The client sends the below CURL request in the git bash terminal. question figure What will be the response?
Text of the picture (copyable)
File name: app.py
```python
from flask_restful import reqparse, Resource, Api
from flask import Flask

parser = reqparse.RequestParser()
parser.add_argument("n", type=int, required=True)
app = Flask(__name__)
api = Api(app)

class MyResponse(Resource):
    def post(self):
        args = parser.parse_args()
        return args

api.add_resource(MyResponse, "/")
app.run(debug=True)
```
```
curl -X POST http://127.0.0.1:5000 -H "Content-Type: application/json" -d '{}'
```
  1. {"n": None}
  2. Runtime error
  3. 400 Bad Request
  4. { }
MAD1 Quiz 1 · 15 Mar 2026 · open the full paper
Practice 6MSQ3 marksselect all that apply
Consider the following CSS code: question figure Which of the following statements are TRUE regarding the element's dimensions and spacing?
Text of the picture (copyable)
```css
#container {
  width: 200px;
  padding: 10px;
  border: 2px solid black;
  margin: 15px;
}
```
  1. The total width including padding and border is 224px
  2. The margin affects the content box width
  3. The padding adds internal spacing inside the element
  4. The border contributes to the total width in the standard box model
MAD1 End Term · 21 Dec 2025 · open the full paper
Practice 7MCQ2 marks
You are on the main branch and want to merge feature1 and feature2 branches. What is the correct command sequence?
  1. text
    ```
    git merge feature1 then git merge feature2
    ```
  2. question figure
    text
    ```
    git checkout feature1 then git merge feature2 then git merge main
    ```
  3. question figure
    text
    ```
    git checkout feature1 then git merge feature2 then git checkout main then git merge feature1
    ```
  4. question figure
    text
    ```
    git merge feature1 then git checkout feature2 then git merge main
    ```
MAD1 Quiz 1 · 26 Oct 2025 · open the full paper
Practice 8MCQ3 marks
question figure
Text of the picture (copyable)
Consider the following statements and select the correct option.

Statement 1: The `<span>` elements will start on new lines, while the `<div>` elements will appear inline with surrounding content.

Statement 2: The `<p>` and `<div>` elements will each start on new lines and take up the full width of their container, while `<span>`, `<strong>`, and `<em>` will flow inline with surrounding content.
  1. Statement 1 is correct, but statement 2 is incorrect.
  2. Statement 2 is correct, but statement 1 is incorrect.
  3. Both statements 1 and 2 are correct
  4. Both statements 1 and 2 are incorrect
MAD1 Quiz 1 · 26 Oct 2025 · open the full paper
Practice 9MCQ4.5 marks
question figure
Text of the picture (copyable)
Consider the following HTML and CSS code:

```html
<html>
  <head>
    <style>
      div {
        width: 0px;
        margin: 0px;
      }
      .container {
        width: 200px;
        padding: 15px;
        border: 5px solid black;
      }
      #box {
        margin: 10px;
      }
    </style>
  </head>
  <body>
    <div class="container" id="box">Hello World</div>
  </body>
</html>
```

What is the **total width (approximately)** of the `div` with `class="container"` and `id="box"`, including **content, padding, and border** but excluding margin?
  1. 200 px
  2. 230 px
  3. 240 px
  4. 250 px
MAD1 End Term · 31 Aug 2025 · open the full paper
Practice 10MCQ3 marks
question figure
Text of the picture (copyable)
Consider the following git branches for a remote repository.

```
feature1
* feature2
main
```

Choose the correct git command sequence to merge *feature1* and *feature2* into the *main* branch.
  1. question figure
    text
    ```
    git merge feature1
    git merge feature2
    git merge main
    ```
  2. question figure
    text
    ```
    git checkout feature1
    git merge feature2
    git merge main
    ```
  3. question figure
    text
    ```
    git checkout main
    git merge feature1
    git merge feature2
    ```
  4. question figure
    text
    ```
    git merge main
    git merge feature1
    git merge feature3
    ```
MAD1 End Term · 31 Aug 2025 · open the full paper
Practice 11MCQ4.5 marks
question figure
Text of the picture (copyable)
You are working on a team project hosted on GitHub. After making changes to your local files, you run the following commands in this exact order:

```shell
git status
git add .
git commit -m "Fixed header bug"
git push
git pull
```

Assuming your teammate pushed a new change **just before** you did `git push`, what is the most likely outcome?
  1. question figure
    text
    Your commit will be rejected because the remote branch is ahead of your local branch.
  2. question figure
    text
    The `git pull` should have been run **before** `git push` to avoid possible conflicts.
  3. question figure
    text
    The `git push` will automatically merge your changes with the remote and succeed.
  4. question figure
    text
    The `git status` will show the conflict before `git push` is run.
MAD1 Quiz 1 · 13 Jul 2025 · open the full paper
Practice 12MCQ3 marks
question figure
Text of the picture (copyable)
Consider the following HTML code snippet.

filename: index.html

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <title>CSS Document</title>
    <style>
        .container p.highlight { background-color: red; }
        .content .special { background-color: blue; }
        span.highlight { background-color: green; }
    </style>
</head>
<body>
    <div class="container">
        <p class="highlight">Welcome to our site</p>
        <div class="content">
            <p>This is regular content</p>
            <p class="highlight special">Important information</p>
            <span class="highlight">Notice</span>
        </div>
        <p class="highlight">Footer text</p>
    </div>
    <p class="highlight">Welcome to our site</p>
</body>
</html>
```

Which elements from the above document will have a red background color?
  1. question figure
    text
    All elements with the class "highlight".
  2. question figure
    text
    Only the `<p>` elements that are direct children of `.container` and have the class "highlight"
  3. question figure
    text
    All `<p>` elements with the class "highlight" that are descendants of `.container`
  4. question figure
    text
    Only the first `<p>` element with class "highlight"
MAD1 End Term · 13 Apr 2025 · open the full paper
Practice 13MCQ2 marks
Consider the following git branches for a remote repository. question figure Consider the following git branches for a remote repository.
Text of the picture (copyable)
```
feature1
* feature2
main
```
Choose the correct git command sequence to merge *feature1* and *feature2* into the *main* branch.
  1. question figure
    text
    ```
    git merge feature1
    git merge feature2
    git merge main
    ```
  2. question figure
    text
    ```
    git checkout feature1
    git merge feature2
    git merge main
    ```
  3. question figure
    text
    ```
    git merge main
    git merge feature1
    git merge feature3
    ```
  4. question figure
    text
    ```
    git checkout main
    git merge feature1
    git merge feature2
    ```
MAD1 End Term · 13 Apr 2025 · open the full paper
Practice 14MSQ3 marksselect all that apply
Which of the following statements about server architectures, Apache and Nginx, is/are correct?
  1. Apache is better suited for handling a large volume of concurrent connectionsthan Nginx.
  2. Apache is versatile and supports a wide range of modules and dynamicconfigurations.
  3. Nginx is generally faster for serving static files and handling high traffic withlow memory usage.
  4. Both Apache and Nginx are open-source web servers.
MAD1 Quiz 1 · 23 Feb 2025 · open the full paper
Practice 15MCQ3 marks
question figure
Text of the picture (copyable)
Consider the following HTML document:

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <style>
        #container {
            border-style: dashed;
            background-color: red;
        }
        .content {
            border-style: solid;
            border-color: green;
            background-color: orange;
        }
        div {
            width: 250px;
            border: 3px dotted black;
            border-color: yellow;
        }
    </style>
</head>
<body>
    <div id="container" class="content" style="background-color: yellow;">
        <h2>Welcome to Web Dev</h2>
    </div>
</body>
</html>
```

How will the browser render the above HTML document?
  1. question figure
    text
    Welcome to Web Dev
  2. question figure
    text
    Welcome to Web Dev
  3. question figure
    text
    Welcome to Web Dev
  4. question figure
    text
    This is a screenshot of a web page element. It shows a red rectangular box with a dotted green border. Inside the box, the text "Welcome to Web Dev" is displayed in black, bold font.
MAD1 End Term · 22 Dec 2024 · open the full paper
Practice 16MCQ3 marks
Which of the following is an example of an application using Attribute-Based Access Control (ABAC)?
  1. A system where users are granted access based on their job roles within anorganization.
  2. A cloud service that grants or restricts access to files based on attributes suchas user department, job title, or current location.
  3. A file-sharing system where the file owner decides who can access theirdocuments.
  4. A system that enforces access based on security classifications and clearancelevels.
MAD1 End Term · 01 Sep 2024 · open the full paper
Practice 17MCQ2 marks
Consider that you have installed some python packages using requirements.txt. Which command you will use to list the installed packages in the virtual environment?
  1. pip list
  2. pip freeze
  3. ls -la
  4. ls
MAD1 End Term · 28 Apr 2024 · open the full paper
Practice 18MSQ2 marksselect all that apply
What is the name of the branch that we start with when we create a new git repository?
  1. main
  2. master
  3. develop
  4. feature
MAD1 End Term · 28 Apr 2024 · open the full paper
Practice 19MCQ2 marks
Which command of the below command creates a new branch in GIT?
  1. question figure
    text
    ```
    git new-branch <branch_name>
    ```
  2. question figure
    text
    ```
    git branch <branch_name>
    ```
  3. question figure
    text
    ```
    git new <branch_name>
    ```
  4. question figure
    text
    ```
    git create-branch <branch_name>
    ```
MAD1 End Term · 24 Dec 2023 · open the full paper
Practice 20MCQ2 marks
question figure
Text of the picture (copyable)
Consider the following statements and select the correct option.

**Statement 1:** The command, `git del <filename>` deletes the file from the staging area as well as from the working tree.

**Statement 2:** The command, `git rm --cached <filename>` deletes the file from the staging area but keeps it in the working tree.
  1. Statement 1 is correct, but statement 2 is incorrect.
  2. Statement 1 is incorrect, but statement 2 is correct.
  3. Both statements 1 and 2 are correct.
  4. Both statements 1 and 2 are incorrect.
MAD1 End Term · 24 Dec 2023 · open the full paper
Practice 21MCQ2 marks
Comprehension passage for this question
Based on the above data, answer the given subquestions. question figure
Which part of the response indicates the MIME type of the response body?
  1. charset=utf-8
  2. server: gunicorn/19.9.0
  3. content-type: text/html;
  4. None of these
MAD1 End Term · 24 Dec 2023 · open the full paper
Practice 22MCQ2 marks
Comprehension passage for this question
Based on the above data, answer the given subquestions. question figure
Which part of the response indicates that the request created a successful response?
  1. server: gunicorn/19.9.0
  2. content-type: text/html;
  3. HTTP/2 200
  4. None of these
MAD1 End Term · 24 Dec 2023 · open the full paper
Practice 23MCQ3 marks
What is the git command to change the registered e-mail of a user using CLI?
  1. question figure
    text
    ```
    git config email <new e-mail>
    ```
  2. question figure
    text
    ```
    git config user.email <new e-mail>
    ```
  3. question figure
    text
    ```
    git config --global email <new e-mail>
    ```
  4. question figure
    text
    ```
    git config --global user.email <new e-mail>
    ```
MAD1 End Term · 03 Sep 2023 · open the full paper
Practice 24MCQ2 marks
Which of the following git command will remove a file from the staged area but keeps the file in the directory?
  1. question figure
    text
    ```
    git rm <filename>
    ```
  2. question figure
    text
    ```
    git rm --cached <filename>
    ```
  3. question figure
    text
    ```
    git del <filename>
    ```
  4. question figure
    text
    ```
    git del --cached <filename>
    ```
MAD1 End Term · 30 Apr 2023 · open the full paper
Practice 25MCQ3 marks
Consider the following statements regarding Continuous Integration and Continuous Deployment and select the correct option. Statement 1: As part of continuous integration, frequent, isolated changes are tested and reported on as soon as they are added to a larger code base. Statement 2: When a change is made to an application, it is automatically deployed into production using a continuous deployment strategy.
  1. Statement 1 and statement 2 both are correct.
  2. Statement 1 and statement 2 both are incorrect.
  3. Statement 1 is correct and statement 2 is incorrect.
  4. Statement 1 is incorrect and statement 2 is correct.
MAD1 End Term · 30 Apr 2023 · open the full paper
Practice 26MCQ3 marks
question figure
Text of the picture (copyable)
Read the following statements regarding web accessibility principles and choose the correct option.

**Statement 1:** The command `git merge <branch_name>` merges all the change done to currently active branch.

**Statement 2:** The command `git merge <branch_name>` merges all the change done to master branch.
  1. Both statement 1 and statement 2 are correct
  2. Both statement 1 and statement 2 are incorrect
  3. Statement 1 is correct but statement 2 is incorrect
  4. Statement 1 is incorrect but statement 2 is correct
MAD1 End Term · 11 Dec 2022 · open the full paper
Practice 27MSQ3 marksselect all that apply
Which of the following statement(s) is/are false regarding Git?
  1. Git is an example of a centralized version control system.
  2. A file can stay in both working directory and staging area at a given time, whileworking with Git.
  3. Git and GitLab/GitHub are essentially the same.
  4. The command “git checkout -b ” will create the new branchand switches to the new branch created.
MAD1 End Term · 11 Dec 2022 · open the full paper
Practice 28MSQ3 marksselect all that apply
Which of the following statement(s) is/are true regarding database migrations?
  1. Flask does not provide support for migrations, as of December 2022.
  2. The database migration allows a developer to make schema changes withoutlosing the data
  3. One of the disadvantages of migration is that a developer can only upgradethe database, and it does not allow rollbacks.
  4. The migration is useful when a business wants to move from an on-premisedatabase to a cloud based database.
MAD1 End Term · 11 Dec 2022 · open the full paper
Practice 29MCQ2 marks
In the given HTML template, to correctly embed a URL in the href, the argument "user" in the "url_for" function must be a __________________? question figure In the given HTML template, to correctly embed a URL in the href, the argument "user" in the "url_for" function must be a __________________?
Text of the picture (copyable)
```html
<a href = {{ url_for('user')}}>Click here</a>
```
  1. A view function name
  2. An HTML template name
  3. A URL
  4. An environment variable
MAD1 End Term · 11 Dec 2022 · open the full paper
Practice 30MSQ3 marksselect all that apply
Which of the following statement(s) is/are true regarding Git?
  1. question figure
    text
    Git is an example of a centralized version control system.
  2. question figure
    text
    A file can stay in both working directory and staging area at a given time, while working with Git.
  3. question figure
    text
    Git and GitLab/GitHub are essentially the same.
  4. question figure
    text
    The command "git checkout -b <branch_name>" will create the new branch and switches to the new branch created.
MAD1 End Term · 11 Dec 2022 · open the full paper
Practice 31MSQ3 marksselect all that apply
Which of the following statement(s) is/are false regarding database migrations?
  1. Flask does not provide support for migrations, as of December 2022.
  2. The database migration allows a developer to make schema changes withoutlosing the data.
  3. One of the disadvantages of migration is that a developer can only upgradethe database, and it does not allow rollbacks.
  4. The migration is useful when a business wants to move from an on-premisedatabase to a cloud based database.
MAD1 Quiz 2 · 10 Jul 2022 · open the full paper
Practice 32MCQ3 marks
Consider the table “production” in SQLite database given below: question figure Consider the table “production” in SQLite database given below:
Text of the picture (copyable)
| Manufacturer | Product | Quantity | Cost |
|---|---|---|---|
| Industry A | Biscuits | 3 | 100 |
| Industry B | Shoes | 2 | 500 |
| Industry A | Chocolate | 10 | 200 |
| Industry C | Pen | 20 | 50 |
| Industry B | Shirts | 5 | 700 |
| Industry D | Beverages | 30 | 150 |
| Industry C | Notebook | 40 | 250 |

What will be the output of the SQL query given below?

```sql
SELECT Manufacturer, COUNT(*)
FROM production
WHERE Quantity>10
GROUP BY Manufacturer
HAVING COUNT(*)=2;
```
  1. question figure
    text
    ```
    | Manufacturer | COUNT(*) |
    |---|---|
    | Industry D | 1 |
    ```
  2. question figure
    text
    ```
    Manufacturer|COUNT(*)
    Industry C  |2
    ```
  3. question figure
    text
    ```
    Manufacturer|COUNT(*)
    Industry C  |2
    Industry D  |1
    ```
  4. question figure
    text
    ```
    Manufacturer|COUNT(*)
    Industry C  |1
    Industry D  |2
    ```
MAD1 Quiz 2 · 10 Jul 2022 · open the full paper
Practice 33MCQ2 marks
Consider a situation, where a developer wants to create his own customized application and wants to deploy it for the end users. For that, he wants a development environment that consists of some programming language execution environment, an operating system, a web server and a database, such that he can build, compile and run his programs without worrying about the servers, storage, and networking. Which of the following service models he would prefer in order to do so?
  1. SaaS
  2. PaaS
  3. IaaS
  4. None of these