MauryaHub PYQ Practice

Application Development - 1 · Quiz 1 · Jan 2026

Application Development - 1 · Quiz 1 · Jan 2026

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

15 / 16 published solutions

Question 2 MCQ · 4.0 marks

A client sitting in a train is connected to a server through a network tower that has a range of 4.5 kilometers and a constant bandwidth of 5 Mbps. The train is at a negligible distance from the tower and is moving away from it at a speed of 180 kmph. How much data (in Megabytes) will be used by the client before the train completely moves out of the coverage area, assuming that the client is consuming the entire bandwidth?
6406536344431.
45 MB
6406536344432.
450 MB
6406536344433.
5.6 MB
6406536344434.
56.25 MB

Published solution

**1. Find coverage time:** The client starts essentially at the tower and moves radially away, so it travels 4.5 km before losing coverage. At 180 km/h, \(t=4.5/180\text{ h}=90\text{ s}\). **2. Convert bits to bytes:** Data transferred is \(5\times90=450\) megabits. Since one byte is eight bits, \(450/8=56.25\) MB. **Answer: D — 56.25 MB.** **Convention note:** Mbps and MB use decimal mega units. Coverage starts at the tower, so use the 4.5 km radius rather than the full 9 km diameter. A: **Incorrect:** This does not follow from the specified bandwidth and 90-second duration. B: **Incorrect:** 450 is the number of megabits, not megabytes. C: **Incorrect:** This is about a factor of ten too small. D: **Correct:** 450 megabits divided by eight gives 56.25 MB.

Report a correction for Q2

Question 3 MCQ · 4.0 marks

Consider the HTML code below.
Source diagram or notation
Which of the following will be the rendered output?
6406536344439.Source diagram or notation
6406536344440.Source diagram or notation
6406536344441.Source diagram or notation
6406536344442.Source diagram or notation

Published solution

**1. Resolve background specificity:** All three paragraphs match div p. The first also matches .highlight, which wins and makes it pink; the second matches #special, which wins and makes it orange. The third stays light blue. **2. Resolve layout independently:** The p rule sets display:inline-block. None of the other selectors changes display, so the paragraphs form content-sized inline blocks on the same line when the container is wide enough. **Answer: C — Inline blocks: Paragraph One pink, Paragraph Two orange, Paragraph Three light blue.** A: **Incorrect:** The colors are right, but the paragraphs need not appear on separate lines. B: **Incorrect:** The colors are right, but inline-block does not make each paragraph fill the line. C: **Correct:** This combines the correct pink/orange/light-blue backgrounds with inline-block flow. D: **Incorrect:** This ignores the higher-specificity class and ID background rules.

Report a correction for Q3

Question 4 MCQ · 5.0 marks

Consider the following flask app.
Source diagram or notation
Select the option which correctly matches the URL in column A with the rendered output in column B, if the application is running locally on http://127.0.0.1:5000.
Source diagram or notation
6406536344435.
1-b, 2-b, 3-a, 4-a
6406536344436.
1-b, 2-b, 3-d, 4-a
6406536344437.
1-c, 2-c, 3-d, 4-a
6406536344438.
1-c, 2-b, 3-d, 4-a

Published solution

**1. Apply query defaults:** Requests 1 and 2 both give a=3,b=2,c=5. The extra d=5 parameter is never read. In both cases a+b=c, so the output is “Sum: 5”, label c. **2. Trace requests 3 and 4:** Request 3 gives (1,5,5): the sum test fails but a*c=b, so it prints “Product: 5”, label d. Request 4 gives (1,5,6), making the first test true and printing “Sum: 6”, label a. The mapping is 1-c,2-c,3-d,4-a. **Answer: C — 1-c, 2-c, 3-d, 4-a.** A: **Incorrect:** Requests 1 and 2 are valid, and request 3 prints Product: 5 rather than Sum: 6. B: **Incorrect:** Requests 1 and 2 do not produce Invalid Input because every converted value is valid. C: **Correct:** All four requests are mapped to their actual branch outputs. D: **Incorrect:** The unused d parameter does not invalidate request 2.

Report a correction for Q4

Question 5 MCQ · 3.0 marks

Consider the following code: **app.py**
Source diagram or notation
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?
6406536344443.
https://127.0.0.1:5000/
6406536344444.
http://localhost:0007/
6406536344445.
http://0.0.0.0:0007/
6406536344446.
None of these

Published solution

