Quiz Space

January 2023 term · Modern Application Development I · BSCS2003

MAD 1 Quiz 1: 26 February 2023 (January 2023 term)

The IIT Madras BS Modern Application Development I (MAD 1) Quiz 1 paper sat on 26 Feb 2023, in the January 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
14
MSQ
2

Updated

Official paper: IIT M DIPLOMA AN2 EXAM QPD2 26 Feb 2023 · No negative marking.

Question 1

+3 marksOne correct option

Consider a simple web server using command prompt.

Filename - Hello.sh

bash
#!/bin/bash
while true; do
echo -e "Today's date and time is \n\t $(date)"
| nc -l localhost 3500;
done

If this program is executed in one terminal, and it is waiting for a request, then identify the client part that generates the request to this server.

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

Correct answer

  • B

Question 2

+3 marksOne correct option
  1. A

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

  2. B

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

  3. C

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

  4. D

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

Show answer

Correct answer

  • D

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

Question 3

+3 marksOne correct option

Which of the following is an incorrect way of creating an ordered list in HTML?

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

Correct answer

  • C

Question 4

+3 marksOne correct option

Consider the following Python code snippet.

python
from jinja2 import Template
newlist = ['client', 'server', 'markup', 'api', 'url', 'net' ]
this_template = "{% for object in data %} \\
{% if object|length>4 %}{{object }}{% endif %}{% endfor %}"
out = Template(this_template)
print(out.render(data = newlist))

What will be the output on the terminal?

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

Correct answer

  • D

Question 5

+3 marksOne correct option

Consider two python files, home.py and hello.py with following code snippets.

File1: home.py

python
import sys
import hello
print('Hello' + ' ' + sys.argv[1])

File2: hello.py

python
import sys
print('Hello' + ' ' + sys.argv[0])

What is the output of the following command “python home.py hello.py Mithun Sourav”?

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

Correct answer

  • C

Question 6

+3 marksOne correct option

Which of the following option represents a one-to-many relationship in the Entity-Relationship Diagram?

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

Correct answer

  • D

Question 7

+3 marksOne correct option

A text document of size 2000 bytes. Each character in the document are 8 bits ASCII encoding. What is the number of characters in the text document?
[Note: 8 bits = 1 byte]

  1. A

    250

  2. B

    1000

  3. C

    2000

  4. D

    8000

Show answer

Correct answer

  • C

    2000

Question 8

+2 marksOne correct option

Ram wants to do the following operations on his bank website through the browser.
Find the HTTP methods conventionally used for the following operations?
1. To create a new fixed deposit account
2. To read his transaction history
3. To update the account after the transaction of money.
4. To remove his unused account.

  1. A

    1 - GET, 2- POST, 3 - PUT, 4 - DELETE

  2. B

    1 - POST, 2- GET, 3 - PUT, 4 - PATCH

  3. C

    1 - POST, 2- GET, 3 - PUT, 4 - DELETE

  4. D

    1 - PUT, 2- GET, 3 - POST, 4 - DELETE

Show answer

Correct answer

  • C

    1 - POST, 2- GET, 3 - PUT, 4 - DELETE

Question 9

+2 marksOne correct option
  1. A

    1110000

  2. B

    1101111

  3. C

    1100000

  4. D

    1111000

Show answer

Correct answer

  • B

    1101111

Question 10

+2 marksOne correct option

Find the output of the python program for the given command line arguments

Program:

python
import sys
a,b,c = sys.argv[1], sys.argv[2], sys.argv[3]
print(b,c)

Execution with command line arguments:

$ python3 cl.py 10 11 12

  1. A

    cl.py 10

  2. B

    10 11

  3. C

    11 12

  4. D

    cl.py 11

Show answer

Correct answer

  • C

    11 12

Question 11

+2 marksOne correct option
  1. A

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

  2. B

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

  3. C

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

  4. D

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

Show answer

Correct answer

  • C

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

Question 12

+4.5 marksOne correct option
  1. A

    1,2,3,4

  2. B

    1,2,3

  3. C

    1,3

  4. D

    2,3

Show answer

Correct answer

  • D

    2,3

Question 13

+4.5 marksOne correct option

Read the statements given below carefully and select the correct option.
Statement 1: If an element that belongs to two different classes is styled externally using both the classes, then for the same attribute, it will acquire styling from the latest class in order. Statement 2: If an element having an ID and a class is styled externally using both its ID and the class, then for the same attribute, it will acquire styling from the latest selector in order.

  1. A

    Both statements 1 and 2 are correct

  2. B

    Both statements 1 and 2 are incorrect

  3. C

    Statement 1 is correct but statement 2 is incorrect

  4. D

    Statement 2 is correct but statement 1 is incorrect

Show answer

Correct answer

  • C

    Statement 1 is correct but statement 2 is incorrect

Question 14

+4.5 marksOne correct option

Consider the following HTML document.

html
<!DOCTYPE html>
<html lang="en">
<head>
<style>
#mybox{
border-style: dashed;
background-color: orange;
}
.boxes{
border-style: solid;
border-color: blue;
}
div{
width: 200px;
border: 4px dotted yellow;
}
</style>
</head>
<body>
<div id="mybox" class="boxes" style="background-color: limegreen;">
<h1>Hello MAD-I</h1>
</div>
</body>
</html>

How will the browser render the above HTML document?

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

Correct answer

  • C

Question 15

+4.5 marksOne or more correct options

Select all that apply.

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

Correct answers

  • A
  • B
  • D

Question 16

+3 marksOne or more correct options

Which of the following are the correct regarding the web server?

Select all that apply.

  1. A

    A web server is a computer system capable of delivering web content over the internet.

  2. B

    A web server sends the response as an HTML document which is rendered on the user’s screen.

  3. C

    A web server listens for incoming network connections on a fixed port.

  4. D

    A web server is a software that allows to send the request over the internet.

Show answer

Correct answers

  • A

    A web server is a computer system capable of delivering web content over the internet.

  • B

    A web server sends the response as an HTML document which is rendered on the user’s screen.

  • C

    A web server listens for incoming network connections on a fixed port.