Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
BSCS1001 · Computational Thinking
End Term · 13 Apr 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

- A1
- B3
- C5
- D9
- Q4MCQ6 Marks·Choose one option

- Athey are from different cities/towns
- Bthey have the same gender
- Cthey are from the different cities/towns and have different genders
- Dthey are from the same cities/towns or have the different genders
- Q5MCQ6 Marks·Choose one option

- Aj scored at most 20 and at least 30 more marks in Mathematics than i
- Bi scored at most 20 and at least 30 more marks in Mathematics than j
- Ci scored at least 20 and at most 30 more marks in Mathematics than j
- Dj scored at least 20 and at most 30 more marks in Mathematics than i
- Q6MSQ5 Marks·Choose all correct options

- AoutList represents a list of lists
- BEach element in outList represents a list containing words and their parts of speech from a sentence except for the adjectives
- CEach element in outList corresponds to one sentence from the paragraph
- DEach element in outList represents the words from a sentence that have part of speech 'adjective'
- Q7MSQ5 Marks·Choose all correct options

- AA dictionary where each gender maps to the total number of students for each city.
- BA dictionary where each city maps to the total number of students for each gender.
- CA dictionary where each city maps to the total number of students.
- DNone of these
- Q8MSQ5 Marks·Choose all correct options

- A

- B

- C

- D

- A
- Q9MSQ4 Marks·Choose all correct options
Let D be a non-empty dictionary defined as: D = { "x": [10, 20, 30], "y": [5, 15, 25], "z": { "a": 100, "b": 200 }, "w": "a" } Choose the correct option(s). It is a Multiple Select Question (MSQ).
- AThe expression last(D["x"]) + init(D["y"]) evaluates to 35.
- BThe expression init(D["z"]) returns "a":100.
- CThe expression length(D["z"]) returns 2.
- DThe expression last(rest(D["x"])) returns 30.
- 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: Read the passage below, then answer Q13–Q14

Based on the above data, answer the given subquestions.
Q13MCQ4 Marks·Choose one option
- ARevenue generated by item j for shop i
- BRevenue generated by item i for shop j
- CCost of item i in shop j
- DCost of item j in shop i
- Q14MCQ4 Marks·Choose one option
What will costD[i] represent at the end of the execution?
- AList of item(s) which generated highest revenue for shop i
- BList of item(s) which generated lowest revenue for shop i
- CList of cost of most sold item(s) in shop i
- DList of cost of least sold item(s) in shop i
Read the passage below, then answer Q15–Q16

Based on the above data, answer the given subquestions.
Q15MCQ5 Marks·Choose one optionThe following pseudocode generates a graph G from books. Each node corresponds to an author. For two different authors j and k, what does the value matrix[j] [k] represent at the end of the execution?

- ANumber of books that they have co-authored
- BList of books that they have co-authored
- CTotal number of books authored by both the authors
- DTotal number of books authored by either j or k or both
- Q16MSQ5 Marks·Choose all correct options
The following pseudocode creates adjacency matrix matrix2 of another graph H from books. For two different authors j and k, matrix2[j] [k] represents list of authors who have co-authored a book with both j and k. Choose the correct code fragment to complete the following pseudocode.

- A

- B

- C

- D

- A
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.

Answer the given subquestions.
Q17MCQ5 Marks·Choose one optionConsider the below pseudocode
What will the values of p and q be at the end of execution of pseudocode given below?

- Ap = 0, q = 0
- Bp = 1, q = 0
- Cp = 0, q = 1
- Dp = 1, q = 1
- Q18MCQ5 Marks·Choose one option
Consider the below pseudocode.
What will be the of value of count at the end of the execution?- A0
- B1
- C2
- D3
Read the passage below, then answer Q19–Q20
The following pseudocode is executed using the “Scores” dataset. Two students form a study pair if their difference in Mathematics marks are at most 10. Assume that Pile P1 is always restored back after calling studyPair(Pile P1).

Based on the above data, answer the given subquestions.
Q19MSQ5 Marks·Choose all correct optionsWhich of the following statements is/are correct after psuedocode is executed?
- Acount1 represents number of study pairs
- Bcount1 represents total number of students
- Ccount2 represents number of study pair where both the students in each pair are from the same city among Chennai, Bengaluru and Vellore
- Dcount2 represents number of study pair where both the students in each pair are not from the same city among Chennai, Bengaluru and Vellore
- Q20MSQ5 Marks·Choose all correct options
Which of the following statements is/are correct after psuedocode is executed ?
- AstudyPair(Pile CHN) will give the number of study pairs where both students in the pair are from Chennai.
- BstudyPair(Pile CHN) will give the number of study pairs where both students in the pair are not from Chennai.
- Ccount3 represents number of study pairs where both students in the pair are not from the same city among Chennai, Bengaluru and Vellore
- Dcount3 represents number of study pairs where both students in the pair are from the same city among Chennai, Bengaluru and Vellore