Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
BSCS1001 · Computational Thinking
Qualifier · May 2024
Official Paper
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

Q1MSQ3 Marks·Choose all correct options
- ARow 1: Incorrect data type of card number
- BRow 4: Invalid Date of Birth
- CRow 6: Physics score is out of range
- DRow 8: Total score is out of range
- Q2MCQ4 Marks·Choose one option

- AReturns “True” if and only if the difference between the maximum Physics marks and the minimum Chemistry marks is at least B
- BReturns “True” if and only if the difference between the maximum Chemistry marks and the minimum Physics marks is at most B
- CReturns “True” if and only if the difference between the maximum Physics marks and the minimum Chemistry marks is less than B
- DReturns “True” if and only if the difference between the maximum Chemistry marks and the minimum Physics marks is less than B
- Q3MCQ4 Marks·Choose one option

- ANumber of students with highest marks in Chemistry and lowest marks in Physics.
- BNumber of students with highest marks in Mathematics and lowest marks in Physics.
- CNumber of students with highest marks in Physics among the three subjects.
- DNumber of students with lowest marks in Physics and highest marks in Mathematics.
- Q4MCQ4 Marks·Choose one option

- ANumber of books which were published after the least recent year.
- BNumber of books which were published in the least recent year.
- CNumber of books which were published after the most recent year.
- DNumber of books which were published in the most recent year.
- Q5MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q6MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q7MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q8MSQ5 Marks·Choose all correct options

- ALine 8: Incorrect expression for B
- BLine 15: Incorrect expression for C
- CLine 16: Incorrect conditional statement
- DNo mistake
- Q9MSQ5 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q10NAT3 Marks·Write the number
Your answer: - Q11NAT5 Marks·Write the number
Your answer: - Q12MCQ5 Marks·Choose one option

- Acount represents the number of pairs of students having either the same gender or from the same city or both.
- Bcount represents the number of pairs of students having the same gender and from the same city.
- Ccount represents the number of student pairs who either share the same gender and come from the same city, or who share neither the same gender nor the same city.
- Dcount represents the number of pairs of students having the same gender but not from the same city.
Official KeyMaster Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.
Reveal KeyCollapse Key
Official Key
Master Answer Key & Explanations
Official answer keys from IIT Madras BS past papers. Click any question to review.
Detailed Answer Notes & Working
- Q1Answer: B, C, D
- Row 4: a date of birth needs a year, so '30 November' is invalid. Row 6: subject marks lie between 0 and 100, so Physics = 145 is out of range. Row 8: the total of three subjects can be at most 300, so 398 is out of range. Row 1 is fine, because card number 1 is an integer.
- Q2Answer: C
- C keeps the maximum Physics marks and D keeps the minimum Chemistry marks. The procedure returns False when C − D ≥ B, and True otherwise. So it returns True only when (max Physics − min Chemistry) < B.
- Q3Answer: A
- isInSeq returns 1 only when Physics < Mathematics and Mathematics < Chemistry. So Chemistry is the highest and Physics is the lowest of the three subjects. A counts such students.
- Q5Answer: B, D
- We need True only when 4 ≤ LetterCount ≤ 8. Option B checks C1 ≤ LetterCount and LetterCount ≤ C2 directly. Option D returns False when LetterCount < C1 or LetterCount > C2, and True otherwise, which is the same test. Option A uses C1 ≥ LetterCount, and option C gives the opposite result.
- Q7Answer: A, B, D
- We need bills that are from Big Bazaar and have TotalBillAmount > Avg. Options A and B check both conditions with nested ifs, and option D checks them with 'and'. Option C uses 'or', so it also counts bills that meet only one condition.
- Q8Answer: B, C
- Line 15 should divide by CountS (words in the current sentence), not CountT, to get the sentence average. Line 16 should be C < B, because we want sentences with average below the dataset average B. Line 8 is correct: B = SumT / CountT is the dataset average.
- Q9Answer: B, D
- A conjugate pair has different words, the same number of vowels and a different number of consonants. Consonants = LetterCount − vCount. Option D checks this directly. Option B also works: if the vowel counts are equal and the letter counts differ, the consonant counts must differ.
- Q10Answer: 6
- mSum(4, 4, 2): the first check is A ≥ C (4 ≥ 2) and A ≥ B (4 ≥ 4), which is True. So the first branch runs and Sum = B + C = 4 + 2 = 6.
- Q11Answer: 2
- flag stays True only until the first word that ends with a full stop, so only the first sentence is checked. In it, the words that start with 'su' are Surrounded and Susan. Words like stroll, savoring, soothing and sounds do not have 'u' as the second letter. So count = 2.
- Q12Answer: C
- A is True for the same gender and B is True for the same city. findPair returns 1 when both are True or both are False. So count is the number of pairs that share both gender and city, or share neither.