MauryaHub PYQ Practice

Computational Thinking · Quiz 1 · Jan 2026

Computational Thinking · 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.

10 / 11 published solutions

Question 2 MCQ · 0.0 marks

Source diagram or notation
Source diagram or notation
6406536343122.
Useful Data has been mentioned above.
6406536343123.
This data attachment is just for a reference & not for an evaluation.

Published solution

This is a reference card showing the schemas and sample rows of Scores, Words, Library, Olympics and Shopping Bills. It supplies context for later pseudocode questions rather than asking for a computed result. Use the field names and row meanings when tracing the later algorithms; the displayed ellipses indicate omitted rows, not a complete dataset. **Answer: A.** A: **Correct:** The source selects the acknowledgement that useful dataset information is supplied. B: **Incorrect:** This describes its reference role too, but is not the source's selected administrative acknowledgement; these are not competing computational answers.

Report a correction for Q2

Question 3 MCQ · 4.0 marks

The following procedure is executed using the **Scores** dataset.
Source diagram or notation
What does the procedure **Mystery("M")** compute?
6406536343124.
The average Physics score of all students
6406536343125.
The average Physics score of male students
6406536343126.
The total score of male students
6406536343127.
The total Physics score of male students

Published solution

Mystery('M') visits every row but adds to count and sum only when X.Gender is M. sum accumulates the Physics scores of those male students, and count records their number. Returning sum/count therefore gives the male students' average Physics score, assuming at least one male student is present. **Answer: B.** A: **Incorrect:** Other genders are excluded by the condition. B: **Correct:** Filtered Physics sum divided by filtered student count gives this average. C: **Incorrect:** It neither sums total subject scores nor returns an undivided total. D: **Incorrect:** The Physics sum is divided by count before returning.

Report a correction for Q3

Question 4 MCQ · 4.0 marks

The following pseudocode is executed using the **Scores** table. At the end of the execution, the variable **CountBA** captures the number of students with total marks less than average total marks and below average in exactly one subject. Assume that the variable **AvgT** holds the value of average total marks. Similarly, the variables **AvgP**, **AvgC** and **AvgM** hold the value of average marks of Physics, Chemistry and Mathematics respectively. Choose the correct choice to complete the pseudocode.
Source diagram or notation
6406536343136.Source diagram or notation
6406536343137.Source diagram or notation
6406536343138.Source diagram or notation
6406536343139.Source diagram or notation

Published solution

The surrounding condition already requires X.Total<AvgT. For that student, SubC starts at zero and increases separately for each subject whose mark is below its subject average. Exactly one such subject means SubC==1. If true, CountBA must increase by one, preserving the number counted from earlier rows. **Answer: D.** A: **Incorrect:** SubC<=1 also accepts students below average in zero subjects. B: **Incorrect:** Accepts zero as well as one and resets rather than accumulates CountBA. C: **Incorrect:** Tests the right subject count but overwrites CountBA with 1. D: **Correct:** Requires exactly one subject and increments the running student count.

Report a correction for Q4

Question 5 MCQ · 6.0 marks

Based on the **Scores** dataset, the Procedure **highTotal(S)** returns **True** if student name **'S'** has a **TOTAL score greater than 180**. Choose the correct pseudocode for Procedure **highTotal(S)**. (Consider all students have distinct names)
6406536343128.Source diagram or notation
6406536343129.Source diagram or notation
6406536343130.Source diagram or notation
6406536343131.Source diagram or notation

Published solution

Search for the row whose name equals S and test that same row's Total>180. B returns True immediately when both conditions hold, and False only after all rows have been searched without success. Distinct names ensure the matching student's row is unambiguous. **Answer: B.** A: **Incorrect:** Adds only Mathematics and Physics, omitting Chemistry from the intended total. B: **Correct:** Checks both the requested name and its complete total. C: **Incorrect:** Checks whether any student has a high total, ignoring S. D: **Incorrect:** Sums all students' totals rather than testing the specified student.

