uiz Space

September 2025 term · Modern Application Development I · BSCS2003

Modern Application Development I Quiz 2: 23 November 2025 (September 2025 term)

The IIT Madras BS Modern Application Development I (MAD 1) Quiz 2 paper sat on 23 Nov 2025, in the September 2025 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
11
MSQ
5

Updated

Official paper: IIT M DIPLOMA AN EXAM QDD2 23 Nov 2025 NEW · No negative marking.

Question 1

+3 marksOne correct option

A client sends a signal to a satellite 36,000 km above Earth. Speed of electromagnetic waves in vacuum = 3 × 10⁸ m/s. Compute RTT for client ↔ satellite.

  1. A

    0.24 s

  2. B

    0.36 s

  3. C

    0.48 s

  4. D

    0.72 s

Show answer

Correct answer

  • A

    0.24 s

Question 2

+3 marksOne correct option

Consider the following flask app.

python
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return "Home"
@app.route('/hello')
@app.route('/hi')
def greet():
return "Hello World!"
@app.route('/hello/<name>')
def greet_name(name):
return f"Hello {name}"
if __name__ == "__main__":
app.run()

What will be the output if you visit 127.0.0.1:5000/hello ?

  1. A

    "Hello World!"

  2. B

    "Home"

  3. C

    404 Not Found

  4. D

    "Hello /hello"

Show answer

Correct answer

  • A

    "Hello World!"

Question 3

+3 marksOne correct option

Consider the following flask app.

python
from flask import Flask
app = Flask(__name__)
@app.route('/data')
def data_get():
return "GET Data"
@app.route('/data/<int:id>')
def data_id(id):
return f"Data ID: {id}"
if __name__ == "__main__":
app.run()

If a POST request is sent to 127.0.0.1:5000/data/5, what will be the output on the browser?

  1. A

    "GET Data"

  2. B

    "Data ID: 5"

  3. C

    405 Method Not Allowed

  4. D

    404 Not Found

Show answer

Correct answer

  • C

    405 Method Not Allowed

Question 4

+3 marksOne correct option

Consider the following flask app.

python
from flask import Flask
app = Flask(__name__)
@app.route('/post/<int:id>')
@app.route('/post/<string:id>')
def post(id):
return f"Post ID: {id}"
@app.route('/post')
def all_posts():
return "All posts"
if __name__ == "__main__":
app.run()

What will be the output on the browser, if you visit 127.0.0.1:5000/post/23?

  1. A

    Post ID: 23

  2. B

    "All posts"

  3. C

    404 Not Found

  4. D

    Flask throws AssertionError

Show answer

Correct answer

  • A

    Post ID: 23

Question 5

+2 marksOne correct option

Consider the following code:
app.py

python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def port():
return "This is the same port question."
if __name__ == "__main__":
app.run(port=0000)

You are running a Flask web application locally using the command: python app.py. On which URL will the application be accessible in the browser?

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

Correct answer

  • D

Question 6

+4 marksOne correct option

Match the Flask-RESTful components with their correct description/role:

  1. A

    1 → A, 2 → B, 3 → C, 4 → D

  2. B

    1 → E, 2 → C, 3 → B, 4 → A

  3. C

    1 → B, 2 → C, 3 → A, 4 → D

  4. D

    1 → B, 2 → C, 3 → A, 4 → E

Show answer

Correct answer

  • D

    1 → B, 2 → C, 3 → A, 4 → E

Question 7

+2 marksOne correct option

What happens if you don’t return a proper dictionary/JSON in Flask-Restful API methods?

  1. A

    Returns None

  2. B

    Raises an error that the value is not serializable

  3. C

    Converts into plain text

  4. D

    Automatically converts into JSON format

Show answer

Correct answer

  • B

    Raises an error that the value is not serializable

Question 8

+3 marksOne correct option

Consider the following table.

Which of the following matches is correct?

  1. A

    i - c, ii - a, iii - d, iv - b

  2. B

    i - d, ii - c, iii - a, iv - b

  3. C

    i - b, ii - c, iii - d, iv - a

  4. D

    i - d, ii - c, iii - b, iv - a

Show answer

Correct answer

  • D

    i - d, ii - c, iii - b, iv - a

Question 9

+2 marksOne correct option

Consider the following Flask SQLalchemy code.