**1. Parse the source before starting Flask:** In Python 3, 0007 is not a legal nonzero decimal integer literal. app.run(port=0007) therefore raises SyntaxError before any server starts. **2. Choose the listed outcome:** No offered address serves this program as written, so choose “None of these”. Replacing the literal with 7 would request port 7 rather than the default 5000. **Answer: D — None of these.** A: **Incorrect:** No server starts, and app.run() does not configure HTTPS here. B: **Incorrect:** This would require first repairing the invalid Python integer literal. C: **Incorrect:** No server starts; 0.0.0.0 is also not the default bind host in this code. D: **Correct:** The Python syntax error prevents all listed application URLs.

Report a correction for Q5

Question 6 MCQ · 3.0 marks

Consider the following Jinja2 template code:
Source diagram or notation
What will be the output when the code is executed?
6406536344451.
10511817
6406536344452.
125111017
6406536344453.
3915
6406536344454.
51117

Published solution

**1. Filter the sequence:** reject("even") removes 10 and 8 from [10,3,9,8,15], leaving 3,9,15 in their original order. **2. Render each value:** Adding 2 gives 5,11,17. The whitespace-control markers join these values without separators, giving 51117 apart from surrounding template whitespace. **Answer: D — 51117.** **Convention note:** The triple-quoted template can retain a surrounding newline. The answer choices compare the non-whitespace content. A: **Incorrect:** This includes values inconsistent with rejecting even inputs. B: **Incorrect:** This does not follow the filtered sequence and addition. C: **Incorrect:** This is the filtered sequence before adding 2. D: **Correct:** The surviving values become 5,11,17 and concatenate as shown.

Report a correction for Q6

Question 7 MCQ · 3.0 marks

Consider the following HTML and Python flask codes.
Source diagram or notation
Source diagram or notation
Source diagram or notation
6406536344471.
Welcome Admin
6406536344472.
Welcome User
6406536344473.
404 Not Found
6406536344474.
Nothing will be rendered

Published solution

**1. Evaluate the exact comparison:** The Flask context sets user="admin iitm", while the template tests user=="admin". String equality requires the entire value to match, so the condition is false. **2. Render the else branch:** The root route exists and renders home.html, whose else branch displays “Welcome User”. **Answer: B — Welcome User.** A: **Incorrect:** The supplied value is not exactly admin. B: **Correct:** The false equality test selects this else-branch text. C: **Incorrect:** The root route is defined, so this is not a routing 404. D: **Incorrect:** The template has a nonempty else branch.

Report a correction for Q7

Question 8 MCQ · 3.0 marks

Consider the following Jinja2 template:
Source diagram or notation
What will be the output in the terminal?
6406536344479.Source diagram or notation
6406536344480.Source diagram or notation
6406536344481.Source diagram or notation
6406536344482.Source diagram or notation
6406536344483.Source diagram or notation

Published solution

**1. Sort the numbers:** Jinja’s sort filter orders [5,2,8,1,9] ascending, giving [1,2,5,8,9]. **2. Render one element per iteration:** The loop emits five paragraph elements containing 1,2,5,8,9 respectively. The terminal prints the HTML source string rather than displaying a web page. **Answer: B — Five paragraph elements containing 1, 2, 5, 8 and 9.** **Convention note:** The choices suppress surrounding template whitespace. The loop’s whitespace-control markers remove spacing between repeated paragraph fragments. A: **Incorrect:** This preserves the unsorted input order instead of applying sort. B: **Correct:** This has the ascending values in five separate paragraph elements. C: **Incorrect:** The default sort order is ascending, not descending. D: **Incorrect:** The loop creates one paragraph per number rather than one paragraph containing their concatenation. E: **Incorrect:** Sorting this list and rendering its integers are valid operations.

Report a correction for Q8

Question 9 MCQ · 3.0 marks

Source diagram or notation
Source diagram or notation
Source diagram or notation
6406536344484.
It will render "Post ID: abc123"
6406536344485.
Flask will return a 404 error because abc123 cannot be converted to integer
6406536344486.
It will render "Profile of abc123"
6406536344487.
The application will crash with a TypeError

Published solution

**1. Match the requested path:** /post/abc123 must match /post/<int:post_id>. The int converter does not accept abc123, so this route does not match. **2. Check alternatives:** The other route starts with /profile/, not /post/. No route matches this request, so Flask returns 404 Not Found rather than invoking the post view. **Answer: B — Flask will return a 404 error because abc123 cannot be converted to integer.** A: **Incorrect:** The integer route rejects the noninteger segment before the view is called. B: **Correct:** The converter mismatch leaves the request without a matching route. C: **Incorrect:** The profile route has a different literal prefix. D: **Incorrect:** This is a normal routing 404, not a TypeError crash.

Report a correction for Q9

Question 10 MCQ · 2.0 marks

Which command would you use to get detailed information about the HTTP request and response, including headers, and to help debug the HTTP request when using curl?
6406536344447.Source diagram or notation
6406536344448.Source diagram or notation
6406536344449.Source diagram or notation
6406536344450.Source diagram or notation

Published solution

**1. Select diagnostic output:** curl -v enables verbose mode, reporting connection details and the sent request and received response headers, which helps debug an HTTP exchange. **2. Distinguish response inclusion:** curl -i includes response headers with the body but does not supply the same request-side and connection diagnostics. **Answer: B — curl -v <URL>.** A: **Incorrect:** -i includes response headers but is not the full verbose diagnostic option. B: **Correct:** -v enables the requested verbose request/response diagnostics. C: **Incorrect:** --headers is not the documented flag for this behavior; --header sets a request header. D: **Incorrect:** -X GET selects the request method but does not enable detailed diagnostics.

Report a correction for Q10

Question 11 MSQ · 2.0 marks

Which of the following statements about HTML, CSS, and character encoding is/are true?
6406536344455.
UTF-8 is a variable-length encoding that can represent all Unicode characters.
6406536344456.
In HTML, attribute names are case-insensitive.
6406536344457.
Inline CSS is preferred over external CSS for large-scale projects.
6406536344458.
UTF-32 is a fixed-length encoding where each character takes 4 bytes.

Published solution

**1. Distinguish encodings:** UTF-8 encodes Unicode scalar values using a variable number of bytes; UTF-32 uses one four-byte code unit per scalar value. **2. Judge markup and styling:** Attribute names in ordinary HTML syntax are ASCII case-insensitive. Large projects generally benefit from reusable external stylesheets rather than duplicated inline styling. **Answer: A, B, D — UTF-8 is a variable-length encoding that can represent all Unicode characters.; In HTML, attribute names are case-insensitive.; UTF-32 is a fixed-length encoding where each character takes 4 bytes..** **Convention note:** “Character” here means a Unicode scalar value, not necessarily a whole user-perceived grapheme such as a multi-code-point emoji. HTML syntax is meant, not XML/XHTML case rules. A: **Correct:** UTF-8 can encode every Unicode scalar value using one to four bytes. B: **Correct:** Ordinary HTML attribute names are ASCII case-insensitive. C: **Incorrect:** Inline styles do not provide the usual reuse, separation and maintainability of external stylesheets. D: **Correct:** UTF-32 uses four bytes per encoded Unicode scalar value.

Report a correction for Q11

Question 12 MSQ · 2.0 marks

Which of the following is/are True about Web Applications?
6406536344459.
All web applications run entirely in the client's browser without requiring a server.
6406536344460.
Web applications can interact with backend services using APIs.
6406536344461.
A web application typically consists of frontend, backend and database components.
6406536344462.
Web applications cannot be accessed unless they are installed on the user’s computer.

Published solution

**1. Identify the usual architecture:** A web application commonly has a browser frontend, server-side logic and persistent data storage. The browser can communicate with backend APIs over HTTP. **2. Avoid universal claims:** Some applications run mostly on the client, but that does not mean all web apps need no server. A normal web application can be used through its URL without installing a dedicated desktop application. **Answer: B, C — Web applications can interact with backend services using APIs.; A web application typically consists of frontend, backend and database .** A: **Incorrect:** Many web apps require server-side processing, so “all entirely in the browser” is false. B: **Correct:** APIs are a standard way for the frontend to exchange data with services. C: **Correct:** These are common components, although every particular app need not use all three. D: **Incorrect:** A browser can access a web app without installing the app as native software.

Report a correction for Q12

Question 13 MSQ · 2.0 marks

Which of the following are True about **sys.argv** in Python?
6406536344463.
**sys.argv** is a list containing command-line arguments.
6406536344464.
**sys.argv[0]** stores the Python script name.
6406536344465.
**sys.argv** elements are always interpreted as integers.
6406536344466.
**sys.argv** elements are always interpreted as strings.

Published solution

**1. Read the invocation:** For an ordinary script command such as python app.py 12, Python supplies a list like ["app.py","12"] in sys.argv. Index 0 identifies the script and later entries contain its arguments. **2. Handle types explicitly:** Arguments arrive as strings. Numeric conversion, such as int(sys.argv[1]), must be requested by the program; it is not automatic. **Answer: A, B, D — **sys.argv** is a list containing command-line arguments.; **sys.argv[0]** stores the Python script name.; **sys.argv** elements are always interpreted as strings..** **Convention note:** For special invocation modes, argv[0] may be -c or an empty string; this does not change the usual script example. Code can also deliberately reassign sys.argv, so “always” refers to the supplied command-line representation. A: **Correct:** sys.argv is the list of command-line argument strings. B: **Correct:** In the script-running context, index 0 contains the script name or path. C: **Incorrect:** An argument that looks numeric remains a string unless explicitly converted. D: **Correct:** The command-line entries supplied by Python are strings.

