uiz Space

January 2025 term · Modern Application Development I · BSCS2003

Modern Application Development I Quiz 2: 16 March 2025 (January 2025 term)

The IIT Madras BS Modern Application Development I (MAD 1) Quiz 2 paper sat on 16 Mar 2025, in the January 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
10
MSQ
6

Updated

Official paper: IIT M DIPLOMA AN EXAM QDD2 16 Mar 2025 · No negative marking.

Question 1

+2 marksOne correct option

IIT Madras runs a BS Degree Program in Data Science & AI, which has thousands of students enrolled across multiple levels (Foundational, Diploma, and Degree). The institution needs a database system to manage:

  • Student enrollments, tracking performance across multiple subjects and semesters.
  • Faculty assignments to courses, ensuring each instructor handles only specific subjects.
  • Course prerequisites (e.g., a student must complete Mad1 before Mad2).
  • Secure storage of student grades and transcripts, ensuring only authorized access.
  • Handling transactions such as course enrollments, fee payments, and refunds.

Considering the above requirements, which type of database system is most appropriate?

  1. A

    NoSQL (Document-based database like MongoDB)

  2. B

    Graph Database (e.g., Neo4j)

  3. C

    RDBMS (e.g., PostgreSQL, MySQL, SQLite)

  4. D

    Key-Value Store (e.g., Redis, DynamoDB)

Show answer

Correct answer

  • C

    RDBMS (e.g., PostgreSQL, MySQL, SQLite)

Question 2

+2 marksOne correct option

Which of the following best describes the primary advantage of asynchronous updates in web applications?

  1. A

    It ensures that all elements of a web page are loaded at the same time.

  2. B

    It improves performance by allowing parts of a webpage to update without requiring a full reload.

  3. C

    It forces the client to wait until the server responds before interacting with the page.

  4. D

    It requires a high-speed internet connection to function correctly.

Show answer

Correct answer

  • B

    It improves performance by allowing parts of a webpage to update without requiring a full reload.

Question 3

+2 marksOne correct option
  1. A

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

  2. B

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

  3. C

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

  4. D

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

Show answer

Correct answer

  • A

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

Question 4

+3 marksOne correct option

Consider the following Python code snippet.

python
def update(func):
def wrapper(N):
out = []
for i in range(N):
if i%2 == 0:
out.append(i**3)
else:
out.append(i**2)
return out
return wrapper
@update
def func(N):
if N%2 == 0:
return N**2
else:
return N**3
print(func(5))

What will be the output of the above code in the terminal?

  1. A

    25

  2. B

    125

  3. C

    [0, 1, 4, 27, 16]

  4. D

    [0, 1, 8, 9, 64]

Show answer

Correct answer

  • D

    [0, 1, 8, 9, 64]

Question 5

+3 marksOne correct option

Consider the HTML code given below:

File name: base_layout.html

html
<!DOCTYPE html>
<html lang="en">
<head>
<title>ABC App</title>
</head>
<body>
<h3>Welcome to ABC App</h3>
{% block abc %}{% endblock %}
</body>
</html>

Which of the following is the correct implementation of template inheritance?

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

Correct answer

  • A

Question 6

+3 marksOne correct option

Consider the following Flask code.

python
from flask import Flask, request
app = Flask(__name__)
def is_odd(e):
return e % 2 == 0
@app.route("/response")
def get_response():
if request.args.get("n"):
n = request.args.get("n")
r = ""
for i in range(1, (int(n) + 1)):
if is_odd(i):
r = r + "odd : " + str(i) + "\n"
else:
r = r + "even : " + str(i) + "\n"
return r
else:
return "missing parameter `n` with value"
if __name__ == "__main__":
app.run(debug=True)

Assume the above code is running on http://127.0.0.1:5000 . Which of the following request URL does not throw Not Found error?

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

Correct answer

  • D

Question 7

+3 marksOne correct option

A web server is handling requests and has an 8-core processor, 32 GB of RAM, and a network bandwidth of 500 Mbps. The application running on the server is capable of generating 100 HTML pages every second. Each of these pages includes an image file that is 500 KB in size. What is the maximum number of requests per second that the server can handle?

  1. A

    100 requests/sec

  2. B

    125 requests/sec

  3. C

    250 requests/sec

  4. D

    400 requests/sec

Show answer

Correct answer

  • A

    100 requests/sec

Question 8

+3 marksOne correct option

The lens of an HDD can read data on the rotating disk with the speed of 36,000 bits per second. The disk is designed such that 600 bits pass under the lens for every revolution of the disk. What should be the maximum speed of the disk so that the lens does not miss any data?

  1. A

    60 RPM

  2. B

    100 RPM

  3. C

    3600 RPM

  4. D

    6000 RPM

Show answer

