uiz Space

January 2025 term · Computational Thinking · BSCS1001

Computational Thinking Qualifier: 16 March 2025 (January 2025 term)

The IIT Madras BS Computational Thinking (Computational Thinking (CT)) Qualifier paper sat on 16 Mar 2025, in the January 2025 term: 12 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
12
Marks
50
Duration
120 min
MCQ
7
MSQ
4
Numerical
1

Updated

Official paper: IIT M QUALIFIER AN EXAM QDQ1 16 Mar 2025 · No negative marking.

Question 1

+4 marksOne correct option

Statement

The following pseudocode is executed using the "Scores" dataset. At the end of the execution of below pseudocode, if count2 represents the number of male students whose Physics marks are less than or equal to Mathematics marks, then select the correct code fragment for A and B.

text
count1 = 0, count2 = 0
while(Table 1 has more rows){
Read the first row X in Table 1
if(....A.... or ....B....){
count1 = count1 + 1
}
else{
count2 = count2 + 1
}
Move X to Table 2
}
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • C

Question 2

+4 marksOne correct option

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.

text
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
}
}
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 3

+4 marksOne correct option

Statement

The following pseudocode is executed using the “Scores” dataset. At the end of the execution, variable Count captures the number of students whose total marks are more than the class average (of total marks) but have scored below the subject average in at least one subject. Assume that the variable AvgT holds the value of the average total marks. Similarly, the variables AvgP, AvgC and AvgM hold the value of the average marks of Physics, Chemistry and Mathematics respectively. Choose the correct code fragment to complete the pseudocode.

text
Count = 0
while(Table 1 has more rows){
Read the first row X from Table 1
A = False, B = False, C = False, D = False
if(X.Total > AvgT){
A = True
}
if(X.Mathematics < AvgM){
B = True
}
if(X.Physics < AvgP){
C = True
}
if(X.Chemistry < AvgC){
D = True
}
********************
* Fill the code *
********************
Move X to Table 2
}
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 4

+4 marksOne correct option

Statement

The following pseudocode is executed using the “Words” dataset. What will A represent at the end of the execution?

text
SumT = 0, CountT = 0, B = 0
while(Table 1 has more rows){
Read the first row X in Table 1
CountT = CountT + 1
SumT = SumT + X.LetterCount
Move X to Table 2
}
B = SumT / CountT
SumS = 0, CountS = 0, A = 0, C = 0
while(Table 2 has more rows){
Read the first row X in Table 2
CountS = CountS + 1
SumS = SumS + X.LetterCount
if(X.Word ends with a full stop){
C = SumS / CountS
if(C < B){
A = A + 1
}
SumS = 0, CountS = 0
}
Move X to Table 1
}
  1. A

    Number of sentences with average letter count more than the average letter count of dataset

  2. B

    Number of sentences with average letter count less than the average letter count of dataset

  3. C

    Number of words with average letter count more than the average letter count per word of dataset

  4. D

    Number of words with average letter count less than the average letter count per word of dataset

Show answer

Correct answer

  • B

    Number of sentences with average letter count less than the average letter count of dataset

Question 5

+4 marksOne correct option

Statement

Procedure miniSum accepts three numbers as parameters and returns the sum of two smallest numbers.

Choose the correct code fragment to complete the procedure.

text
Procedure miniSum(A, B, C)
Sum = 0
if(A > C and A > B){
Sum = B + C
}
********************
* Fill the code *
********************
return(Sum)
End miniSum
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • A

Question 6

+4 marksOne correct option

Statement

The following pseudocode is executed using the “Scores” dataset. What will A represent at the end of the execution?

text
A = 0
while(Pile 1 has more cards){
Read the top card X from Pile 1
A = A + isInSeq(X)
Move X to Pile 2
}
Procedure isInSeq(X)
if(X.Mathematics > X.Physics){
if(X.Physics < X.Chemistry){
return(1)
}
}
return(0)
End isInSeq
  1. A

    Number of students with highest marks in Mathematics among the three subjects

  2. B

    Number of students with highest marks in Mathematics and lowest marks in Physics

  3. C

    Number of students with highest marks in Chemistry among the three subjects

  4. D

    Number of students with lowest marks in Physics among the three subjects

Show answer

Correct answer

  • D

    Number of students with lowest marks in Physics among the three subjects

Question 7

+5 marksOne correct option

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.

