MAD Study Hub

Home / Past papers / MAD1 Quiz 1 / this paper

IIT M FOUNDATION AN4 EXAM QPF4 16 JULY 2023 - 16 Jul 2023

MAD1 Quiz 116 questions50 marks16 MCQFoundation / QPF4
Elapsed 00:00
Q1MCQ2 marks
Which of the following statements is/are true?
  1. HTTP headers (for example “Content-Type”) are case-sensitive
  2. The body/payload in an HTTP request is mandatory
  3. The “Content-Length” header indicates the size of the request body in bytes
  4. All of these
Q2MCQ2 marks
question figure
Text of the picture (copyable)
Consider a square matrix A given below.

A =
```
⎡ 12  21  25 ⎤
⎢ 11   8  30 ⎥
⎣  9  19  17 ⎦
```

Matrix B is another matrix whose elements represent the LSBs of binary equivalent of corresponding elements of matrix A. The determinant of matrix B would be __________.
  1. 0
  2. 1
  3. 2
  4. 3
Q3MCQ2 marks
question figure
Text of the picture (copyable)
Consider the image given below.

Email or phone
example.gmail@com

! Enter a valid email or phone number

Forgot email?

When a user enters an invalid email or phone number, an error message is displayed which clearly tells him/her about what went wrong. Which usability heuristic principle best describes the above behavior?
  1. Aesthetic and minimalist design
  2. User control and freedom
  3. User diagnosis and recovery from errors
  4. Flexibility and ease of use
Q4MCQ2 marks
question figure
Text of the picture (copyable)
Consider the given URL below.

```
https://www.host.com/tutorials/what-is-a-domain-name
```

Select the appropriate option that correctly identifies different components of a given URL.
  1. question figure
    text
    Protocol: https
    Domain: www
    Sub-Domain: host.com
    Path: /tutorials/what-is-a-domain-name
  2. question figure
    text
    Protocol: https
    Domain: www
    Sub-Domain: host.com/tutorials
    Path: /what-is-a-domain-name
  3. question figure
    text
    ```
    Protocol: https
    Domain: host.com
    Sub-Domain: www
    Path: /tutorials/what-is-a-domain-name
    ```
  4. question figure
    text
    ```
    Protocol: https
    Domain: host.com /tutorials
    Sub-Domain: www
    Path: /what-is-a-domain-name
    ```
Q5MCQ3 marks
question figure
Text of the picture (copyable)
Let L = { 'a', 'b', 'c', 'd', 'A', 'B', 'C', 'D', '0', '1', ' ', ' '} be a complete character set (i.e., only these characters can be used to represent text in the document). If a document that uses fixed encoding for all characters is created using the character set L and has a disk size of 2 Kilobytes, the number of characters in the documents would be ______. [Take 1 Byte = 8 bits, 1 KB = 1000 Bytes, 1 MB = 1000 Kilobytes and so on.]
  1. 2000
  2. 4000
  3. 8000
  4. 16000
Q6MCQ3 marks
A mobile client starts from and is cruising away continuously at 60 kmph from the network tower whose network range is 40 km and bandwidth is 120 Mbps. How much data (in Gigabytes) will be consumed by the client who is continuously using the entire bandwidth before completely moving out of the network? [Take 1 Byte = 8 bits, 1 KB = 1000 Bytes, 1 MB = 1000 Kilobytes and so on.] [Consider the speed of light in air to be 3 x 108 m/sec.]
  1. 24
  2. 28.8
  3. 36
  4. 288
Q7MCQ3 marks
What will be the output of the following Python code snippet on the terminal. question figure What will be the output of the following Python code snippet on the terminal.
Text of the picture (copyable)
```python
from string import Template

temp = "A student needs to complete $c1 level to get to the {{c2}} level."

temp = Template(temp)
out = temp.substitute({'c1':'foundation', 'c2':'diploma'})
print(out)
```
  1. question figure
    text
    A student needs to complete $c1 level to get to the diploma level.
  2. question figure
    text
    A student needs to complete foundation level to get to the
    {{c2}} level.
  3. question figure
    text
    A student needs to complete foundation level to get to the diploma level.
  4. question figure
    text
    ```
    KeyError: 'c2'
    ```