Correct answer

  • C

    3600 RPM

Question 9

+4.5 marksOne correct option
  1. A

    1-ii, 2-i, 3-iii, 4-iv, 5-v

  2. B

    1-iii, 2-iii, 3-iii, 4-v, 5-iv

  3. C

    1-ii, 2-i, 3-i, 4-iv, 5-v

  4. D

    1-ii, 2-iii, 3-i, 4-iii, 5-iii

Show answer

Correct answer

  • D

    1-ii, 2-iii, 3-i, 4-iii, 5-iii

Question 10

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

Correct answer

  • C

Question 11

+2 marksOne or more correct options

Consider the flask code below.

python
from flask import Flask
app = Flask(__name__)
@app.route("/user/<id>")
def get_user(id):
return "User Id : " + str(id)
if __name__ == "__main__":
app.run(debug=True)

Assume that the above flask application is running on http://127.0.0.1:5000 . Which of the following URLs will render “Not Found” error?

Select all that apply.

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

Correct answers

  • C
  • D

Question 12

+3 marksOne or more correct options

Consider the following flask application running locally on http://127.0.0.1:5000.

python
from flask import Flask, request
app = Flask(__name__)
@app.route('/endpoint/<username>')
def func(username):
return {
"username": username
}, 200
@app.errorhandler(404)
def notfound(error):
return {
"message": "invalid endpoint!"
}
app.run(debug = True)

Which of the following statements is/are correct for the URL:
http://127.0.0.1:5000/endpoint/user1/developer

Select all that apply.

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

Correct answers

  • B
  • C

Question 13

+3 marksOne or more correct options

Select all that apply.

  1. A

    sales_man= Salesman.query.filter((Salesman.sales_amount >= 5000) & (Salesman.sales_amount <= 10000)).all()

  2. B

    sales_man= Salesman.query.filter(and_(Salesman.sales_amount >= 5000, Salesman.sales_amount <= 10000)).all()

  3. C

    sales_man= Salesman.query.filter(sales_amount >= 5000 and sales_amount <= 10000)

  4. D

    sales_man= Salesman.query.filter_by(sales_amount >= 5000, sales_amount <= 10000)

Show answer

Correct answers

  • A

    sales_man= Salesman.query.filter((Salesman.sales_amount >= 5000) & (Salesman.sales_amount <= 10000)).all()

  • B

    sales_man= Salesman.query.filter(and_(Salesman.sales_amount >= 5000, Salesman.sales_amount <= 10000)).all()

Question 14

+3 marksOne or more correct options

Consider the following Flask application:

python
from flask import Flask
app = Flask(__name__)
@app.route('/')
def home():
return "Welcome to Home Page"
@app.route('/user/<name>')
def user(name):
return f"Hello, {name}!"
@app.route('/profile/<int:user_id>')
def profile(user_id):
return f"User Profile ID: {user_id}"
if __name__ == "__main__":
app.run(debug=True)

Assume the Flask application is running on http://127.0.0.1:5000/ . Which of the following statements about this application are correct?

Select all that apply.

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

Correct answers

  • A
  • C
  • D

Question 15

+4.5 marksOne or more correct options

Consider the following Flask-RESTful API implementation:

python
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
students = {
1: {"name": "Arjun", "grade": "A"},
2: {"name": "Kiran", "grade": "B+"},
3: {"name": "Meera", "grade": "A"},
}
class Student(Resource):
def get(self, student_id):
if student_id in students:
return students[student_id], 200
return {"message": "Student not found"}, 404
def put(self, student_id):
data = request.json
if student_id in students:
students[student_id]["grade"] = data.get("grade",
students[student_id]["grade"])
return {"message": "Student record updated", "student":
students[student_id]}, 200
return {"message": "Student not found"}, 404
api.add_resource(Student, "/student/<int:student_id>")
if __name__ == "__main__":
app.run(debug=True)

The API is running on http://127.0.0.1:5000/. Which of the following statements about this API's behavior is correct?

Select all that apply.

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

Correct answers

  • C
  • D

Question 16

+4.5 marksOne or more correct options

Consider the following flask application.

app.py

python
from flask import Flask, render_template, url_for
app = Flask(__name__)
@app.route("/if")
def ifelse():
user = "MAD I"
return f" Welcome {user}!"
@app.route("/for")
def for_loop():
user = "MAD II"
return f" Welcome {user}!"
@app.route("/choice/<pick>")
def choice(pick):
if pick == 'if':
return url_for('ifelse')
if pick == 'for':
return (url_for('for_loop'))
if __name__ == "__main__":
app.run(debug=False)

Which of the following statements is/are true if the application is running locally on http://127.0.0.1:5000 ?

Select all that apply.

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

Correct answers

  • C
  • D