Prasnya
Prasnya
Prasnya
Continue with Google
Prasnya
Continue with Google
Week 4 Computational Thinking Questions | Prasnya
Computational Thinking > Week 4
All PYQs
Topic-Wise PYQs
Start Weekly Test
Mock tests
Week mock
Topic mock
Subject mock
Type:
All
Difficulty:
All
Year:
All
33Q
01
What does the given pseudocode achieve using the Words table? ``` while (Table 1 has more rows) { Read the first row X in Table 1 V = DoSomething(X) if (V < X.LetterCount / 2) { Move X to T1 } if (V == X.LetterCount / 2) { Move X to T2 } if (V > X.LetterCount / 2 and V < X.LetterCount) { Move X to T3 } if (V == X.LetterCount) { Move X to T4 } } Procedure DoSomething(Y) i = 1 Count = 0 while (i <= Y.LetterCount) { if (ith letter of Y.Word is a vowel) { Count = Count + 1 } i = i + 1 } return (Count) End DoSomething ```
Single correct
MEDIUM
6 marks
15 March 2026
02
Consider the following pseudocode operating on Scores dataset. ``` Count = 0 while (Table1 has more rows) { Read the first row X from Table1 Move X to Table2 while (Table1 has more rows) { Read the first row Y from Table1 Count = Count + DoSomething(X, Y) Move Y to Table3 } Move all rows from Table3 to Table1 } Procedure DoSomething (A, B) if (A.City == B.City and A.Total == B.Total) { return (1) } else { return (0) } End DoSomething ``` Which of the following statements are true?
Multiple correct
HARD
6 marks
15 March 2026
03
The following pseudocode is executed using the "Library" dataset. What will `A` represent at the end of execution? ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 B = 1 while(Table 1 has more rows){ Read the first row Y in Table 1 if(X.Author == Y.Author and X.Year == Y.Year){ B = B + 1 Move Y to Table 2 } else{ Move Y to Table 3 } } if(B > A){ A = B } Move all rows from Table 3 to Table 1 } ```
Single correct
MEDIUM
4 marks
26 October 2025
04
The following pseudocode is executed using the "Library" dataset. At the end of the execution, `A` captures the number of pairs of books which are published in the same genre and in the same year but in different languages. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. ``` A = 0 while(Table 1 has more rows){ Read the first row X from Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y from Table 1 B = False, C = False, D = True if(X.Genre == Y.Genre){ B = True } if(X.Year == Y.Year){ C = True } if(X.Language == Y.Language){ D = False } if(B and C and D){ A = A + 1 } Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Single correct
MEDIUM
4 marks
26 October 2025
05
The following pseudocode is executed using the "Scores" dataset. What will `count` represent at the end of execution? ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move the row X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 count = count + compareSomething(X.Total, Y.Total) count = count + compareSomething(Y.Total, X.Total) Move the row Y to Table 3 } Move all rows from Table 3 to Table 1 } Procedure compareSomething(A, B) if(A > B){ return (-1) } else{ return (1) } End compareSomething ```
Single correct
HARD
4 marks
26 October 2025
06
The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` is set to True if there exist a pair of words with same part of speech and different letter count. Choose the correct code fragment(s) to complete the pseudocode. ``` A = False while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 ** Fill the code ** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
EASY
4 marks
26 October 2025
07
A mysterious grading system defines "Mirror Match Pairs" between students as follows: Two students form a Mirror Match Pair (asymmetric relation) if: a) The Mathematics score of the first student is equal to the reverse of the Chemistry score of the second student, and b) The Total marks of the first student are exactly 3 more than those of the second student, and c) They do not have the same name. Procedure `ReverseDigits()` can take any marks as argument and return the reversed marks. The following pseudocode is executed using the "Scores" dataset. ``` count = 0 while(Table 1 has more rows){ Read the first row X from Table 1 Move X to Table 2 while(Table 1 has more rows){ Read a row Y from Table 1 if(X.Name != Y.Name){ revY = ReverseDigits(Y.Chemistry) revX = ReverseDigits(X.Chemistry) *********************** *** Fill the code *** *********************** } Move Y to Table 3 } Move all rows from Table 3 back to Table 1 } ``` Choose the correct code fragment to complete the pseudocode.
Single correct
HARD
4 marks
13 July 2025
08
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of students whose mathematics marks are not the same as any other student. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 Flag = True while(Table 1 has more rows){ Read the first row Y in Table 1 if(X.Mathematics == Y.Mathematics){ Flag = True Move Y to Table 2 } else{ Move Y to Table 3 } } if(Flag){ count = count + 1 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
MEDIUM
4 marks
13 July 2025
09
The following pseudocode is executed on the "Library" dataset. What is the value of `Count` after the pseudocode below is executed? ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 if(verifyPair(X, Y)) { count = count + 1 } Move Y to Table 3 } Move all rows from Table 3 to Table 1 } Procedure verifyPair(X, Y) if(X.Genre == Y.Genre and X.Language != Y.Language){ return True } else{ return False } End verifyPair ```
Single correct
MEDIUM
4 marks
23 February 2025
10
The following pseudocode is executed using the "Words" dataset. Consider that procedure `vCount` returns the number of vowels and procedure `cCount` returns the number of consonants. What will `count` represent at the end of execution? ``` count = 0 Q = True while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 if(vCount(X) != vCount(Y)){ Q = False } if(cCount(X) != cCount(Y)){ Q = False } if(Q){ count = count + 1 } } Move all rows of Table 3 to Table 1 } ```
Single correct
HARD
4 marks
23 February 2025
11
The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` is set to True if there exist a pair of words with same part of speech and same letter count. Choose the correct code fragment to complete the pseudocode. ``` A = False while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 ******************** * Fill the code * ******************** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
EASY
4 marks
23 February 2025
12
The following pseudocode is executed using the "Words" table. At the end of the execution, `count` stores the number of pairs of verbs such that both verbs have either the same letter count or both end with a full stop, but not both. Choose the correct code fragment to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(X.PartOfSpeech == "Verb"){ while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 if(X.PartOfSpeech == Y.PartOfSpeech){ ****************************** ********Fill the code******** ****************************** } } } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
4 marks
07 July 2024
13
Two words are said to be conjugate if they fulfill following conditions: • They are different words. • Number of vowels are same in both words. • Number of consonants are different in both words. For a row `X` in the "Words" dataset, assume that `VCount(X)` returns the number of vowels in `X.Word`. At the end of the execution, `count` stores the number of conjugate pairs. Choose the correct code fragment(s) to complete the pseudocode. It is a Multiple Select Question (MSQ). ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 **************** * Fill the code * **************** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
5 marks
07 July 2024
14
The following pseudocode is executed using the "Scores" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 count = count + findPair(X, Y) } Move all rows from Table 3 to Table 1 } Procedure findPair(X, Y) A = False, B = False if(X.Gender == Y.Gender){ A = True } if(X.CityTown == Y.CityTown){ B = True } if((A and B) or (not A and not B)){ return(1) } return(0) End findPair ```
Single correct
MEDIUM
5 marks
07 July 2024
15
The following pseudocode is executed using the "Words" table. At the end of the execution, `count` stores the number of pairs of nouns such that both nouns have either the same letter count or both end with a full stop. Choose the correct code fragment to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(X.PartOfSpeech == "Noun"){ while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 if(***Statement 1***){ if(***Statement 2***){ count = count + 1 } else{ if(***Statement 3***){ count = count + 1 } } } } } Move all rows from Table 3 to Table 1 } ```
Single correct
MEDIUM
4 marks
25 February 2024
16
The given pseudocode is executed using the "Olympics" table. What will `count` represent at the end of the execution? Assume all players have distinct names. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 if(X.Name != Y.Name){ if(X.Nationality == Y.Nationality and X.Medal == Y.Medal){ count = count + 1 } } } Move all rows from Table 3 to Table 1 } ```
Single correct
MEDIUM
3 marks
25 February 2024
17
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of pairs of students having either same gender or from the same city but not both. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 count = count + findPair(X, Y) } Move all rows from Table 3 to Table 1 } Procedure findPair(X, Y) A = False, B = True if(X.Gender == Y.Gender){ A = True } if(X.CityTown == Y.CityTown){ B = True } if((A and not B) and (not A and B)){ return(1) } return(0) End findPair ```
Multiple correct
MEDIUM
4 marks
25 February 2024
18
The given pseudocode is executed using a dataset having the same fields as the "Words" dataset, and contains the following words: "she sells seashells by the seashore the shells she sells are seashells I'm sure." Choose the correct paragraph created from Table 2 at the end of execution of the above pseudocode. ``` while(Table 1 has more rows) { Read the first row X from Table 1 Move X to Table 2 while(Table 1 has more rows) { Read the first row Y from Table 1 if(X.Word == Y.Word) { Move Y to Table 3 } else { Move Y to Table 4 } } Move all rows from Table 4 to Table 1 } ```
Single correct
MEDIUM
4 marks
29 October 2023
19
What will `Count` represent at the end of execution?
Comprehension
MEDIUM
4 marks
29 October 2023
20
Two words are said to be Special if they fulfil the following conditions: • They are different words. • Number of letters are not same in both words. • Number of vowels are same in both words. The following pseudocode is executed using the "Words" dataset. Assume that `vCount(X)` returns the number of vowels in `X.Word`. At the end of execution, `count` stores the number of Special pairs. Choose the correct code fragment(s) to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 **** Fill the code **** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
5 marks
16 July 2023
21
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of pairs of students who are of the same gender or are from the same city but not both. Choose the correct code fragment(s) to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 count = count + findPair(X, Y) } Move all rows from Table 3 to Table 1 } Procedure findPair(X, Y) **** Fill the code **** End findPair ```
Multiple correct
HARD
5 marks
16 July 2023
22
The following pseudocode is executed using the "Shopping Bills" dataset. Procedure `findCommon` takes a pair of cards `X` and `Y` as input and returns True if the two cards share at least one common item; otherwise it returns False. What will `count` represent at the end of the execution? ``` count = 0 while(Pile 1 has more cards){ Read the top card X from Pile 1 Move the card X to Pile 2 while(Pile 1 has more cards){ Read the top card Y from Pile 1 if(X.ShopName != Y.ShopName and findCommon(X, Y)){ count = count + 1 } Move the card Y to Pile 3 } Move all the cards from Pile 3 to Pile 1 } ```
Single correct
MEDIUM
3 marks
16 October 2022
23
The following pseudocode is executed using the "Scores" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 Flag = True while(Table 1 has more rows){ Read the first row Y in Table 1 if(X.Mathematics == Y.Mathematics){ Flag = False Move Y to Table 2 } else{ Move Y to Table 3 } } if(Flag){ count = count + 1 } Move all rows from Table 3 to Table 1 } ```
Single correct
HARD
4 marks
16 October 2022
24
The following pseudocode is executed using the "Words" table. At the end of the execution, `count` stores the number of pairs of words with same letter count where both are either nouns or both end with a full stop. Choose the correct code fragment to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 if(***Statement 1***){ if(X.PartOfSpeech == "Noun"){ if(***Statement 2***){ count = count + 1 } } else{ if(***Statement 3***){ count = count + 1 } } } } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
4 marks
16 October 2022
25
The following pseudocode is executed using the "Words" dataset. At the end of the execution, `count` captures the number of pairs of words with either same letter count or same part of speech but not both. Choose the correct code fragment(s) to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 count = count + findPair(X, Y) } Move all rows from Table 3 to Table 1 } Procedure findPair(X, Y) ******** Fill the code ******** End findPair ```
Multiple correct
HARD
4 marks
16 October 2022
26
The following pseudocode is executed on the "Olympics" dataset. Use the procedure `doSomething` in the previous question. What will `count` represent at the end of the execution? Assume that every player has won at least two medals and only one medal in a year. ``` count = 0, max = 0 while(Table 1 has more rows){ Read the first row X from Table 1 Move the row X to Table 2 while(Table 1 has more rows){ Read the first row Y from Table 1 if(X.Name == Y.Name){ Move the row Y to Table 2 } else{ Move the row Y to Table 3 } } diff = doSomething(Table 2) if(diff == max){ count = count + 1 } if(diff > max){ max = diff count = 1 } Delete all the rows from Table 2 Move all the rows from Table 3 to Table 1 } ```
Comprehension
HARD
4 marks
16 October 2022
27
The following pseudocode is executed using the "Words" table. At the end of the execution, `C` captures the number of pairs of words where both words have the same part of speech or both words end with a full stop and have the same letter count. Choose the correct code fragment(s) to complete the pseudocode. ``` C = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 *************** * Fill the code * *************** } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
4 marks
05 June 2022
28
The following pseudocode is executed using the "Words" dataset. `A` counts the number of pairs of words which have equal number of vowels and consonants. But the pseudocode may have mistakes in one or more lines. Identify all such lines, if any. Assume that all statements not listed in the options below are free of errors. ``` A = 0 while(Pile 1 has more cards){ Read the top card X from Pile 1 countV = 0, countC = 0 countV, countC = countSomething(X, countV, countC) Move X to Pile 2 while(Pile 1 has more cards){ Read the top card Y from Pile 1 Move Y to Pile 3 countV1 = 0, countC1 = 0 countV1, countC1 = countSomething(Y, countV1, countC1) if(countV == countV1 and countC != countC){ A = A + 1 } } Move all cards from Pile 3 to Pile 2 } Procedure countSomething(Z, B, C) I = Z.LetterCount while(I >= 1){ if(Ith letter of Z.Word is vowel){ B = B + 1 } else{ C = C + 1 } I = I + 1 } return(B, C) End countSomething ```
Multiple correct
HARD
5 marks
05 June 2022
29
The following pseudocode is executed using the "Words" dataset. At the end of execution, `A` is set to `True` if there exist a pair of words with same part of speech and same letter count. Choose the correct code fragment to complete the pseudocode. ``` A = False while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 *************** * Fill the code * *************** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Single correct
EASY
2 marks
10 July 2022
30
The following pseudocode is executed using the "Library" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ Read the first row X from Table 1 Move X to Table 2 Flag = True if(X.Genre != "Fiction"){ Flag = False } if(Flag){ while(Table 1 has more rows){ Read the first row Y from Table 1 if(X.Author == Y.Author){ Move Y to Table 2 if(Y.Genre != "Fiction"){ Flag = False } } else{ Move Y to Table 3 } } Move all rows from Table 3 to Table 1 } if(Flag){ count = count + 1 } } ```
Single correct
HARD
4 marks
10 July 2022
31
The following pseudocode is executed using the "Words" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y from Table 1 count = count + isSimilar(X, Y) Move Y to Table 3 } Move all rows from Table 3 to Table 1 } Procedure isSimilar(A, B) if(A.LetterCount != B.LetterCount){ return(0) } i = 1 while(i <= A.LetterCount){ if(ith letter of A.Word is vowel and ith letter of B.Word is vowel){ return(0) } if(ith letter of A.Word is consonant and ith letter of B.Word is consonant){ return(0) } i = i + 1 } return(1) End isSimilar ```
Single correct
HARD
5 marks
10 July 2022
32
The following pseudocode is executed using the "Library" dataset. At the end of the execution, `A` captures the number of pairs of books that are released in the same year and under the same genre but in different languages. The pseudocode may have mistakes. Identify all such mistakes, if any. Assume that all statements not listed in the options below are free of errors. ``` A = 0 while(Table 1 has more rows){ Read the first row X from Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y from Table 1 B = False, C = False, D = True if(X.Genre == Y.Genre){ B = True } if(X.Year == Y.Year){ C = False } if(X.Language == Y.Language){ D = False } if(B or C or D){ A = A + 1 } Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
5 marks
10 July 2022
33
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `C` captures the number of pairs of students who have same date of birth, or the same City/Town but different gender. Choose the correct code fragment(s) to complete the pseudocode. ``` C = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 *************** * Fill the code * *************** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
MEDIUM
5 marks
10 July 2022
Showing 33 questions.
Computational Thinking > Week 4
All PYQs
Topic-Wise PYQs
Start Weekly Test
Mock tests
Week mock
Topic mock
Subject mock
Type:
All
Difficulty:
All
Year:
All
33Q
01
What does the given pseudocode achieve using the Words table? ``` while (Table 1 has more rows) { Read the first row X in Table 1 V = DoSomething(X) if (V < X.LetterCount / 2) { Move X to T1 } if (V == X.LetterCount / 2) { Move X to T2 } if (V > X.LetterCount / 2 and V < X.LetterCount) { Move X to T3 } if (V == X.LetterCount) { Move X to T4 } } Procedure DoSomething(Y) i = 1 Count = 0 while (i <= Y.LetterCount) { if (ith letter of Y.Word is a vowel) { Count = Count + 1 } i = i + 1 } return (Count) End DoSomething ```
Single correct
MEDIUM
6 marks
15 March 2026
02
Consider the following pseudocode operating on Scores dataset. ``` Count = 0 while (Table1 has more rows) { Read the first row X from Table1 Move X to Table2 while (Table1 has more rows) { Read the first row Y from Table1 Count = Count + DoSomething(X, Y) Move Y to Table3 } Move all rows from Table3 to Table1 } Procedure DoSomething (A, B) if (A.City == B.City and A.Total == B.Total) { return (1) } else { return (0) } End DoSomething ``` Which of the following statements are true?
Multiple correct
HARD
6 marks
15 March 2026
03
The following pseudocode is executed using the "Library" dataset. What will `A` represent at the end of execution? ``` A = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 B = 1 while(Table 1 has more rows){ Read the first row Y in Table 1 if(X.Author == Y.Author and X.Year == Y.Year){ B = B + 1 Move Y to Table 2 } else{ Move Y to Table 3 } } if(B > A){ A = B } Move all rows from Table 3 to Table 1 } ```
Single correct
MEDIUM
4 marks
26 October 2025
04
The following pseudocode is executed using the "Library" dataset. At the end of the execution, `A` captures the number of pairs of books which are published in the same genre and in the same year but in different languages. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. ``` A = 0 while(Table 1 has more rows){ Read the first row X from Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y from Table 1 B = False, C = False, D = True if(X.Genre == Y.Genre){ B = True } if(X.Year == Y.Year){ C = True } if(X.Language == Y.Language){ D = False } if(B and C and D){ A = A + 1 } Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Single correct
MEDIUM
4 marks
26 October 2025
05
The following pseudocode is executed using the "Scores" dataset. What will `count` represent at the end of execution? ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move the row X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 count = count + compareSomething(X.Total, Y.Total) count = count + compareSomething(Y.Total, X.Total) Move the row Y to Table 3 } Move all rows from Table 3 to Table 1 } Procedure compareSomething(A, B) if(A > B){ return (-1) } else{ return (1) } End compareSomething ```
Single correct
HARD
4 marks
26 October 2025
06
The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` is set to True if there exist a pair of words with same part of speech and different letter count. Choose the correct code fragment(s) to complete the pseudocode. ``` A = False while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 ** Fill the code ** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
EASY
4 marks
26 October 2025
07
A mysterious grading system defines "Mirror Match Pairs" between students as follows: Two students form a Mirror Match Pair (asymmetric relation) if: a) The Mathematics score of the first student is equal to the reverse of the Chemistry score of the second student, and b) The Total marks of the first student are exactly 3 more than those of the second student, and c) They do not have the same name. Procedure `ReverseDigits()` can take any marks as argument and return the reversed marks. The following pseudocode is executed using the "Scores" dataset. ``` count = 0 while(Table 1 has more rows){ Read the first row X from Table 1 Move X to Table 2 while(Table 1 has more rows){ Read a row Y from Table 1 if(X.Name != Y.Name){ revY = ReverseDigits(Y.Chemistry) revX = ReverseDigits(X.Chemistry) *********************** *** Fill the code *** *********************** } Move Y to Table 3 } Move all rows from Table 3 back to Table 1 } ``` Choose the correct code fragment to complete the pseudocode.
Single correct
HARD
4 marks
13 July 2025
08
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of students whose mathematics marks are not the same as any other student. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 Flag = True while(Table 1 has more rows){ Read the first row Y in Table 1 if(X.Mathematics == Y.Mathematics){ Flag = True Move Y to Table 2 } else{ Move Y to Table 3 } } if(Flag){ count = count + 1 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
MEDIUM
4 marks
13 July 2025
09
The following pseudocode is executed on the "Library" dataset. What is the value of `Count` after the pseudocode below is executed? ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 if(verifyPair(X, Y)) { count = count + 1 } Move Y to Table 3 } Move all rows from Table 3 to Table 1 } Procedure verifyPair(X, Y) if(X.Genre == Y.Genre and X.Language != Y.Language){ return True } else{ return False } End verifyPair ```
Single correct
MEDIUM
4 marks
23 February 2025
10
The following pseudocode is executed using the "Words" dataset. Consider that procedure `vCount` returns the number of vowels and procedure `cCount` returns the number of consonants. What will `count` represent at the end of execution? ``` count = 0 Q = True while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 if(vCount(X) != vCount(Y)){ Q = False } if(cCount(X) != cCount(Y)){ Q = False } if(Q){ count = count + 1 } } Move all rows of Table 3 to Table 1 } ```
Single correct
HARD
4 marks
23 February 2025
11
The following pseudocode is executed using the "Words" dataset. At the end of the execution, `A` is set to True if there exist a pair of words with same part of speech and same letter count. Choose the correct code fragment to complete the pseudocode. ``` A = False while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 ******************** * Fill the code * ******************** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
EASY
4 marks
23 February 2025
12
The following pseudocode is executed using the "Words" table. At the end of the execution, `count` stores the number of pairs of verbs such that both verbs have either the same letter count or both end with a full stop, but not both. Choose the correct code fragment to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(X.PartOfSpeech == "Verb"){ while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 if(X.PartOfSpeech == Y.PartOfSpeech){ ****************************** ********Fill the code******** ****************************** } } } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
4 marks
07 July 2024
13
Two words are said to be conjugate if they fulfill following conditions: • They are different words. • Number of vowels are same in both words. • Number of consonants are different in both words. For a row `X` in the "Words" dataset, assume that `VCount(X)` returns the number of vowels in `X.Word`. At the end of the execution, `count` stores the number of conjugate pairs. Choose the correct code fragment(s) to complete the pseudocode. It is a Multiple Select Question (MSQ). ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 **************** * Fill the code * **************** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
5 marks
07 July 2024
14
The following pseudocode is executed using the "Scores" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 count = count + findPair(X, Y) } Move all rows from Table 3 to Table 1 } Procedure findPair(X, Y) A = False, B = False if(X.Gender == Y.Gender){ A = True } if(X.CityTown == Y.CityTown){ B = True } if((A and B) or (not A and not B)){ return(1) } return(0) End findPair ```
Single correct
MEDIUM
5 marks
07 July 2024
15
The following pseudocode is executed using the "Words" table. At the end of the execution, `count` stores the number of pairs of nouns such that both nouns have either the same letter count or both end with a full stop. Choose the correct code fragment to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 if(X.PartOfSpeech == "Noun"){ while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 if(***Statement 1***){ if(***Statement 2***){ count = count + 1 } else{ if(***Statement 3***){ count = count + 1 } } } } } Move all rows from Table 3 to Table 1 } ```
Single correct
MEDIUM
4 marks
25 February 2024
16
The given pseudocode is executed using the "Olympics" table. What will `count` represent at the end of the execution? Assume all players have distinct names. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 if(X.Name != Y.Name){ if(X.Nationality == Y.Nationality and X.Medal == Y.Medal){ count = count + 1 } } } Move all rows from Table 3 to Table 1 } ```
Single correct
MEDIUM
3 marks
25 February 2024
17
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of pairs of students having either same gender or from the same city but not both. But the pseudocode may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 count = count + findPair(X, Y) } Move all rows from Table 3 to Table 1 } Procedure findPair(X, Y) A = False, B = True if(X.Gender == Y.Gender){ A = True } if(X.CityTown == Y.CityTown){ B = True } if((A and not B) and (not A and B)){ return(1) } return(0) End findPair ```
Multiple correct
MEDIUM
4 marks
25 February 2024
18
The given pseudocode is executed using a dataset having the same fields as the "Words" dataset, and contains the following words: "she sells seashells by the seashore the shells she sells are seashells I'm sure." Choose the correct paragraph created from Table 2 at the end of execution of the above pseudocode. ``` while(Table 1 has more rows) { Read the first row X from Table 1 Move X to Table 2 while(Table 1 has more rows) { Read the first row Y from Table 1 if(X.Word == Y.Word) { Move Y to Table 3 } else { Move Y to Table 4 } } Move all rows from Table 4 to Table 1 } ```
Single correct
MEDIUM
4 marks
29 October 2023
19
What will `Count` represent at the end of execution?
Comprehension
MEDIUM
4 marks
29 October 2023
20
Two words are said to be Special if they fulfil the following conditions: • They are different words. • Number of letters are not same in both words. • Number of vowels are same in both words. The following pseudocode is executed using the "Words" dataset. Assume that `vCount(X)` returns the number of vowels in `X.Word`. At the end of execution, `count` stores the number of Special pairs. Choose the correct code fragment(s) to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 **** Fill the code **** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
5 marks
16 July 2023
21
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `count` captures the number of pairs of students who are of the same gender or are from the same city but not both. Choose the correct code fragment(s) to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 count = count + findPair(X, Y) } Move all rows from Table 3 to Table 1 } Procedure findPair(X, Y) **** Fill the code **** End findPair ```
Multiple correct
HARD
5 marks
16 July 2023
22
The following pseudocode is executed using the "Shopping Bills" dataset. Procedure `findCommon` takes a pair of cards `X` and `Y` as input and returns True if the two cards share at least one common item; otherwise it returns False. What will `count` represent at the end of the execution? ``` count = 0 while(Pile 1 has more cards){ Read the top card X from Pile 1 Move the card X to Pile 2 while(Pile 1 has more cards){ Read the top card Y from Pile 1 if(X.ShopName != Y.ShopName and findCommon(X, Y)){ count = count + 1 } Move the card Y to Pile 3 } Move all the cards from Pile 3 to Pile 1 } ```
Single correct
MEDIUM
3 marks
16 October 2022
23
The following pseudocode is executed using the "Scores" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 Flag = True while(Table 1 has more rows){ Read the first row Y in Table 1 if(X.Mathematics == Y.Mathematics){ Flag = False Move Y to Table 2 } else{ Move Y to Table 3 } } if(Flag){ count = count + 1 } Move all rows from Table 3 to Table 1 } ```
Single correct
HARD
4 marks
16 October 2022
24
The following pseudocode is executed using the "Words" table. At the end of the execution, `count` stores the number of pairs of words with same letter count where both are either nouns or both end with a full stop. Choose the correct code fragment to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 if(***Statement 1***){ if(X.PartOfSpeech == "Noun"){ if(***Statement 2***){ count = count + 1 } } else{ if(***Statement 3***){ count = count + 1 } } } } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
4 marks
16 October 2022
25
The following pseudocode is executed using the "Words" dataset. At the end of the execution, `count` captures the number of pairs of words with either same letter count or same part of speech but not both. Choose the correct code fragment(s) to complete the pseudocode. ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 count = count + findPair(X, Y) } Move all rows from Table 3 to Table 1 } Procedure findPair(X, Y) ******** Fill the code ******** End findPair ```
Multiple correct
HARD
4 marks
16 October 2022
26
The following pseudocode is executed on the "Olympics" dataset. Use the procedure `doSomething` in the previous question. What will `count` represent at the end of the execution? Assume that every player has won at least two medals and only one medal in a year. ``` count = 0, max = 0 while(Table 1 has more rows){ Read the first row X from Table 1 Move the row X to Table 2 while(Table 1 has more rows){ Read the first row Y from Table 1 if(X.Name == Y.Name){ Move the row Y to Table 2 } else{ Move the row Y to Table 3 } } diff = doSomething(Table 2) if(diff == max){ count = count + 1 } if(diff > max){ max = diff count = 1 } Delete all the rows from Table 2 Move all the rows from Table 3 to Table 1 } ```
Comprehension
HARD
4 marks
16 October 2022
27
The following pseudocode is executed using the "Words" table. At the end of the execution, `C` captures the number of pairs of words where both words have the same part of speech or both words end with a full stop and have the same letter count. Choose the correct code fragment(s) to complete the pseudocode. ``` C = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 Move Y to Table 3 *************** * Fill the code * *************** } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
4 marks
05 June 2022
28
The following pseudocode is executed using the "Words" dataset. `A` counts the number of pairs of words which have equal number of vowels and consonants. But the pseudocode may have mistakes in one or more lines. Identify all such lines, if any. Assume that all statements not listed in the options below are free of errors. ``` A = 0 while(Pile 1 has more cards){ Read the top card X from Pile 1 countV = 0, countC = 0 countV, countC = countSomething(X, countV, countC) Move X to Pile 2 while(Pile 1 has more cards){ Read the top card Y from Pile 1 Move Y to Pile 3 countV1 = 0, countC1 = 0 countV1, countC1 = countSomething(Y, countV1, countC1) if(countV == countV1 and countC != countC){ A = A + 1 } } Move all cards from Pile 3 to Pile 2 } Procedure countSomething(Z, B, C) I = Z.LetterCount while(I >= 1){ if(Ith letter of Z.Word is vowel){ B = B + 1 } else{ C = C + 1 } I = I + 1 } return(B, C) End countSomething ```
Multiple correct
HARD
5 marks
05 June 2022
29
The following pseudocode is executed using the "Words" dataset. At the end of execution, `A` is set to `True` if there exist a pair of words with same part of speech and same letter count. Choose the correct code fragment to complete the pseudocode. ``` A = False while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 *************** * Fill the code * *************** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Single correct
EASY
2 marks
10 July 2022
30
The following pseudocode is executed using the "Library" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ Read the first row X from Table 1 Move X to Table 2 Flag = True if(X.Genre != "Fiction"){ Flag = False } if(Flag){ while(Table 1 has more rows){ Read the first row Y from Table 1 if(X.Author == Y.Author){ Move Y to Table 2 if(Y.Genre != "Fiction"){ Flag = False } } else{ Move Y to Table 3 } } Move all rows from Table 3 to Table 1 } if(Flag){ count = count + 1 } } ```
Single correct
HARD
4 marks
10 July 2022
31
The following pseudocode is executed using the "Words" dataset. What will `count` represent at the end of the execution? ``` count = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y from Table 1 count = count + isSimilar(X, Y) Move Y to Table 3 } Move all rows from Table 3 to Table 1 } Procedure isSimilar(A, B) if(A.LetterCount != B.LetterCount){ return(0) } i = 1 while(i <= A.LetterCount){ if(ith letter of A.Word is vowel and ith letter of B.Word is vowel){ return(0) } if(ith letter of A.Word is consonant and ith letter of B.Word is consonant){ return(0) } i = i + 1 } return(1) End isSimilar ```
Single correct
HARD
5 marks
10 July 2022
32
The following pseudocode is executed using the "Library" dataset. At the end of the execution, `A` captures the number of pairs of books that are released in the same year and under the same genre but in different languages. The pseudocode may have mistakes. Identify all such mistakes, if any. Assume that all statements not listed in the options below are free of errors. ``` A = 0 while(Table 1 has more rows){ Read the first row X from Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y from Table 1 B = False, C = False, D = True if(X.Genre == Y.Genre){ B = True } if(X.Year == Y.Year){ C = False } if(X.Language == Y.Language){ D = False } if(B or C or D){ A = A + 1 } Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
HARD
5 marks
10 July 2022
33
The following pseudocode is executed using the "Scores" dataset. At the end of the execution, `C` captures the number of pairs of students who have same date of birth, or the same City/Town but different gender. Choose the correct code fragment(s) to complete the pseudocode. ``` C = 0 while(Table 1 has more rows){ Read the first row X in Table 1 Move X to Table 2 while(Table 1 has more rows){ Read the first row Y in Table 1 *************** * Fill the code * *************** Move Y to Table 3 } Move all rows from Table 3 to Table 1 } ```
Multiple correct
MEDIUM
5 marks
10 July 2022
Showing 33 questions.