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 48 MCQ · 4.5 marks
You have a DRAM module with bus width of 64 bits, clock speed of 800 MHz, and operating in DDR
(double-data-rate or two values per clock cycle) mode. What is the maximum memory bandwidth
in Gigabytes per second achievable with this module if it is working in dual channel mode (two
memory interfaces are used)?
6406533457217.
51.2
6406533457218.
102.4
6406533457219.
25.6
6406533457220.
12.8
Published solution
**1. Convert the bus width:** A 64-bit transfer carries \(64/8=8\) bytes.
**2. Account for DDR and two channels:** DDR transfers twice per clock cycle. With an actual clock of \(800\times10^6\) cycles/s and two independent channels, \[B=8\times800\times10^6\times2\times2=25.6\times10^9\text{ bytes/s}.\]
**3. Convert to decimal gigabytes:** Dividing by \(10^9\) gives a theoretical peak of 25.6 GB/s. DDR and dual channel each contribute one factor of two.
**Answer: C — 25.6.**
A: **Incorrect:** It introduces an extra factor of two beyond DDR and dual channel.
B: **Incorrect:** It is four times the calculated bandwidth.
C: **Correct:** It includes 8 bytes per transfer, DDR and both channels exactly once.
D: **Incorrect:** It is the DDR bandwidth for one channel only.
**1. Translate the selection condition:** Both conditions must hold: type equals edible and form equals liquid. The provided table therefore selects only product 1001, Cold Drinks; Curd is edible but semi-solid.
**2. Apply the two requested changes:** Set the selected object’s type to perishable and increment its existing quantity by 450. Cold Drinks therefore changes from quantity 100 to 550; replacing quantity by 450 would be different.
**3. Persist the modifications:** Option B obtains all matching objects with filter_by, changes each object’s type and quantity, then commits the session. The other products are not selected.
**Answer: B — filter edible liquid products, set type to perishable and add 450 to quantity.**
A: **Incorrect:** It filters only by edible and assigns quantity 450, so it also changes Curd and loses the old quantities.
B: **Correct:** It filters on both fields, updates type, increments quantity and commits.
C: **Incorrect:** It writes perishable to form instead of type and overwrites quantity.
D: **Incorrect:** It omits the liquid condition and writes to the wrong field.
**1. Follow the GET handler:** The handler calls do_something before returning the salary mapping. That function visits every employee record and adds hra equal to 10% of basic salary.
**2. Calculate each allowance:** Ravi gets \(14500(0.1)=1450.0\), David gets \(9500(0.1)=950.0\), and Tinu gets \(15009(0.1)=1500.9\). The existing name and basic fields remain in each nested dictionary.
**3. Serialize the entire mapping:** The response includes all three records and all their fields. JSON object keys are strings, so the integer employee identifiers appear as "1", "2" and "3".
**Answer: B — all three employee records with HRA 1450.0, 950.0 and 1500.9.**
A: **Incorrect:** It omits the original employee names and basic salaries.
B: **Correct:** It retains the original fields and adds all three correctly calculated HRA values.
C: **Incorrect:** It shows the original records without the HRA additions made by the function.
D: **Incorrect:** It omits the employee names that remain present in the returned dictionaries.
**1. Match the path before executing the function:** The registered route requires /login/ followed by a nonempty path segment. A query string does not supply that segment; /login?id=MAD-I and /login/ therefore do not call the handler and return 404.
**2. Trace the stated validation condition:** Both CS2003 and PDSA are nonempty strings, so the outer if passes. Their isalnum() results are true, causing abort(400) with the supplied Invalid ID description.
**3. Follow the code even when the validation seems reversed:** The function rejects alphanumeric IDs as written. A nonempty ID containing a hyphen would instead pass the isalnum check and reach the Your ID response.
**Answer: A, C, D — A, C and D: missing-path 404 and the two explicit 400 responses.**
A: **Correct:** The path parameter is missing; a query parameter does not prevent the 404.
B: **Incorrect:** The handler is never entered for the missing path segment, so it cannot return Invalid ID.
C: **Correct:** CS2003 is alphanumeric and reaches the explicit 400 abort.
D: **Correct:** PDSA is alphanumeric and reaches the same 400 abort.
**1. Distinguish the path name from the query ID:** The route is /course/<course_name>. Flask first matches the course name in the path, then the handler reads id from request.args.
**2. Evaluate successful and failed checks:** /course/Java?id=CS2005 supplies the stored Java ID and returns the stated course message. /course/DBMS?id=CS2003 supplies the wrong ID—DBMS requires CS2004—so it returns the explicit 400 error.
**3. Check URLs that never match:** /PDSA?id=CS2003 has the wrong path structure. /course?course_name=DBMS&id=CS2004 still omits the required path segment. Both return 404 regardless of their query values.
**Answer: A, B, D — A, B and D: the shown 404, Java success and DBMS validation error.**
A: **Correct:** /PDSA is not the registered /course/<course_name> route, so 404 is correct.
B: **Correct:** Java and CS2005 match the stored pair, so the success message is correct.
C: **Incorrect:** A query parameter named course_name does not replace the missing path segment; this URL gives 404.
D: **Correct:** The DBMS path matches, but CS2003 is the wrong ID and triggers 400.
Consider the following HTML document “form.html” and the flask route given in “app.py”. Assume
all the required methods are imported, Which of the following statements is/are correct.
6406533457245.
The above HTML document has frontend validation incorporated, using
HTML5 form validation.
6406533457246.
The above HTML document has only backend validation incorporated.
6406533457247.
The above HTML document has both frontend and backend validation
incorporated.
6406533457248.
If the e-mail input field is left blank, the border colour of the input field will be
red.
Published solution
**1. Inspect browser validation:** The input has required, so HTML5 form validation rejects an empty value before normal form submission. Because no email input type is specified, this browser check establishes nonemptiness rather than valid email syntax.
**2. Inspect server validation:** On POST the Flask code checks whether the submitted string contains @. That is a separate backend validation, even though it is only a weak email check.
**3. Interpret the CSS selector:** input:valid makes a valid input red. A blank required input is invalid and does not match :valid. Therefore the red-border claim for an empty input is false.
**Answer: A, C — The above HTML document has frontend validation incorporated, using ; The above HTML document has both frontend and backend validation .**
A: **Correct:** The required attribute supplies client-side HTML5 validation.
B: **Incorrect:** Validation is not only on the backend because required also runs in the browser.
C: **Correct:** Both the browser required check and the Flask @ check are present.
D: **Incorrect:** An empty required input is invalid, whereas the red rule targets :valid.
**1. Count the required segments:** The route is /api/<string:brand>/<string:model>. It requires two nonempty segments after /api/. The string converter accepts characters such as = and commas within a segment.
**2. Check the two failures:** /api/brand=Ford,model=Fiesta has only one segment after /api/. /api/Honda&City also has only one. Neither matches the route, so both return 404.
**3. Check the remaining paths:** The other options each provide two segments. The route treats their contents as literal string values; it does not require the segments to be keyword assignments or infer brand/model names from the text.
**Answer: C, D — C and D return 404 because they omit one required path segment.**
A: **Incorrect:** maruti and swift provide the two required route segments.
B: **Incorrect:** brand=Hundai and model=Creta are two valid string segments.
C: **Correct:** The comma does not separate URL path segments, so the model segment is missing.
D: **Correct:** The ampersand does not replace a slash; only one route segment is supplied.
E: **Incorrect:** Both segments exist even though their labels appear in the opposite semantic order.
**1. Trace the root handler:** It joins the values of range(11), producing the comma-separated integers from 0 through 10.
**2. Trace the parameterized handler:** /numbers/5 matches the integer converter with n=5. The function uses range(n+1), so it includes both 0 and 5.
**3. Match /7 independently:** There is no /<int:n> route at the root. /7 does not match /numbers/<int:n>, so Flask returns 404 rather than executing the numeric handler.
**Answer: A, B, D — A, B and D: root sequence, /numbers/5 sequence and /7 Not Found.**
A: **Correct:** The root handler uses range(11), giving 0 through 10.
B: **Correct:** The /numbers/5 handler uses range(6), giving 0 through 5.
C: **Incorrect:** /7 does not match the registered /numbers/<int:n> pattern.
D: **Correct:** No registered rule matches /7, so Not Found is the expected result.
Consider a character set Q, which consists of only those characters used in the sentence, "the five
boxing wizards jump quickly" If this sentence is to be saved in a document with minimum
encoding, what will be the size of the document given that no other information or context is to be
saved?
6406533457225.
175 bits
6406533457226.
180 bits
6406533457227.
252 bits
6406533457228.
256 bits
Published solution
**1. Count the alphabet:** The sentence is a pangram containing all 26 lowercase letters. Including the space character gives 27 distinct symbols.
**2. Determine the minimum fixed width:** A b-bit code distinguishes at most \(2^b\) symbols. Since \(2^4=16<27\le32=2^5\), each character requires 5 bits.
**3. Count characters, including spaces:** The six word lengths sum to \(3+4+6+7+4+7=31\); five spaces give 36 characters. Thus the document takes \(36\times5=180\) bits.
**Answer: B — 180 bits.**
**Convention note:** Minimum encoding is interpreted as minimum fixed-length encoding for the stated character set, as indicated by the options. General variable-length compression is a different problem.
A: **Incorrect:** It counts only 35 characters and misses one character or space.
B: **Correct:** 36 characters at 5 bits each require 180 bits.
C: **Incorrect:** 252 uses 7 bits per character, which exceeds the minimum fixed width for 27 symbols.
D: **Incorrect:** It does not equal the character count times the minimum fixed width.
We are trying to create two models **‘Student’** and **‘Assignment’** and they are related by one-to-
many relationship(i.e., one student will attempt multiple assignments). Assuming that
**flask_sqlalchemy** is to be used to create data models, which of the following will correctly achieve
the requirements?
**1. Put the foreign key on the many side:** Each assignment belongs to one student, so Assignment.student_id must be a mapped column referencing Student.id. Many assignment rows may share the same student_id.
**2. Add the ORM relationship:** Student.assignments = db.relationship("Assignment", backref="student") provides the collection of assignments and the reverse student reference. The foreign key must be declared inside db.Column(db.Integer, db.ForeignKey("student.id")).
**3. Select the complete mapping:** Option C supplies both the collection relationship and the actual foreign-key column. Declaring a ForeignKey object alone does not create a mapped integer column.
**Answer: C — the Student relationship plus Assignment.student_id foreign-key column.**
A: **Incorrect:** A plain integer field without a foreign key does not establish the required ORM association.
B: **Incorrect:** student_id is assigned a ForeignKey object without a db.Column, so the mapped foreign-key column is missing.
C: **Correct:** The Student collection and Assignment foreign-key column implement the required one-to-many direction.
D: **Incorrect:** A foreign key on Student points in the opposite direction; its uppercase Assignment table target also mismatches the default lowercase table name.
Consider the following resource created using Flask, assume that the application is running on a
terminal 1 and being accessed using CURL on terminal 2. Answer the given subquestions.
What will be returned on the terminal 2 for the command:
**1. Determine the HTTP method:** With no -X option, this curl request uses GET. The word delete in the URL does not choose the HTTP DELETE method.
**2. Dispatch using the registered resource:** /delete/val1 matches a rule carrying val="val1". Flask-RESTful therefore invokes the resource’s get method with that route argument.
**3. Check the Python signature:** get(self) accepts no val argument, so dispatch raises a TypeError and returns an internal-server-error response under normal server handling. None of the listed successful JSON payloads describes this result.
**Answer: D — None of these — the GET handler receives an unexpected val argument.**
A: **Incorrect:** The delete method is not selected by a default-GET curl request.
B: **Incorrect:** The put method requires HTTP PUT, which the command does not send.
C: **Incorrect:** get cannot return normally because it receives an unexpected val argument.
D: **Correct:** The request produces a server error rather than any displayed successful payload.
Consider the following resource created using Flask, assume that the application is running on a
terminal 1 and being accessed using CURL on terminal 2. Answer the given subquestions.
What will be returned on the terminal 2 for the command:
**1. Read the explicit method override:** -X PUT makes the request an HTTP PUT even though its path contains delete.
**2. Follow resource dispatch:** All three listed URLs are attached to the same resource class. /delete/val1 extracts val="val1", and the PUT method selects put(self,val).
**3. Return the selected handler’s result:** put returns status 200 with message "Value updated successfully" and value "val1". URL naming alone does not switch this to delete(self,val).
**Answer: B — {"message":"Value updated successfully","value":"val1"}.**
A: **Incorrect:** That message belongs to the DELETE handler, but the request uses PUT.
B: **Correct:** HTTP PUT selects put, which returns the displayed update-success payload.
C: **Incorrect:** That data belongs to get, which is not the chosen HTTP method.
D: **Incorrect:** The successful PUT result is explicitly listed in B.
HTML defines the styling, while CSS defines the content
6406533457271.
HTML defines the content, while CSS defines the styling
6406533457272.
JavaScript is always the core part of an application’s frontend
6406533457273.
JavaScript provides additional functionality at the frontend
Published solution
**1. Separate structure from appearance:** HTML supplies document content and semantic structure. CSS controls presentation such as spacing, colors and layout.
**2. Identify JavaScript’s role:** JavaScript enables additional behavior and interaction in the browser. A valid frontend can also be static or server-rendered without JavaScript, so the claim that JavaScript is always its core is too strong.
**Answer: B, D — HTML defines the content, while CSS defines the styling; JavaScript provides additional functionality at the frontend.**
A: **Incorrect:** It reverses the usual roles of HTML and CSS.
B: **Correct:** HTML provides content and structure, while CSS defines presentation.
C: **Incorrect:** A frontend does not universally require JavaScript.
D: **Correct:** JavaScript supplies behavior, event handling and other client-side functionality.
**1. Resolve the host:** Task 4 obtains the IP address for example.com using DNS. This precedes connecting to the origin server when no usable address is already cached.
**2. Exchange the HTTP request and response:** Task 1 sends the HTTPS request for home.html; task 3 receives the requested resource or an error response from the server.
**3. Display the result:** Task 2 assembles and renders the response. Therefore the order among the given tasks is \(4\to1\to3\to2\).
**Answer: B — 4-1-3-2.**
A: **Incorrect:** It places sending the origin request before obtaining the required server address.
B: **Correct:** DNS resolution precedes the request, the response and browser rendering.
C: **Incorrect:** It defers DNS until after the origin response, reversing the dependency.
D: **Incorrect:** The server cannot respond before the browser sends its request.
Consider the following statements and select the correct option.
**Statement 1:** Redundancy is used to improve performance and decrease server load.
**Statement 2:** Replication ensures data is not lost if a copy gets destroyed.
6406533457274.
Statement 1 is true & statement 2 is false
6406533457275.
Statement 2 is true & statement 1 is false
6406533457276.
Both statements 1 and 2 are true
6406533457277.
Both statements 1 and 2 are false
A published solution is not available for this question yet.
The term “stateless” in the context of a server means that _________
6406533457278.
it is not physically located on any particular machine
6406533457279.
it does not have any information about the state of the client
6406533457280.
it is ephemeral
6406533457281.
All of these
**MLF**
**Section Id :** 64065373859
**Section Number :** 5
**Section type :** Online
**Mandatory or Optional :** Mandatory
**Number of Questions :** 12
**Number of Questions to be attempted :** 12
**Section Marks :** 40
**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. Define stateless request handling:** A stateless server does not rely on retained per-client session context from previous requests. Each request supplies the information needed to interpret it, such as credentials or a token.
**2. Separate session state from infrastructure:** Statelessness does not mean the server lacks a physical host, must be short-lived, or cannot access a database. It concerns how requests depend on remembered client-session state.
**Answer: B — it does not have any information about the state of the client.**
**Convention note:** The selected option is shorthand for no retained per-client session state. A server may still read client information supplied in the current request and may maintain persistent application resources.
A: **Incorrect:** A stateless server still executes on physical or virtual machines.
B: **Correct:** This is the intended description of not retaining client-session context between requests.
C: **Incorrect:** A long-lived server process can be stateless, so ephemerality is not the definition.
D: **Incorrect:** The physical-location and ephemerality claims are false.