Q8MCQ3 marks
question figure
Text of the picture (copyable)
Consider a `<span>` element and the styling given to it in `<style>` tag using element selector in the HTML file below.

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <title>Span</title>
    <style>
        span{
            color: blue;
            Background-color: lime;
        }
    </style>
</head>
<body>
    <span id="my_span">MAD-I is a Diploma level course.</span>
</body>
</html>
```

What will be the final style applied to `<span>` tag if an additional style is added via the ID selector given below?

```css
#my_span{
    width: 1200px;
    Background-color: lightpink;
}
```
  1. question figure
    text
    ```css
    color: blue;
    Background-color: lightpink;
    ```
  2. question figure
    text
    ```css
    color: blue;
    width: 1200px;
    Background-color: lime;
    ```
  3. question figure
    text
    ```css
    color: blue;
    width: 1200px;
    Background-color: lightpink;
    ```
  4. question figure
    text
    ```css
    width: 1200px;
    Background-color: lightpink;
    ```
Q9MCQ3 marks
What is the correct sequence of working of Client-Server Architecture. a. The client asks for the IP address for the particular server from the Domain Name system. b. To that IP address, the client sends the request to the particular server with that port number that is specified to the particular application and then server responds c. The DNS server responds with the IP address. d. The response message is received by the client and based on that port number, the response packet is consumed by the application to which it belongs.
  1. c → a → b → d
  2. a → b → c → d
  3. a → c → b → d
  4. None
Q10MCQ3 marks
Consider the following HTML document. question figure Consider the following HTML document.
Text of the picture (copyable)
```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        p {
            background-color: yellow;
            color: red;
            display: inline-block;
        }
        #id {
            border: 2px solid purple;
            color:blue ;
        }
        .class {
            background-color: aqua;
            color: red;
        }
    </style>
</head>
<body>
    <p class="class" id="id">HTML</p>
    <p class="class" >HTML</p>
    <p>HTML</p>
</body>
</html>
```
How will the browser render above HTML file?
  1. question figure
    text
    The image displays three rectangular boxes stacked vertically, each containing the text "HTML".
    
    1.  **Top box:** Cyan background, blue text, purple border.
    2.  **Middle box:** Cyan background, red text, no visible border.
    3.  **Bottom box:** Yellow background, red text, no visible border.
  2. question figure
    text
    The image displays three rectangular boxes, each containing the text "HTML".
    
    1.  **Left Box:** A light blue rectangle with the text "HTML" in red. The text appears slightly blurred.
    2.  **Middle Box:** A light blue rectangle with a purple border. The text "HTML" is in blue.
    3.  **Right Box:** A yellow rectangle with the text "HTML" in red, with a gradient effect making it appear orange/yellow in some parts. The text also appears slightly blurred.
  3. question figure
    text
    The image displays three rectangular blocks, each containing the text "HTML".
    
    1.  **Left Block:** A cyan rectangle with a purple border. The text "HTML" is in blue.
    2.  **Middle Block:** A cyan rectangle with no border. The text "HTML" is in red.
    3.  **Right Block:** A yellow rectangle with no border. The text "HTML" is in red.
  4. question figure
    text
    The image displays three rectangular blocks, each containing the text "HTML".
    
    1.  **Left block:** A cyan-colored rectangle with the text "HTML" in red. The text has a slight shadow effect.
    2.  **Middle block:** A yellow-colored rectangle with the text "HTML" in red. The text also has a slight shadow effect.
    3.  **Right block:** A cyan-colored rectangle with a purple border. The text "HTML" is in blue and has a slight shadow effect.
Q11MCQ3 marks
Consider the following Python code snippet. question figure Consider the following Python code snippet.
Text of the picture (copyable)
app.py

```python
from jinja2 import Template
import sys
input_list = sys.argv
Name, profession = input_list[1], input_list[2]

if input_list[1]=="Meera":
    profession="Data Analyst"
else:
    pass
template = """
<!DOCTYPE html>
<html>
<div>
    {{Name}}
    {{Profession}}
</div>
</html>
"""