text
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
}
  1. A

    The number of pairs of players having the same nationality or the same medal.

  2. B

    The number of pairs of players having the same nationality and same medal.

  3. C

    The number of players having the same nationality and same medal.

  4. D

    The number of players having the different name but of same nationality.

Show answer

Correct answer

  • B

    The number of pairs of players having the same nationality and same medal.

Question 8

+4 marksOne or more correct options

Let X and Y be two rows in the “Scores” table. We call X and Y partially matching if student X and Y are either from the same city or have the same total marks or both. Let partialMatch(X, Y) be a procedure to find whether X and Y are matching. Choose the correct implementation of the procedure partialMatch.

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • B
  • D

Question 9

+4 marksOne or more correct options

Statement

The given pseudocode is executed using the “Shopping Bills” dataset. frac stores the ratio of the number of customers who purchased both “Bread” and “Milk” to the number of customers who purchased “Milk”. Choose the correct code fragment(s) of procedure hasItem to complete the pseudocode. (Assume there is at least one customer who has purchased “Milk”). [MSQ]

text
mCount = 0, bCount = 0
while(Pile 1 has more cards){
Read the top card X in Pile 1
if(hasItem(X, “Milk”)){
mCount = mCount + 1
if(hasItem(X, “Bread”)){
bCount = bCount + 1
}
}
Move X to Pile 2.
}
frac = bCount / mCount
Procedure hasItem (Y, A)
****************
* Fill the code *
****************
End hasItem

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • B
  • D

Question 10

+4 marksOne or more correct options

Statement

The given information represents a "Words" dataset and it may have some mistakes with respect to the sanity of data. Identify all rows with such mistakes. [MSQ].

Row no.FieldValue
Row 1Card number"xyz"
Row 2Word1
Row 3Part of Speech"Noun"
Row 4Letter Count- 5

Select all that apply.

  1. A

    Row 1: Incorrect data type of card number

  2. B

    Row 2: Incorrect data type of Word

  3. C

    Row 3: Incorrect data type of Part of Speech

  4. D

    Row 3: Invalid value of Part of Speech

  5. E

    Row 4: Incorrect data type of Letter Count

  6. F

    Row 4: Invalid value of Letter Count

Show answer

Correct answers

  • A

    Row 1: Incorrect data type of card number

  • B

    Row 2: Incorrect data type of Word

  • F

    Row 4: Invalid value of Letter Count

Question 11

+5 marksOne or more correct options

Statement

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. [MSQ]

text
1 count = 0
2 while(Table 1 has more rows){
3 Read the first row X in Table 1
4 Move X to Table 2
5 while(Table 1 has more rows){
6 Read the first row Y in Table 1
7 Move Y to Table 3
8 count = count + findPair(X, Y)
9 }
10 Move all rows from Table 3 to Table 1
11 }
12 Procedure findPair(X, Y)
13 A = False, B = True
14 if(X.Gender == Y.Gender){
15 A = True
16 }
17 if(X.CityTown == Y.CityTown){
18 B = True
19 }
20 if((A and not B) and (not A and B)){
21 return(1)
22 }
23 return(0)
24 End findPair

Select all that apply.

  1. A

    Line 13: Incorrect initialisation of B

  2. B

    Line 18: Incorrect update of B

  3. C

    Line 20: Incorrect condition

  4. D

    Line 21: It should return(0)

Show answer

Correct answers

  • A

    Line 13: Incorrect initialisation of B

  • C

    Line 20: Incorrect condition

Question 12

+4 marksNumerical answer

The following pseudocode is executed using a dataset similar to the "Words" dataset, based on the following paragraph.

"Surrounded by nature, Susan often takes a stroll, savoring the soothing sounds of chirping birds. Such moments underline the significance of embracing simple joys in life. Rustlings in the trees suggest squirrels beginning their day, searching for sustenance. Surely, the beauty of a sunrise holds unparalleled magic."

text
count = 0, flag = True
while(Table 1 has more rows){
Read the first row X in Table 1
Move X to Table 2
if(flag){
if(1st letter of X.Word == 's'){
if(2nd letter of X.Word == 'u'){
count = count + 1
}
}
}
flag = False
if(X.Word ends with full stop){
flag = True
}
}

What would be the value of count at the end of the execution of the above pseudocode? Assume that upper case and lower case are ignored during comparison of letters.

Show answer

Correct answer: 3