What is true about the credits column?

  1. A

    It is an auto-increment column.

  2. B

    If the value is not provided, it takes 3.

  3. C

    It is an auto-increment that starts from 3.

  4. D

    It can’t store a value other than 3.

Show answer

Correct answer

  • B

    If the value is not provided, it takes 3.

Question 10

+3 marksOne correct option

Consider the following Flask code:

File name: app.py

python
from flask import Flask, request
app = Flask(__name__)
@app.route('/calculate')
def calculate():
argv1 = request.args.get('x')
argv2 = request.args.get('y')
### Missing code ###
app.run(debug=True)

If the app is running on http://127.0.0.1:5000 and the calculate function calculates the sum of two integers then which of the following options should correctly replace the ### Missing code ### ?

  1. A

    return str(int(argv1)+int(argv2))

  2. B

    return int(argv1)+int(argv2)

  3. C

    return argv1+argv2

  4. D

    return str(int(argv1+argv2))

Show answer

Correct answer

  • A

    return str(int(argv1)+int(argv2))

Question 11

+5 marksOne or more correct options

Consider the following Flask code:

File name: main.py

python
import sys
from flask import Flask
app = Flask(__name__)
def do_product():
if len(sys.argv) > 1:
nums = [int(x) for x in sys.argv[1:]]
product = 1
for n in nums:
product *= n
return product
return None
@app.route("/")
def index():
result = do_product()
return f"<h3>Product is: {result}</h3>"
app.run(debug=True)

Choose the different ways of executing “main.py” and rendering results when the app is running on http://127.0.0.1:5000?

Select all that apply.

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

Correct answers

  • A
  • C

Question 12

+3 marksOne or more correct options

Consider the URL:
**https://example.com:8080/index.html?user=admin\#section2**\ Which of the following is/are True?

Select all that apply.

  1. A

    https is the protocol.

  2. B

    8080 is the default port of HTTPS.

  3. C

    index.html is the html file which got rendered.

  4. D

    user=admin is part of the query string.

  5. E

    #section2 is sent to the server as part of the request.

Show answer

Correct answers

  • A

    https is the protocol.

  • C

    index.html is the html file which got rendered.

  • D

    user=admin is part of the query string.

Question 13

+4 marksOne correct option

Match the JavaScript event binding method with its correct description:

  1. A

    1 → A, 2 → B, 3 → C, 4 → E

  2. B

    1 → B, 2 → A, 3 → C, 4 → E

  3. C

    1 → B, 2 → A, 3 → C, 4 → D

  4. D

    1 → A, 2 → B, 3 → D, 4 → C

Show answer

Correct answer

  • B

    1 → B, 2 → A, 3 → C, 4 → E

Question 14

+3 marksOne or more correct options

Consider the following JavaScript output methods. Which of these statements is/are true?

Select all that apply.

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

Correct answers

  • A
  • B
  • D

Question 15

+5 marksOne or more correct options

You are building a Flask-RESTful API with the following code:

python
from flask import Flask, request, jsonify
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class Hello(Resource):
def get(self, message="No Data Found"):
return {"message": "Hello, World!"}
def post(self):
data = request.get_json()
return {"received": data}, 201
api.add_resource(Hello, '/hello')
if __name__ == '__main__':
app.run(debug=True)

Which of the following statements is/are true?(Select all that apply)

Select all that apply.

  1. A
  2. B
  3. C

    The Api class automatically handles URL routing for all resources

  4. D

    This API will return HTML content when accessed via a browser

Show answer

Correct answers

  • B
  • C

    The Api class automatically handles URL routing for all resources

Question 16

+2 marksOne or more correct options

Consider the following table students:

Which of the following SQL queries will return the names of students who are 20 years old and have grade 'A'?

Select all that apply.

  1. A

    SELECT name FROM students WHERE age = 20 AND grade = 'A';

  2. B

    SELECT * FROM students WHERE age = 20 OR grade = 'A';

  3. C

    SELECT name FROM students WHERE students.age = 20 AND grade = 'A';

  4. D

    SELECT name FROM students WHERE student.grade = 'A' OR student.age = 20;

Show answer

Correct answers

  • A

    SELECT name FROM students WHERE age = 20 AND grade = 'A';

  • C

    SELECT name FROM students WHERE students.age = 20 AND grade = 'A';