t = Template(template)
print(t.render(Name = name, Profession = profession))
```

Map the commands in column A with the correct rendered output in the browser in column B.

| Column A | Column B |
|---|---|
| a) python app.py Kartik Doctor | 1) Meera Data Analyst |
| b) python app.py Meera Scientist | 2) Ajay Singer |
| c) python app.py Ajay Singer | 3) Kartik Web |
| d) python app.py Kartik Web Developer | 4) Kartik Doctor |
| | 5) Kartik Web Developer |
  1. a - 4, b - 1, c - 2, d - 5
  2. a - 3, b - 2, c - 1, d - 4
  3. a - 4, b - 1, c - 2, d - 3
  4. a - 5, b - 1, c - 3, d - 2
Q12MCQ4.5 marks
Consider the following Python code snippet: question figure Consider the following Python code snippet:
Text of the picture (copyable)
```python
from pyhtml import *

code = html(
    head(style('div{border:2px solid black;margin: 2px; width: 200px;}')),
    body(==== BODY CONTENT ====)
)
print(code.render())
```
If the text "==== BODY CONTENT ====" is replaced by each option in column A and rendered, which of the following mapping between column A and Column B is correct?

| Column A | Column B |
|---|---|
| a) div('Hello'),div(),div() | 1) Hello (three overlapping rectangles around "Hello") |
| b) div(),div(div('Hello')) | 2) Hello (one rectangle around "Hello", with three horizontal lines below it) |
| c) div(div(div('Hello'))) | 3) Hello (three concentric rectangles around "Hello") |
| d) div(div('Hello'),div()) | 4) Hello (two overlapping rectangles around "Hello") |
  1. a - 1, b - 3, c - 4, d - 2
  2. a - 2, b - 3, c - 1, d - 4
  3. a - 3, b - 1, c - 2, d - 4
  4. a - 4, b - 2, c - 1, d - 3
Q13MCQ4.5 marks
question figure
Text of the picture (copyable)
Consider the following HTML document and select the DOM structure that
correctly represents the HTML document.

```html
<!DOCTYPE html>
<head>
    <title>My title</title>
</head>
<body>
    <h1>A heading</h1>
    <a href="link">Link text</a>
</body>
</html>
```
  1. question figure
    text
    This is a diagram representing a hierarchical structure, likely a Document Object Model (DOM) tree for an HTML document.
    
    The diagram consists of several rounded rectangular nodes connected by lines, indicating parent-child relationships.
    
    - **Document** (pink node) is at the top.
      - It connects to **html** (purple node).
        - **html** connects to two blue nodes: **<Head>** and **<body>**.
          - **<Head>** connects to **<title>** (yellow node).
            - **<title>** connects to **"My title"** (brown node).
          - **<body>** connects to **<h1>** (yellow node).
            - **<h1>** connects to **'A heading'** (brown node).
            - **<h1>** also connects to **<a>** (yellow node).
              - **<a>** connects to **"Link text"** (brown node).
              - **<a>** also connects to **Attr=href** (purple node) via a horizontal line.
  2. question figure
    text
    This is a tree diagram representing the structure of an HTML document.
    
    The root node is a pink rectangle labeled "Document".
    An arrow points from "Document" to a purple rounded rectangle labeled "html".
    
    From "html", two arrows point to:
    1. A blue rounded rectangle labeled "<Head>"
    2. A blue rounded rectangle labeled "<body>"
    
    From "<Head>", an arrow points to a yellow rounded rectangle labeled "<title>".
    From "<title>", an arrow points to a beige rounded rectangle labeled "\"My title\"".
    
    From "<body>", two arrows point to:
    1. A yellow rounded rectangle labeled "<h1>"
    2. A yellow rounded rectangle labeled "<a>"
    
    From "<h1>", an arrow points to a beige rounded rectangle labeled "\"A heading\"".
    
    From "<a>", two arrows point to:
    1. A beige rounded rectangle labeled "\"Link text\""
    2. A light purple rounded rectangle labeled "Attr-href"
  3. question figure
    text
    This is a diagram representing a hierarchical structure, likely an HTML DOM tree.
    
    The diagram shows the following elements and their relationships:
    - A pink rounded rectangle labeled "Document" at the top.
    - A black line connects "Document" to a purple rounded rectangle labeled "html".
    - A black line connects "html" to a blue rounded rectangle labeled "<body>".
    - A black line connects "<body>" to a yellow rounded rectangle labeled "<h1>".
    - A black line connects "<h1>" to a yellow rounded rectangle labeled ""A heading"".
    - A black line connects "<h1>" to another yellow rounded rectangle labeled "<a>".
    - A black line connects "<a>" to a yellow rounded rectangle labeled ""Link text"".
    - A black line connects "<a>" to a light purple rounded rectangle labeled "Attr=href".
  4. question figure
    text
    This is a diagram representing a Document Object Model (DOM) tree.
    
    The root node is "Document" (pink rectangle).
    An arrow points from "Document" to "html" (purple rounded rectangle).
    From "html", there are three branches:
    1. An arrow points to "<title>" (yellow rounded rectangle).
       An arrow points from "<title>" to "\"My title\"" (brown rounded rectangle).
    2. An arrow points to "<h1>" (yellow rounded rectangle).
       An arrow points from "<h1>" to "\"A heading\"" (brown rounded rectangle).
    3. An arrow points to "<a>" (yellow rounded rectangle).
       From "<a>", there are two branches:
       a. An arrow points to "\"Link text\"" (brown rounded rectangle).
       b. An arrow points to "Attr=href" (purple rounded rectangle).
Q14MCQ4.5 marks
Consider the following Python code snippet. question figure Consider the following Python code snippet.
Text of the picture (copyable)
```python
from jinja2 import Template