Report a correction for Q5

Question 6 MCQ · 6.0 marks

What does the given pseudocode achieve using the **Words** table?
Source diagram or notation
6406536343132.
Bins the rows in the **Words** table into four tables based on word length
6406536343133.
Bins the rows in the **Words** table into four tables based on whether the word has more vowels or more consonants
6406536343134.
Bins the rows in the **Words** table into four tables based on the ratio of vowels to total letters
6406536343135.
Bins the rows in the **Words** table into four tables based on whether the word contains only vowels

Published solution

DoSomething counts vowels V in the current word of length N. The branches distinguish V<N/2, V=N/2, N/2<V<N, and V=N. Equivalently they group vowel proportions below one-half, equal to one-half, above one-half but below one, and equal to one. Thus the four tables are based on vowel-to-total-letter ratio. **Answer: C.** A: **Incorrect:** The tests depend on V relative to N, not on N alone. B: **Incorrect:** More/fewer vowels gives part of the classification but does not explain the separate all-vowel fourth group. C: **Correct:** Describes all four ratio-based categories. D: **Incorrect:** Only the last category consists exclusively of vowels; the other branches distinguish several other ratios.

Report a correction for Q6

Question 7 MCQ · 6.0 marks

The following pseudocode is executed using the **Shopping bills** dataset to find the number of bills with one of the top three total bill amounts. Choose the correct code block to complete the pseudocode.
Source diagram or notation
6406536343140.Source diagram or notation
6406536343141.Source diagram or notation
6406536343142.Source diagram or notation
6406536343143.Source diagram or notation

Published solution

The first pass maintains the three largest distinct bill amounts: First, Second and Third. The second pass must count every bill whose amount is at least Third, covering all bills at any of those three amount levels, including ties. Hence use X.TotalBillAmount>=Third and increment Count. The intended setup assumes nonnegative bill amounts and enough distinct amount levels for Third to represent a real third level. **Answer: D.** A: **Incorrect:** Counts bills below the third-highest threshold, the opposite region. B: **Incorrect:** Counts only the largest amount level. C: **Incorrect:** Strictly greater than Third leaves out bills at the third-highest level. D: **Correct:** Includes the largest, second-largest and third-largest amount levels, with ties.

Report a correction for Q7

Question 8 MSQ · 4.0 marks

The following procedure is executed using the **Shopping Bills** dataset. Choose all the correct options given below.
Source diagram or notation
6406536343144.
The procedure ignores all bills from shops other than SV Stores
6406536343145.
Bills from SV Stores with amount ≥ 400 do not affect either
Source diagram or notation
or
Source diagram or notation
6406536343146.
The value stored in
Source diagram or notation
depends on the order of cards in Pile 1
6406536343147.Source diagram or notation
represents the number of SV Stores bills whose total amount is strictly less than 400
6406536343148.
At the end of execution, **(sum/count)** will give the average total bill amount of all bills from SV Stores

Published solution

A row contributes only if its shop is SV Stores and its total amount is strictly below 400. For each qualifying row the procedure adds its amount to sum and one to count. All other rows are ignored. Reordering does not change these mathematical sums and counts. sum/count, when count>0, is the mean only for the filtered bills, not all SV Stores bills. **Answer: A, B, D.** A: **Correct:** The shop-name condition excludes every other shop. B: **Correct:** The strict <400 test excludes amounts equal to or above 400. C: **Incorrect:** The same qualifying amounts are summed regardless of row order. D: **Correct:** Count increases once for every qualifying below-400 SV Stores bill. E: **Incorrect:** The computed mean excludes the store's bills of 400 or more, and is undefined if no bill qualifies.

Report a correction for Q8

Question 9 MCQ · 4.0 marks

