Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
BSCS1001 · Computational Thinking
Qualifier · May 2023
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
Useful Reference Data for this Paper

Q1MCQ3 Marks·Choose one optionThe following pseudocode is executed using the "Words" dataset. What will count represent at the end of the execution?

- ANumber of words which are adjectives and have at least two letters
- BNumber of words which are either adjectives or have at most two letters but not both
- CNumber of words which are adjectives or have at most two letters or both
- DNumber of words which are not adjectives and have exactly two letters
- Q2MCQ3 Marks·Choose one option
The following pseudocode is executed using the “Library” dataset. What will A represent at the end of execution?

- ANumber of books written by author Kalam in English
- BNumber of books not written by author Kalam in English
- CNumber of English books written by authors other than Kalam
- DNumber of books that are written by Kalam or in English or both
- Q3MCQ3 Marks·Choose one option
The given pseudocode is executed using the “Words” dataset. Assume that vCount(X) returns the number of vowels in X.Word. What will B represent at the end of the execution?

- AAverage letter count of words in the dataset
- BSum of words that contain at least two vowels
- CAverage letter count of words containing at least two vowels in the dataset
- DAverage letter count of words containing at most two vowels in the dataset
- Q4MCQ3 Marks·Choose one option
Consider the "Scores" dataset. What will C represent at the end of the execution?

- ASum of Total marks of students whose Physics marks are less than the average Physics marks
- BSum of Total marks of students whose Physics marks are more than the average Physics marks
- CSum of Physics marks of students whose Physics marks are more than the average Physics marks
- DSum of Physics marks of students whose Physics marks are less than the average Physics marks
- Q5MCQ3 Marks·Choose one option
The following pseudocode is executed using the “Words” dataset. What will A represent at the end of the execution?

- ANumber of words with at most two vowels
- BNumber of words with at least three vowels
- CNumber of words with at least two vowels
- DNumber of words with exactly two vowels
- Q6MSQ4 Marks·Choose all correct options
Consider the Player dataset given below that keeps track of the runs scored by each player in the test matches held.


- AGoldStriker
- BSilverStriker
- CBronzeStriker
- DSilverStriker and BronzeStriker
- Q7MSQ4 Marks·Choose all correct options
The following pseudocode is executed using the “Scores” dataset. At the end of the execution, A captures the lowest Chemistry marks scored by a male student from Vellore. Choose the correct code fragment(s) to complete the pseudocode. It is a Multiple Select Question.

- A

- B

- C

- D

- A
- Q8MSQ4 Marks·Choose all correct options
The following pseudocode is executed using the “Olympics” dataset. At the end of the execution, A stores the number of players who are either female from India or have won the match hosted by Australia in the year 2006 or 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. It is a Multiple Select Question .

- ALine 1: Incorrect initialization of A
- BLine 5: Condition to update C is incorrect
- CLine 8: Condition to update D is incorrect
- DNo error in the code
- Q9MSQ5 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q10NAT4 Marks·Write the number
Your answer: - Q11NAT3 Marks·Write the number
Let the value of X be "aeroplane". What is the value of A at the end of the execution of the pseudocode ?
Your answer: Read the passage below, then answer Q12–Q13

Based on the above data, answer the given subquestions.
Q12MCQ3 Marks·Choose one optionLet unit be the number of units consumed by the consumer and cost be the amount of the bill to be paid. Choose the correct implementation to compute the cost.
- A

- B

- C

- D

- A
- Q13MCQ3 Marks·Choose one option


- A

- B

- C

- D

- A
- Q14MSQ5 Marks·Choose all correct options
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 to complete the pseudocode. It is a Multiple Select Question.

- A

- B

- C

- D

- A
Official KeyMaster Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.
Reveal KeyCollapse Key
Master Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.
Detailed Answer Notes & Working
- Q1Answer: C
- flag becomes True if the word is an adjective, and also if LetterCount ≤ 2. count goes up when flag is True. So count is the number of words that are adjectives or have at most two letters or both.
- Q2Answer: D
- A first counts books that are not by Kalam and not in English. count is the total number of books. So A = count − A gives the books by Kalam or in English or both.
- Q3Answer: C
- vCount(X) > 1 means the word has at least two vowels. SumT adds the letter counts of these words and CountT counts them. So B = SumT / CountT is the average letter count of words with at least two vowels.
- Q4Answer: B
- DoSomething returns the average Physics marks and moves all rows to Table 2. The loop then adds X.Total to C for each student whose Physics marks are more than this average. So C is the sum of Total marks of students with Physics above the average.
- Q5Answer: B
- The inner loop counts the vowels of each word in B. A goes up only when B > 2, that is, when the word has at least three vowels.
- Q6Answer: A
- All three scores (167, 180, 180) are above 75, so maxMatch is called. Trial > TestSeries is False (167 < 180), so we go to the else part. TestSeries > WorldCup is False (180 = 180), so it returns WorldCup and A goes up. So the player joins GoldStriker.
- Q7Answer: B, D
- A starts at 101, above any possible mark, so we must keep the smaller value: X.Chemistry < A. The student must be male (Gender == 'M' or Gender != 'F') and from Vellore. Options B and D do this. Options A and C use >, so they cannot find the minimum.
- Q8Answer: B, C
- C should mean a female player from India, so Line 5 must check Gender == 'F' and Nationality == 'India'. D should mean the event in Australia in 2006, so Line 8 must check Year == 2006 and HostCountry == 'Australia'. The two lines mix up these conditions. Line 1 (A = 0) is correct.
- Q9Answer: A, D
- A Special pair has different words, different letter counts and the same number of vowels. Option A checks exactly these three conditions. Option D also works: with equal vowels, different consonant counts (LetterCount − vCount) means different letter counts. B needs the same word and C needs equal letter counts, so both are wrong.
- Q10Answer: 7
- The loop adds the last digit (n % 10) to s and then removes it (n // 10). So s is the sum of the digits of 1024: 1 + 0 + 2 + 4 = 7.
- Q11Answer: 32
- A starts at 1 and is doubled for every vowel in the word. 'aeroplane' has 5 vowels: a, e, o, a, e. So A = 2 × 2 × 2 × 2 × 2 = 32.
- Q12Answer: C
- Up to 50 units, cost = unit × 2. Above 50, the first 50 units cost 50 × 2 = 100 and only the extra units cost 3 each: 50 × 2 + (unit − 50) × 3. Check with 60 units: 100 + 30 = 130, as in the example. Option C does this.
- Q13Answer: D
- Statement I must put grade 4 users (Units > 550) in Table 5. For each pair in a grade table, we need the same area and a different year of registration. So Statement II is Y.YearOfRegistration != Z.YearOfRegistration and Y.Area == Z.Area, which is option D.
- Q14Answer: A, C
- We need pairs where exactly one of same gender and same city is True. Option A counts pairs with at least one match (or) and subtracts pairs with both (and), so it gives 1 only for exactly one. Option C checks (A and not B) or (not A and B) directly. B can return −1, and D counts pairs where both or neither match.