temp = """
{% for vid, members in interfaces|groupby(attribute='lan') %}
    Interfaces in lan {{ vid }}: {{ members|map(attribute='name')
    | join(', ') }}
{% endfor %}
"""

interfaces = [
    {"name":"Ethernet1","lan":50},
    {"name":"Ethernet2","lan":40},
    {"name":"Ethernet3","lan":50},
    {"name":"Ethernet4","lan":60}
]

output = Template(temp)
print(output.render(interfaces=interfaces))
```

What will be the output of above python code on the terminal.
  1. question figure
    text
    Interfaces in lan 50: Ethernet1
    Interfaces in lan 40: Ethernet2
    Interfaces in lan 50: Ethernet3
    Interfaces in lan 60: Ethernet4
  2. question figure
    text
    Interfaces in lan 40: Ethernet1, Ethernet3
    Interfaces in lan 50: Ethernet2
    Interfaces in lan 60: Ethernet4
  3. question figure
    text
    Interfaces in lan 40: Ethernet2
    Interfaces in lan 50: Ethernet1, Ethernet4
    Interfaces in lan 60: Ethernet3
  4. question figure
    text
    Interfaces in lan 40: Ethernet2
    Interfaces in lan 50: Ethernet1, Ethernet3
    Interfaces in lan 60: Ethernet4
Comprehension passage - the questions below it refer to this
A Flask application and its absolute path is given below. question figure A Flask application and its absolute path is given below. Based on the above data, answer the given subquestions.
Q15MCQ3 marks
question figure
Text of the picture (copyable)
If the application is run locally on
http://127.0.0.1:5000 using the command
python app.py, what will be rendered
by the browser for URL
http://127.0.0.1:5000/home?
  1. question figure
    text
    static url path: C:\home\mad_1\static
    static folder: /static
  2. question figure
    text
    static url path: /static
    static folder: C:\home\mad_1\static
  3. question figure
    text
    static url path: /stable
    static folder: C:\home\mad_1\stable
  4. question figure
    text
    static url path: /static
    static folder: C:\home\mad_1\stable
Q16MCQ4.5 marks
question figure
Text of the picture (copyable)
If the application is run locally on
http://127.0.0.1:5000 using the command
python app.py stable, what will be
rendered by the browser for URL
http://127.0.0.1:5000/home?
  1. question figure
    text
    static url path: /static
    static folder: C:\home\mad_1\static
  2. question figure
    text
    static url path: /stable
    static folder: C:\home\mad_1\stable
  3. question figure
    text
    static url path: C:\home\mad_1\stable
    static folder: /stable
  4. question figure
    text
    static url path: /stable
    static folder: C:\home\mad_1\static

Answer key

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

Concepts this paper tests

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

Summary of Core Topics and Concepts

1. HTTP Protocol

2. Usability Heuristics

3. URL Structure

4. Character Encoding and Disk Size

5. Network Bandwidth and Data Consumption

6. Python String Template

7. CSS Specificity

8. Client-Server Architecture

9. HTML and CSS Rendering

10. Jinja2 Templating

11. Flask Application