Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
BSCS1001 · Computational Thinking
All 2024 papers
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.
End Term · 22 Dec 2024 (FN)End Term
- Q1MCQ5 Marks·Choose one option

- A6
- B9
- C8
- D1
- Q2MCQ5 Marks·Choose one option

- AIf L1 = [2, 3, 5], L2 = [2, 4, 5], then CompareLists[L1, L2] returns true.
- BIf L1 = [2, 4, 5], L2 = [5, 4, 2], then CompareLists[L1, L2] returns true.
- CIf L1 = [2, 4, 5], L2 = [2, 5, 4], then CompareLists[L1, L2] returns true.
- DIf L1 = [2, 4, 5], L2 = [2, 4, 5], then CompareLists[L1, L2] returns true.
- Q3MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q4MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q5MCQ6 Marks·Choose one option

- ANumber of students from the cities with the average total marks of the city more than the average total marks of the dataset.
- BNumber of students from the cities with the average total marks of the city less than the average total marks of the dataset.
- CNumber of cities with the average total marks less than the average total marks of the dataset.
- DNumber of cities with the average total marks more than the average total marks of the dataset
- Q6MSQ6 Marks·Choose all correct options

- AA represent the number of sentences in the "Words" dataset
- BA represent the number of words in the "Words" dataset
- CoutList represent list of lists of last and first word of each sentence in that order.
- DoutList represent list of lists of first and last word of each sentence in that order.
- Q7MSQ6 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q8MSQ6 Marks·Choose all correct options
The given pseudocode is executed using the “Words” dataset. At the end of execution A captures the frequency count of the most frequent vowel in the dataset. 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 (MSQ).

- ALine 1: Incorrect initialization of D
- BLine 8: Incorrect conditional expression
- CLine 9: A updated with wrong value
- DLine 13: Incorrect initialization of i
- ELine 16: Conditional expression should not use "not" operator
- FLine 22: i updated at wrong place
- Q9MSQ5 Marks·Choose all correct options
Consider the graph given below.
Which of the following statements is/are true?- AThere are 4 cliques of size three present in the graph.
- BThe nodes 0, 11, 6 and 12 form a clique of size four.
- CThe maximum size of clique that appears in the graph is 3.
- DThe nodes 0 and 5 form a clique of size two.
- Q10MSQ5 Marks·Choose all correct options
Which of the following statements is/are true?- AC will be true, if there exist more fiction books than non-fiction books.
- BB represents number of non-fiction books.
- CA represents number of fiction books.
- DC will be true, if there exist more fiction books than non-fiction English books
- Q11MSQ4 Marks·Choose all correct options
Let D be a non-empty dictionary. Choose the correct option(s). It is a Multiple Select Question(MSQ).
- A

- B

- C

- D

- A
- Q12MSQ4 Marks·Choose all correct options

- AN represents minimum number of bills issued to a single customer.
- Bcount represents number of customers.
- CA represents maximum number of bills issued to a single customer.
- DIf we replace line 16 with N = N + 1, then N represents number of bills issued to a single customer.
- Q13NAT5 Marks·Write the number
Your answer: - Q14NAT5 Marks·Write the number
The given pseudocode is executed using a dataset having the same fields as the “Words” dataset, and contains the following words: "The experience was simply wonderful. The product quality is fantastic, and I would definitely recommend it to others. It is not only affordable but also has an excellent design. Overall, I believe it is a great choice for anyone looking for a reliable product." Consider the following information: 1. unique(L) returns a list of unique elements of list L. For example unique(["think", "like", "toppers", "think"]) will return ["think", "like", "toppers"]. 2. comNo(L1, L2) returns the number of common elements in lists L1 and L2. 3. Ignore the upper and lower case, and punctuation symbols while comparing with other words.
What will the value of posSen be at the end of the execution of the above pseudocode?Your answer: Read the passage below, then answer Q15–Q16
Q15MCQ4 Marks·Choose one optionThere is an edge between students i and j, with i != j, if and only if:
- Athey are from the same city/town
- Bthey have the same gender
- Cthey are from the same city/town and have the same gender
- Dthey are from the same city/town or have the same gender
- Q16MSQ5 Marks·Choose all correct options
Which of the following statements is/are true? It is a Multiple Select Question (MSQ).
- Alast(A[01]) represent the gender of the student having sequence number 01.
- Brest(A[01]) represent the gender of the student having sequence number 01.
- CIn a graph, all students in a given clique are from the same city/town
- DIf B[x][y] =1 and B[y][z] = 1, then B[x][z] = 1.
Read the passage below, then answer Q17–Q18

Based on the above data, answer the given subquestions.
Q17NAT5 Marks·Write the number
Your answer:- Q18NAT4 Marks·Write the number
Your answer: Read the passage below, then answer Q19–Q20

