Application Development - 1 · Quiz 1 · Sep 2024
Application Development - 1 · Quiz 1 · Sep 2024
← 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.
14 / 16 published solutions
Suppose a Gamer wants to buy a Bluetooth earphone which can give him a good gaming
experience, for that the delay between the action that happens in his phone and the sound heard
by him for that action should be as low as possible so that he can play well. Following this
scenario, which of the following option(s) is/are correct?
He should buy the earphones which have high latency as much possible.
It all depends on Internet Speed, so we can’t determine anything.
He should buy the earphones which have low latency as much possible.
He should buy the earphones which have as low Bluetooth version as possible.
**1. Identify the measured quantity:** The action-to-sound delay is latency. A smaller latency means the sound follows the action sooner, improving timing and synchronization.
**2. Select the stated property:** The relevant requirement is low latency, not high latency or simply an older Bluetooth version. Internet bandwidth alone does not determine this local audio delay.
**Answer: C — He should buy the earphones which have low latency as much possible..**
A: **Incorrect:** Higher latency increases the delay the gamer wants to minimize.
B: **Incorrect:** Local audio processing and wireless delivery contribute delay independently of internet speed.
C: **Correct:** Lower latency directly minimizes the action-to-sound delay.
D: **Incorrect:** A lower version number does not guarantee a lower end-to-end audio delay.
Question 102 MCQ · 2.0 marks
A published solution is not available for this question yet.
Question 103 MCQ · 3.0 marks
Published solution
**1. Preserve the row structure:** The first table row contains One then Four; the second contains Two then Three. Rows do not reorder the cells numerically.
**2. Apply header-cell defaults:** One and Two are th cells, so they are bold and usually centered. Four and Three are ordinary td cells. A shows these positions and weights with the requested borders.
**Answer: A — Rows One–Four and Two–Three, with One and Two bold.**
A: **Correct:** Rows are (One,Four) and (Two,Three), with the first cell in each row a header.
B: **Incorrect:** This incorrectly places Two in the first row and Four in the second.
C: **Incorrect:** This sorts/reorders cells rather than preserving the HTML row definitions.
D: **Incorrect:** This bolds the first row rather than the first cell of each row.
Question 104 MCQ · 3.0 marks
A published solution is not available for this question yet.
Question 105 MCQ · 3.0 marks
Published solution
**1. Compare complete and safe substitution:** greeting1 supplies both placeholders and prints “Hello, Alice! Welcome to Wonderland.” safe_substitute with only name=Bob prints “Hello, Bob! Welcome to $place.”, retaining the unresolved placeholder.
**2. Follow strict substitution:** The next substitute(data) requires place and raises KeyError: 'place'. Execution stops before print(greeting3), so there is no third greeting.
**Answer: D — Alice greeting; Bob greeting retaining $place; then KeyError: place.**
A: **Incorrect:** Strict substitution cannot retain a missing place without raising KeyError.
B: **Incorrect:** safe_substitute retains $place rather than replacing it by an empty string.
C: **Incorrect:** The missing key is place, not what, and the error occurs after the safe-substitution print.
D: **Correct:** The two successful lines are followed by the missing-place KeyError.
Question 106 MCQ · 3.0 marks
Published solution
**1. Apply SimpleHTTPRequestHandler’s default document rule:** For a requested directory, Python’s simple HTTP server looks for index.html or index.htm before generating a directory listing.
**2. Read the index document:** index.html contains a heading “Welcome to DBMS course”, so that heading is rendered for the base URL. The filenames base.html and home.html do not make them automatic entry points.
**Answer: B — Welcome to DBMS course.**
A: **Incorrect:** home.html is not the default index file in this setup.
B: **Correct:** index.html is found and contains this heading.
C: **Incorrect:** The file named base.html has no special default-document role.
D: **Incorrect:** A directory listing is not needed because index.html exists.
Question 107 MCQ · 3.0 marks
Published solution
**1. Evaluate each method:** loan1.get_loan_details() returns (101,45900,5); loan2 returns (102,170000,6). Jinja permits calling these supplied object methods in expressions.
**2. Preserve context and order:** tm1 receives l1=loan1 and prints its tuple after “Account1 :”; tm2 receives l2=loan2 and prints its tuple after “Account2 :”. Both calls execute.
**Answer: D — Account1 : (101, 45900, 5); Account2 : (102, 170000, 6).**
A: **Incorrect:** This swaps the objects between the two accounts.
B: **Incorrect:** The first print also executes, so Account1 cannot be omitted.
C: **Incorrect:** The second print also executes, so Account2 cannot be omitted.
D: **Correct:** Both tuples are attached to the correct account labels and printed in order.
Question 108 MCQ · 3.0 marks
Published solution
**1. Compare route patterns:** /communication/landline/0712 matches the default string route in A and the string/int route in B; Werkzeug’s int converter accepts a digit string with leading zero and gives integer 712. C’s literal 0712 path also matches.
**2. Identify the missing literal segment:** D requires /communication/online/... with an extra online segment. The requested path lacks it, so that route does not match and the intended result is 404.
**Answer: D — D — the route requiring an extra /online/ path segment.**
**Convention note:** C and D contain the invalid Python 3 integer literal 044 in their dictionaries. Literally those alternatives fail to start, rather than returning HTTP responses. The routing comparison and intended answer assume that unrelated literal is repaired to 44. URL text 0712 does not have the same syntax restriction as a Python integer literal.
A: **Incorrect:** The two default string segments match landline and 0712.
B: **Incorrect:** The integer URL converter accepts 0712 as digits; it is not a Python source literal.
C: **Incorrect:** Its literal 0712 suffix matches the requested suffix after the source typo is repaired.
D: **Correct:** The required online path segment is missing, so the route does not match.
Question 109 MCQ · 4.5 marks
A certain network connection with a bandwidth of 10 Mbps allows making 1000 requests to a
server per second. If each request is modified to have an additional data of 8 Kb, what should be
the additional bandwidth required to maintain the rate of 2000 requests per second?
18 Mbps
16 Mbps
26 Mbps
36 Mbps
Published solution
**1. Recover the original payload size:** At full use, \(10\times10^6/1000=10{,}000\) bits per request. Adding 8 Kb, meaning 8000 bits, gives 18,000 bits per modified request.
**2. Scale and subtract the original capacity:** At 2000 requests/s, required total bandwidth is \(18{,}000\times2000=36\) Mbps. The additional bandwidth beyond the existing 10 Mbps is \(36-10=26\) Mbps.
**Answer: C — 26 Mbps.**
**Convention note:** Use decimal Kb as kilobits and assume the stated original rate fully uses the 10 Mbps link. Protocol overhead is not specified.
A: **Incorrect:** 18 is the modified request size in kilobits, not the additional rate in megabits/s.
B: **Incorrect:** 16 Mbps covers only the added 8000-bit fields at 2000 requests/s and ignores doubling the original payload traffic.
C: **Correct:** The new total is 36 Mbps, so 26 Mbps must be added to the existing 10.
D: **Incorrect:** 36 Mbps is total required capacity, not the additional capacity.
Question 110 MCQ · 4.5 marks
Published solution
**1. Determine the method and allowed list:** curl without a method-changing option sends GET. The command-line list includes GET and POST, so GET is allowed for /home even though the script filename is also mistakenly included in methods=sys.argv.
**2. Trace the chosen branch literally:** The GET branch returns a heading saying “Hello from POST”. Printed text does not change the actual HTTP method, so select that response body.
**Answer: B — A heading containing Hello from POST.**
**Convention note:** The intended method list is normally sys.argv[1:] to omit the script filename. In this example GET is still present, so that issue does not alter this request’s outcome.
A: **Incorrect:** The POST branch prints Hello from GET, but this request is GET.
B: **Correct:** The GET branch literally returns Hello from POST.
C: **Incorrect:** GET is explicitly handled and does not reach else.
D: **Incorrect:** GET is registered, so this is not Method Not Allowed.
Question 111 MCQ · 4.5 marks
Increase
Decrease
Remain Same
Insufficient Information
Published solution
**1. Healthy round trip:** \(12{,}000\text{ km}=12\times10^6\text{ m}\). Each cable leg takes \(12\times10^6/(2\times10^8)=60\) ms, so the healthy RTT is 120 ms.
**2. Faulty round trip:** The request still takes 60 ms by cable; the air return takes \(12\times10^6/(3\times10^8)=40\) ms. Adding the 20 ms switch delay gives \(60+40+20=120\) ms, equal to the healthy RTT.
**Answer: C — Remain Same.**
A: **Incorrect:** The extra 20 ms is exactly offset by the faster return propagation.
B: **Incorrect:** The faster air leg saves 20 ms, but the switch adds it back.
C: **Correct:** Both the healthy and faulty RTTs are 120 ms.
D: **Incorrect:** All quantities needed for this propagation-only comparison are supplied.
Question 112 MSQ · 2.0 marks
HTTP/2.0 is the protocol and version respectively
500 is the port number
“Internal Server Error” is the status message
500 is the status code
HTTP/2.0 is the server failure
Published solution
**1. Read the conventional status-line notation:** HTTP/2.0 labels the HTTP protocol/version; 500 is the response status code; “Internal Server Error” is its human-readable reason phrase.
**2. Separate port from status:** A port belongs to connection addressing and is not identified by this status-line position. HTTP/2.0 itself is not a failure description.
**Answer: A, C, D — A, C and D — protocol/version, status message and status code.**
**Convention note:** Actual HTTP/2 uses binary frames and a :status pseudo-header rather than an HTTP/1.x-style textual status line with a reason phrase. The exercise presents a simplified diagnostic notation.
A: **Correct:** The label identifies HTTP and version 2.0 in the exercise’s notation.
B: **Incorrect:** 500 occupies the status-code position, not a port-number field.
C: **Correct:** This is the conventional status message associated with code 500.
D: **Correct:** 500 denotes an internal server error response.
E: **Incorrect:** The failure is represented by status 500, not by the protocol/version label.
Question 113 MSQ · 2.0 marks
Published solution
**1. Apply the default string converter:** /employee/<id> accepts any nonempty single path segment. Thus /employee/102 matches, and /employee/id=102 also matches with the literal string id="id=102".
**2. Find paths with the wrong prefix:** /id=102 and /102 do not begin with /employee/, so neither matches a registered route. These two requests return 404 Not Found.
**Answer: C, D — C and D — /id=102 and /102.**
A: **Incorrect:** This matches with id="102".
B: **Incorrect:** The equals sign is allowed in this path segment; it is not an integer-only converter.
C: **Correct:** The /employee/ prefix is absent, so no route matches.
D: **Correct:** The /employee/ prefix is absent, so no route matches.
Question 114 MSQ · 4.5 marks
Published solution
**1. Separate page content from HTTP status:** Merely rendering a file named 404.html returns a normal 200 response unless a different status is explicitly attached. A therefore does not meet the requirement.
**2. Check the status-producing alternatives:** abort(404) raises the HTTP exception; first_or_404() raises it when no row exists; returning (rendered_html,404) explicitly sets the status. B,C,D each return 404 for an absent matching product.
**Answer: B, C, D — B, C and D — abort, first_or_404, or explicit status tuple.**
**Convention note:** Assume the appropriate Flask helpers and Flask-SQLAlchemy query support are imported/configured. Reusing the variable name type shadows the built-in but does not itself cause the stated code to fail.
A: **Incorrect:** The filename alone does not change the default 200 status.
B: **Correct:** abort(404) stops processing with an HTTP 404 response.
C: **Correct:** first_or_404() aborts with 404 when the query finds no matching row.
D: **Correct:** The second tuple element explicitly sets HTTP status 404.
Question 115 MCQ · 3.0 marks
Consider the following code and answer the given subquestions.
Published solution
**1. Determine the target:** The form has no action attribute, so it submits to the current root URL. Its text control is named name and contains Application.
**2. Encode a GET submission:** A GET form places successful controls in the URL query string as name=Application. The resulting address is http://127.0.0.1:5000/?name=Application.
**Answer: A — http://127.0.0.1:5000/?name=Application.**
A: **Correct:** The query key and value are encoded after the root URL’s question mark.
B: **Incorrect:** This incorrectly makes name=Application a path segment.
C: **Incorrect:** This omits the submitted value.
D: **Incorrect:** A successful named GET control contributes its key/value to the query.
Question 116 MCQ · 3.0 marks
Consider the following code and answer the given subquestions.
**Java**
**Section Id :** 64065369407
**Section Number :** 8
**Section type :** Online
**Mandatory or Optional :** Mandatory
**Number of Questions :** 16
**Number of Questions to be attempted :** 16
**Section Marks :** 100
**Display Number Panel :** Yes
**Section Negative Marks :** 0
**Group All Questions :** No
**Enable Mark as Answered Mark for Review and**
No
**Clear Response :**
**Section Maximum Duration :** 0
**Section Minimum Duration :** 0
**Section Time In :** Minutes
**Maximum Instruction Time :** 0
Published solution
**1. Determine the submission destination:** With no action attribute, the POST targets the current root URL. The name field is encoded in the request body rather than added as a new query string.
**2. Read the browser address:** The address stays http://127.0.0.1:5000/. The shown POST handler renders home.html without redirecting to another URL.
**Answer: D — http://127.0.0.1:5000/.**
**Convention note:** Assume the referenced templates exist, as intended by the question; a missing home.html would affect the response, not move the submitted form data into the URL.
A: **Incorrect:** POST does not append this form field to the query in the displayed setup.
B: **Incorrect:** The form value is sent in the request body, not as a bare query.
C: **Incorrect:** The control name is not appended by a POST submission.
D: **Correct:** The submission targets the same root URL and no redirect changes it.