Quiz Space

May 2022 term · Modern Application Development I · BSCS2003

Modern Application Development I Quiz 1: 5 June 2022 (May 2022 term)

The IIT Madras BS Modern Application Development I (MAD 1) Quiz 1 paper sat on 5 Jun 2022, in the May 2022 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
15
MSQ
1

Updated

Official paper: IIT M DIPLOMA QUIZ1 EXAM QPE1 05 Jun 2022 IBA · No negative marking.

Question 1

+2 marksOne correct option

Which of the following statement is true about MVC architecture?

  1. A

    The view redirects the incoming request to model.

  2. B

    In MVC architecture, the model defines the business-logic layer.

  3. C

    The controller passes data model information to view.

  4. D

    It is not possible to share a view across multiple controllers.

Show answer

Correct answer

  • C

    The controller passes data model information to view.

Question 2

+2 marksOne correct option

The hexadecimal representation of the number 54578 is ___________ .

  1. A

    A2F

  2. B

    B1F

  3. C

    B2F

  4. D

    C1E

Show answer

Correct answer

  • C

    B2F

Question 3

+2 marksOne correct option

Consider a file consisting of 2000 alphanumeric characters including spaces. How much would be the total occupied space in bits, assuming UCS-4 is used?

  1. A

    64000 bits

  2. B

    32000 bits

  3. C

    24000 bits

  4. D

    12000 bits

Show answer

Correct answer

  • A

    64000 bits

Question 4

+2 marksOne correct option

Choose the correct internal CSS that sets the body background color to green and the heading color of the text to red.

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

Correct answer

  • B

Question 5

+3 marksOne correct option

Consider the following HTML code below.

html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<style>
body{text-align: center}
p{font-size: 30px;font-style: italic;color: black;}
.blue{color: green;}
.red{color: blue;}
.green{color: red;}
#myId{color: grey;}
</style>
</head>
<body>
<div>
<h2>Welcome to IIT</h2>
<p class="blue red green">Paragraph 1</p>
<p class="red blue green" id="myId">Paragraph 2</p>
<p class="green red blue">Paragraph 3 </p>
</div>
</body>
</html>

How will the browser render the above given HTML file?

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

Correct answer

  • A

Question 6

+3 marksOne correct option

Consider the following Python code snippet.

filename: code.py

python
import sys
my_args = sys.argv
print("The python file name is:", my_args[1])
print(f"My username is: {my_args[3]}{my_args[4]}")

What will be the output on console if the command given is:

bash
python code.py output.py Appdev Michael 2003 1003
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 7

+3 marksOne correct option

Consider the PyHTML program.

python
from pyhtml import *
def items(ctx):
for title, page in [("coffee", "/drink.html"),
("kitkat", "/chocolate.html"),
("good day", "/biscuit.html")]:
yield li(a(href=page)(title))
t = html(head(title("Grocery")), body(ol(items)))
print(t.render())

What will be the output of the above program?

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

Correct answer

  • C

Question 8

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

Correct answer

  • A

Question 9

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

Correct answer

  • D

Question 10

+3 marksOne correct option

Consider the following code.

python
from jinja2 import Template
template = """
{% for i in range(2) %}
{{user[i]}}'s marks are
{{mark[i]}}
{% endfor %}
"""
user = { 0: "Balu", 1: "Kala"}
mark = [[30,40,56,78],[25,67,80,90]]
x = Template(template)
print(x.render(user = user, mark = mark))

What will be the output of above program?

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

Correct answer

  • C

Question 11

+3 marksOne correct option

For a network bandwidth of 8 Gbps, what should be the size of each request if 5000 such requests are to be sent over the network per second? [Use these relations: 1 Byte = 8 bits, 1 KB = 1000 Bytes, 1 MB = 1000 KBs and so on.]

  1. A

    1.6 KB

  2. B

    200 KB

  3. C

    1.6 MB

  4. D

    200 MB

Show answer

Correct answer

  • B

    200 KB

Question 12

+3 marksOne or more correct options

Which of the following statements is/are true about an HTML 5 document?

Select all that apply.

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

Correct answers

  • A
  • C

Question 13

+4.5 marksOne correct option

Consider the following HTML document with an embedded style sheet.

html
<!DOCTYPE html>
<html>
<head>
<title>Quiz 1</title>
<style type="text/css">
div{
padding-left: 10px;
margin-right: 15px;
border-style: solid;
border-width: 5px;
width: 2000px;
height: 20px;
}
</style>
</head>
<body>
<div>My first Div element</div>
</body>
</html>

Which of the following figures correctly represents the box model of the above HTML document?

  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
Config_1 = {1:"red",2:"blue",3:"green",4:"yellow"}
Config_2 = {1:"pink",2:"orange",3:"brown",4:"darkblue"}
test_temp = """
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
*{
margin: 0px;
width: 253px;
}
div{
margin: 10px;
padding: 20px;
border-style: solid;
border-width: 10px;
font-size: 30px;
color: {{Config_1[1]}};
background-color: {{Config_2[1]}};
border-color: {{Config_2[4]}};
}
</style>
<title>Quiz 1</title>
</head>
<body>
<div>
My first Div element
</div>
</body>
</html>
"""
output = Template(test_temp)
print(output.render(Config_1 = Config_1, Config_2 = Config_2))

How will the browser render the HTML file generated by the above Python code?

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

Correct answer

  • C

Question 15

+4.5 marksOne correct option

Consider the DOM structure given below.

If an HTML document is to be programmatically created using Pyhtml whose DOM structure is exactly the same as the one given above, which of the following Pyhtml code will correctly create the document?

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

Correct answer

  • D

Question 16

+4.5 marksOne correct option

Consider a client which is located 6000 kilometers from the server makes a request through the cable. Suddenly after the request reaches the server, the cable breaks and the response is now to be sent to the client via air with the help of repeaters which added a delay of 75 milliseconds. How long will the client have to wait before receiving the response? [Note: the speed of light on cable is 2 ×10⁸ m/sec and that in air is 3 ×10⁸ m/sec.]

  1. A

    50 milliseconds

  2. B

    135 milliseconds

  3. C

    125 milliseconds

  4. D

    115 milliseconds

Show answer

Correct answer

  • C

    125 milliseconds