Based on the above data, answer the given subquestions.
Q19MCQ5 Marks·Choose one optionConsider the below pseudocode

- Ap = 0, q = 0
- Bp = 1, q = 0
- Cp = 0, q = 1
- Dp = 1, q = 1
- Q20MCQ5 Marks·Choose one option

- A0
- B1
- C2
- D3
Qualifier · May 2024Qualifier
Useful Reference Data for this Paper

Q21MSQ3 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
- Q22MCQ4 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
- Q23MCQ4 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.
- Q24MCQ4 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.
- Q25MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q26MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q27MSQ4 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q28MSQ5 Marks·Choose all correct options

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

- A

- B

- C

- D

- A
- Q30NAT3 Marks·Write the number
Your answer: - Q31NAT5 Marks·Write the number
Your answer: - Q32MCQ5 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.
Qualifier · January 2024Qualifier
Useful Reference Data for this Paper

Q33MCQ3 Marks·Choose one optionThe following pseudocode is executed using the “Library” dataset. What will B 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 author Kalam or in English or both
- Q34MCQ3 Marks·Choose one option
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.

- A

- B

- C

- D

- A
- Q35MCQ3 Marks·Choose one option
The following pseudocode is executed using the “Scores” dataset. What will A represent at the end of the execution?

- ANumber of students with highest marks in Mathematics among the three subjects
- BNumber of students with highest marks in Mathematics and lowest marks in Physics
- CNumber of students with highest marks in Chemistry among the three subjects
- DNumber of students with lowest marks in Physics among the three subjects
- Q36MCQ3 Marks·Choose one option
The following pseudocode is executed using the “Words” dataset.
What will count represent at the end of execution?- ANumber of words with at least one pair of vowels occurring consecutively
- BNumber of words with at most two pairs of vowels occurring consecutively
- CNumber of words with at least two pairs of the same vowel occurring consecutively
- DNumber of words with at most two pairs of the same vowel occurring consecutively
- Q37MCQ4 Marks·Choose one 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.

- AStatement 1: X.PartOfSpeech == Y.PartOfSpeech Statement 2: X.LetterCount == Y.LetterCount Statement 3: X.Word and Y.Word end with a full stop
- BStatement 1: X.Word and Y.Word end with a full stop Statement 2: X.PartOfSpeech == Y.PartOfSpeech Statement 3: X.LetterCount == Y.LetterCount
- CStatement 1: X.LetterCount == Y.LetterCount Statement 2: X.Word and Y.Word end with a full stop Statement 3: X.PartOfSpeech == Y.PartOfSpeech
- DStatement 1: X.LetterCount == Y.LetterCount Statement 2: X.PartOfSpeech == Y.PartOfSpeech Statement 3: X.Word and Y.Word end with a full stop
- Q38MCQ4 Marks·Choose one option
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.

- A

- B

- C

- D

- A
- Q39MCQ4 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 sentences with average letter count more than the average letter count of dataset
- BNumber of sentences with average letter count less than the average letter count of dataset
- CNumber of words with average letter count more than the average letter count per word of dataset
- DNumber of words with average letter count less than the average letter count per word of dataset
- Q40MCQ4 Marks·Choose one option
Procedure miniSum accepts three numbers as parameters and returns the sum of two smallest numbers. Choose the correct code fragment to complete the procedure.

- A

- B

- C

- D

- A
- Q41MCQ4 Marks·Choose one option
The following pseudocode is executed using the “Olympics” dataset. Procedure doSomething accepts a table of rows which contains rows of the same player. Assume that the player has won at least two medals and only one medal in any year. What will (B - A) represent at the end of the execution?

- AYear gap between first and second medal won by a player
- BYear gap between first and latest medal won by a player
- CYear gap between latest and second latest medal won by a player
- DYear gap between first and second latest medal won by a player
- Q42MCQ3 Marks·Choose one 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.

- AThe number of pairs of players having the same nationality or the same medal.
- BThe number of pairs of players having the same nationality and same medal.
- CThe number of players having the same nationality and same medal.
- DThe number of players having the different name but of same nationality.
- Q43MSQ4 Marks·Choose all correct options
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”).

- A

- B

- C

- D

- A
- Q44MSQ4 Marks·Choose all correct options
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.

- ARow 1: Incorrect data type of card number
- BRow 2: Incorrect data type of Word
- CRow 3: Incorrect data type of Part of Speech
- DRow 3: Invalid value of Part of Speech
- ERow 4: Incorrect data type of Letter Count
- FRow 4: Invalid value of Letter Count
- Q45MSQ4 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 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.

- ALine 13: Incorrect initialisation of B
- BLine 18: Incorrect update of B
- CLine 20: Incorrect condition
- DLine 21: It should return(0)
- Q46NAT3 Marks·Write the number
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."
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.Your answer:
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.