The following procedure finds the highest amount of bill generated at **Sun General** from the **Shopping Bills** dataset. But the programmer may have made mistakes in one or more steps. Identify all such steps (if any) Step 1. Arrange all cards in a single pile called Pile 1 Step 2. Maintain a variable **max** and initialize it to 0 Step 3. If Pile 1 is empty then stop the iteration Step 4. Read the top card in Pile 1 Step 5. If the shop name is **Sun General** and **max > total bill amount** then store total bill amount in **max** Step 6. Move the current card to another pile called Pile 2 and repeat from step 3
6406536343149.
Step 1
6406536343150.
Step 2
6406536343151.
Step 3
6406536343152.
Step 4
6406536343153.
Step 5
6406536343154.
Step 6
6406536343155.
No mistake

Published solution

To maintain a maximum, replace it only when a new qualifying bill is larger than the stored maximum. Step 5 instead tests max>amount, the reverse comparison. It should test ShopName=='Sun General' and amount>max. With nonnegative bill amounts, starting max at zero is appropriate. The remaining steps perform a normal full scan. **Answer: E.** A: **Incorrect:** A single input pile is a valid starting setup. B: **Incorrect:** Zero is a suitable initial bound for nonnegative bill amounts. C: **Incorrect:** Stopping on an empty pile is correct. D: **Incorrect:** Reading the top card is necessary. E: **Correct:** The maximum-update comparison is reversed. F: **Incorrect:** Moving the card and repeating ensures every card is processed once. G: **Incorrect:** Step 5 contains an actual error.

Report a correction for Q9

Question 10 MSQ · 6.0 marks

Consider the following pseudocode operating on **Scores** dataset.
Source diagram or notation
Which of the following statements are true?
6406536343156.
The algorithm counts the number of ordered pairs of students having the same
Source diagram or notation
and
Source diagram or notation
.
6406536343157.
Each pair of students with the same
Source diagram or notation
and
Source diagram or notation
is counted exactly once.
6406536343158.
The algorithm avoids comparing a student with itself.
6406536343159.
The final value of
Source diagram or notation
depends on the initial ordering of rows in Table1.

Published solution

Each outer iteration removes one row X permanently from the remaining comparison pool. The inner loop compares X with every row still in Table1, moving those rows temporarily to Table3 and then restoring them. Thus each pair of distinct students is compared once: whichever student is selected earlier is X for that pair. DoSomething contributes 1 precisely for equal city and total. The final count is the number of matching unordered pairs and is invariant under input order. **Answer: B, C.** A: **Incorrect:** Ordered pairs would count both directions; this scan counts each pair once. B: **Correct:** Every matching unordered pair contributes exactly once. C: **Correct:** X has already left Table1, so the inner loop cannot compare X with itself. D: **Incorrect:** Changing order changes which direction is visited, not how many matching pairs exist.

Report a correction for Q10

Question 11 MSQ · 5.0 marks

Consider the **Olympics** dataset. The following pseudocode is executed:
Source diagram or notation
Which of the following must be true after execution?
6406536343160.
**silver_count** equals the number of silver medals awarded to male athletes during Olympics hosted by USA.
6406536343161.
If **gender_check** equals **silver_count**, then all silver medal winners during Olympics hosted by USA were male
6406536343162.
**silver_count** equals the number of silver medals awarded to athletes during Olympics hosted by USA.
6406536343163.
**silver_count** counts the total number of silver medals won by athletes who are from USA.

A published solution is not available for this question yet.

Report a correction for Q11

Question 12 NAT · 5.0 marks

The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the paragraph below. "Patience and persistence often unlock hidden potential."
Source diagram or notation
Ignore case while comparing letters. What will be the value of **Score** at the end of execution?

Published solution

A word contributes 3 when consonants outnumber vowels, otherwise 1. Ignore case and treat the terminal full stop as punctuation rather than a letter. The (vowels,consonants) counts are patience (4,4), and (1,2), persistence (4,7), often (2,3), unlock (2,4), hidden (2,4), potential (4,5). Only patience fails the strict greater-than test. Thus Score=1+6×3=19. Equal counts go into the else branch. **Answer: 19.**

Report a correction for Q12