Report a correction for Q13

Question 14 MSQ · 5.0 marks

Consider the following **users** list.
Source diagram or notation
6406536344467.Source diagram or notation
6406536344468.Source diagram or notation
6406536344469.Source diagram or notation
6406536344470.Source diagram or notation

Published solution

**1. Identify the required links:** The three supplied dictionaries require visible names user_1,user_2,user_3 and links /show_users/1,/show_users/2,/show_users/3, wrapped in an ordered list. **2. Evaluate each construction:** Jinja supports both dotted dictionary lookup and bracket lookup. Direct indexing also works for this fixed three-item list. D obtains the final character of each supplied name, which happens to equal that user’s ID. Thus all four produce the required links for these data. **Answer: A, B, C, D — All four options work for the supplied three users.** **Convention note:** D relies on the naming pattern and is not a robust general ID lookup; C hardcodes the list length. A or B is preferable for arbitrary user data, but the question asks what works for the given list. A: **Correct:** The loop’s user.id and user.name resolve to the dictionary keys. B: **Correct:** Bracket notation reads the same id and name keys explicitly. C: **Correct:** The three fixed indices cover the complete supplied list and use its correct IDs. D: **Correct:** For user_1,user_2,user_3, name[-1] gives 1,2,3, matching the stated IDs.

Report a correction for Q14

Question 15 MSQ · 3.0 marks

Consider the following CSS code:
Source diagram or notation
Which of the following statements are TRUE regarding the element's dimensions and spacing?
6406536344475.
The total width including padding and border is 224px
6406536344476.
The margin affects the content box width
6406536344477.
The padding adds internal spacing inside the element
6406536344478.
The border contributes to the total width in the standard box model

Published solution

**1. Add the border-box parts:** Under default content-box sizing, the declared width is the content width. Including horizontal padding and borders gives \(200+2(10)+2(2)=224\) px. **2. Keep margin external:** The 15 px margins lie outside the border box and do not alter its 200 px content width. Including both horizontal margins, the complete horizontal footprint is \(224+30=254\) px. **Answer: A, C, D — The total width including padding and border is 224px; The padding adds internal spacing inside the element; The border contributes to the total width in the standard box model.** A: **Correct:** 200 px content plus 20 px padding plus 4 px border equals 224 px. B: **Incorrect:** Margin is outside the element’s border and does not change the declared content width. C: **Correct:** Padding provides space between content and border. D: **Correct:** The left and right borders add to the outside width under content-box sizing.

Report a correction for Q15

Question 16 MSQ · 3.0 marks

Which statements about CSS display properties are CORRECT?
6406536344488.
**display: block** elements always start on a new line and take full width
6406536344489.
**display: inline** elements can be manipulated with height and width properties
6406536344490.
**display: inline-block** elements can be placed inline and be manipulated with height and width properties
6406536344491.
**display: inline** elements can’t be manipulated with height and width properties

A published solution is not available for this question yet.

Report a correction for Q16

Question 17 MSQ · 3.0 marks

Consider the following code.
Source diagram or notation
Which substitution methods will work WITHOUT raising KeyError ?
6406536344492.
out = template.substitute({"name": "Alice"})
6406536344493.
out = template.safe_substitute({"name": "Alice"})
6406536344494.
out = template.substitute({"name": "Alice", "count": 5})
6406536344495.
out = template.safe_substitute({"name": "Alice", "count": 5})

Published solution

**1. Identify missing keys:** The template requires name and count. substitute() raises KeyError if any required mapping key is missing, so A fails on count. **2. Compare the remaining calls:** safe_substitute() leaves a missing placeholder unchanged, so B succeeds with “Hello Alice, you have $count messages”. C and D provide both keys and produce “Hello Alice, you have 5 messages”. **Answer: B, C, D — out = template.safe_substitute({"name": "Alice"}); out = template.substitute({"name": "Alice", "count": 5}); out = template.safe_substitute({"name": "Alice", "count": 5}).** A: **Incorrect:** substitute() raises KeyError because count is absent. B: **Correct:** safe_substitute() retains $count instead of raising KeyError. C: **Correct:** Both required keys are present, so strict substitution succeeds. D: **Correct:** Both keys are present, and safe_substitute() also succeeds.

Report a correction for Q17