Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
BSCS1001 · Computational Thinking
End Term · 31 Aug 2025 (Afternoon)
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.
- Q1MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q2MCQ5 Marks·Choose one option

- A

- B

- C

- D

- A
- Q3MCQ5 Marks·Choose one option

- ANumber of students from the cities with the average total marks of the city greater 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
- Q4MCQ5 Marks·Choose one option

- ADictionary with authors as keys mapped to the year of publication of their latest book
- BDictionary with authors as keys mapped to the year of publication of their first book
- CDictionary with authors as keys mapped to the year of publication of their second book
- DDictionary with authors as keys mapped to the year of publication of their second latest book
- Q5MCQ5 Marks·Choose one option

- ANumber of pairs of students with different gender or same Town/City
- BNumber of pairs of students with same gender or different Town/City
- CNumber of pairs of students with different gender and same Town/City
- DNumber of pairs of students with same gender and different Town/City
- Q6MSQ5 Marks·Choose all correct options

- AThere are 5 cliques of size three present in the graph.
- BThe nodes 0, 2, 3 and 4 form a clique of size four.
- CThe maximum size of clique that appears in the graph is 3.
- DThe nodes 1, 2 and 3 form a clique of size three.
- Q7MSQ5 Marks·Choose all correct options

- AWhen L = [5, 8, 6, 1, 3], the output of findSomething1(L) is 8.
- BWhen L = [5, 8, 6, 1, 3], the output of findSomething1(L) is 1.
- CWhen L = [5, 8, 6, 1, 3], the output of findSomething2(L) is 8.
- DWhen L = [5, 8, 6, 1, 3], the output of findSomething2(L) is 1.
- Q8MSQ5 Marks·Choose all correct options

- AThe first element of both the lists, cumuList and aList, will be same.
- BNumber of elements in cumuList will be one lesser than that of aList.
- CcumuList is a list of numbers in decreasing order.
- DNumber of elements in both lists, cumuList and aList, will be different.
- Q9MSQ5 Marks·Choose all correct options

- AN represents maximum number of bills issued to a single customer.
- Bcount represents number of customers.
- CAt the end of the execution, the value of A will be 1.
- DN represents maximum number of bills issued to a single customer from the same shop.
- Q10MSQ6 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q11NAT5 Marks·Write the number
Your answer: - Q12NAT5 Marks·Write the number
Your answer: - Q13NAT5 Marks·Write the number
Your answer: - Q14NAT4 Marks·Write the number
Your answer: Read the passage below, then answer Q15–Q16
Consider the following condensed version of the “Trains” dataset. There are a total of n stations, with stations being indexed from 0 to n − 1. There are M rows in the table. Each row contains information about a train that connects two stations without any stops in between.

Row r, tells us that train t departs from station i and arrives at station j after covering a distance of d kilometers without stopping at any intermediate station. Therefore, each train t will occupy multiple rows in this table.
This scenario is modeled as a graph and is represented by a matrix A. Each node in the graph corresponds to a station. Assume that the value of n is already given to you. Consider the following pseudocode.

Based on the above data, answer the given subquestions.
Q15MSQ5 Marks·Choose all correct optionsIf (i, j) is a pair of stations, which of the following statements about the dictionary A[i][j] are true?
- AEach key corresponds to a train that goes from station i to j without stopping at any intermediate station.
- BEach key corresponds to a train that goes from station i to j. It may stop at multiple stations between i and j.
- CThe value corresponding to key t of the dictionary is the distance between stations i and j on t’s route.
- DThe value corresponding to key t of the dictionary is the minimum distance between stations i and j on t’s route.
- Q16MSQ6 Marks·Choose all correct options
ijMin is a procedure that accepts a pair of stations (i, j), and the matrix A as input. It returns a train which goes from i to j by covering the least distance, without stopping at any intermediate station. If there is no train connecting these two stations, the procedure returns -1. The pseudocode may have mistakes. Identify all of them (if any).
Based on the above data, answer the given subquestions.- AError in line 3
- BError in line 5
- CError in line 7
- DError in line 9
Read the passage below, then answer Q17–Q18
Let M be an adjacency matrix of a graph G given below, where M[i][j] = 1 if there is an edge from i to j, otherwise 0.
ListV represents the list of vertices of the graph G.

Based on the above data, answer the given subquestions.
Q17MSQ5 Marks·Choose all correct options
- AnewMatrix [2] [4] = 1
- BnewMatrix [1] [1] = 0
- CnewMatrix [3] [0] = 1
- DnewMatrix [1] [3] = 0
- Q18MCQ5 Marks·Choose one option

- A3
- B5
- C6
- D9
Read the passage below, then answer Q19–Q20
Consider the implementation of the following procedure getDictionary.
Assume that the procedure absolute takes an integer as parameter and returns the absolute value. For example, absolute(-2) = 2 and absolute(3) = 3.

Let D be the value returned by getDictionary([5, 10, 20, 30, 20, 10, 20, 5, 15]). Answer the given subquestions based on D.
Q19MCQ5 Marks·Choose one optionWhat is the value of D[20] ?
- A7
- B10
- C30
- D20
- Q20NAT4 Marks·Write the number
What is the value of length(keys(D)) ?
Your answer: