Quiz Space

May 2023 term · Modern Application Development I · BSCS2003

Modern Application Development I Quiz 1: 16 July 2023 (May 2023 term)

The IIT Madras BS Modern Application Development I (MAD 1) Quiz 1 paper sat on 16 Jul 2023, in the May 2023 term: 16 questions for 50 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.

Questions
16
Marks
50
Duration
120 min
MCQ
16

Updated

Official paper: IIT M FOUNDATION AN2 EXAM QPF2 16 JULY 2023 · No negative marking.

Question 1

+2 marksOne correct option

Which of the following statements is/are true?

  1. A

    HTTP headers (for example “Content-Type”) are case-sensitive

  2. B

    The body/payload in an HTTP request is mandatory

  3. C

    The “Content-Length” header indicates the size of the request body in bytes

  4. D

    All of these

Show answer

Correct answer

  • C

    The “Content-Length” header indicates the size of the request body in bytes

Question 2

+2 marksOne correct option

Consider a square matrix A given below.

A=[1221251183091917]A = \begin{bmatrix} 12 & 21 & 25 \\ 11 & 8 & 30 \\ 9 & 19 & 17 \end{bmatrix}

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. A

    0

  2. B

    1

  3. C

    2

  4. D

    3

Show answer

Correct answer

  • A

    0

Question 3

+2 marksOne correct option
  1. A

    Aesthetic and minimalist design

  2. B

    User control and freedom

  3. C

    User diagnosis and recovery from errors

  4. D

    Flexibility and ease of use

Show answer

Correct answer

  • C

    User diagnosis and recovery from errors

Question 4

+2 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 5

+3 marksOne correct option
  1. A

    2000

  2. B

    4000

  3. C

    8000

  4. D

    16000

Show answer

Correct answer

  • B

    4000

Question 6

+3 marksOne correct option

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 10⁸ m/sec.]

  1. A

    24

  2. B

    28.8

  3. C

    36

  4. D

    288

Show answer

Correct answer

  • C

    36

Question 7

+3 marksOne correct option

What will be the output of the following Python code snippet on the terminal.

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. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 8

+3 marksOne correct option

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. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 9

+3 marksOne correct option

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. A

    c → a → b → d

  2. B

    a → b → c → d

  3. C

    a → c → b → d

  4. D

    None

Show answer

Correct answer

  • C

    a → c → b → d

Question 10

+3 marksOne correct option

Consider the following HTML document.

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. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 11

+3 marksOne correct option

Consider the following Python code snippet.

  1. A

    a - 4, b - 1, c - 2, d - 5

  2. B

    a - 3, b - 2, c - 1, d - 4

  3. C

    a - 4, b - 1, c - 2, d - 3

  4. D

    a - 5, b - 1, c - 3, d - 2

Show answer

Correct answer

  • C

    a - 4, b - 1, c - 2, d - 3

Question 12

+4.5 marksOne correct option

Consider the following Python code snippet:

  1. A

    a - 1, b - 3, c - 4, d - 2

  2. B

    a - 2, b - 3, c - 1, d - 4

  3. C

    a - 3, b - 1, c - 2, d - 4

  4. D

    a - 4, b - 2, c - 1, d - 3

Show answer

Correct answer

  • B

    a - 2, b - 3, c - 1, d - 4

Question 13

+4.5 marksOne correct option

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. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 14

+4.5 marksOne correct option

Consider the following Python code snippet.

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. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 15

+3 marksOne correct option

A Flask application and its absolute path is given below.

bash
C:\home\mad_1>

app.py

python
from flask import Flask, url_for
import sys
def create_path():
if len(sys.argv) < 2:
return '/static'
else:
return f'/{sys.argv[1]}'
app = Flask(__name__, static_url_path = create_path())
@app.route('/home')
def display():
return f"<h3>static url path: {app.static_url_path}</h3>\
<h3>static folder: {app.static_folder}</h3>"
app.run(debug = True)

Based on the above data, answer the given subquestions.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 16

+4.5 marksOne correct option

A Flask application and its absolute path is given below.

bash
C:\home\mad_1>

app.py

python
from flask import Flask, url_for
import sys
def create_path():
if len(sys.argv) < 2:
return '/static'
else:
return f'/{sys.argv[1]}'
app = Flask(__name__, static_url_path = create_path())
@app.route('/home')
def display():
return f"<h3>static url path: {app.static_url_path}</h3>\
<h3>static folder: {app.static_folder}</h3>"
app.run(debug = True)

Based on the above data, answer the given subquestions.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D