Question 1
Useful Data has been mentioned above.
This data attachment is just for a reference & not for an evaluation.

The IIT Madras BS Computational Thinking (Computational Thinking (CT)) End Term paper sat on 10 May 2026, in the January 2026 term: 46 questions for 206 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
Useful Data has been mentioned above.
This data attachment is just for a reference & not for an evaluation.
Correct answer
Useful Data has been mentioned above.
Useful Data has been mentioned above.
This data attachment is just for a reference & not for an evaluation.
Correct answer
Useful Data has been mentioned above.
The following pseudocode is executed using the "Scores" dataset.
At the end of execution, what does Dict represent?
A dictionary where each city maps to the lowest total marks scored and the corresponding student's name.
A dictionary where each city maps to the highest total marks scored and the corresponding student's name.
A dictionary where each city maps to the lowest total marks recorded in that city.
None of these
Correct answer
A dictionary where each city maps to the lowest total marks scored and the corresponding student's name.
The following pseudocode is executed using the "Shopping Bills" dataset. Assume each customer has a distinct name.
What will N represent at the end of the execution?
Minimum number of bills issued to a single customer
Maximum number of bills issued to a single customer
Number of distinct customers in the dataset
Minimum number of customers who purchased items from the same shop
Correct answer
Minimum number of bills issued to a single customer
The following pseudocode is executed using the "Scores" dataset. What will Z represent at the end of the execution?
Number of students from the cities with the average Physics marks of the city less than the average Physics marks of the dataset.
Number of students from the cities with the average Physics marks of the city greater than the average Physics marks of the dataset.
Number of cities with the average Physics marks less than the average Physics marks of the dataset.
Number of cities with the average Physics marks more than the average Physics marks of the dataset
Correct answer
Number of students from the cities with the average Physics marks of the city greater than the average Physics marks of the dataset.
The following pseudocode is executed using the "Scores" dataset. What will Z represent at the end of the execution?
Number of students from the cities with the average total marks of the city more than the average total marks of the dataset.
Number of students from the cities with the average total marks of the city less than the average total marks of the dataset.
Number of cities with the average total marks less than the average total marks of the dataset.
Number of cities with the average total marks more than the average total marks of the dataset
Correct answer
Number of students from the cities with the average total marks of the city less than the average total marks of the dataset.
Let X and Y be two rows in the "Scores" table. We call X and Y partially matching if student X and Y are either have the same Total Marks or are from the same city, but not both. Let partialMatch(X, Y) be a procedure to find whether X and Y are partially matching. Choose the correct implementation of the procedure partialMatch.




Correct answer

Let X and Y be two rows in the "Scores" table. We call X and Y partially matching if student X and Y either have the same DOB or are from the same city, but not both. Let partialMatch(X, Y) be a procedure to find whether X and Y are partially matching. Choose the correct implementation of the procedure partialMatch.




Correct answer

The following pseudocode is executed using the "Scores" dataset. What will the value of B represent at the end of execution?
Number of repeated marks in Physics
Minimum marks in Physics
Maximum marks in Physics
Most frequent marks in Physics
Correct answer
Most frequent marks in Physics
The following pseudocode is executed using the "Library" dataset. What will B represent at the end of execution?
Number of books written by author Kalam in Hindi
Number of books written by author Kalam that are not in Hindi
Number of Hindi books written by authors other than Kalam
Number of books that are not written by author Kalam and are in Hindi
Correct answer
Number of books that are not written by author Kalam and are in Hindi
The following pseudocode is executed using the "Library" dataset. What will B represent at the end of execution?
Number of books written by author Kalam that have at least 200 pages
Number of books not written by author Kalam and that have at least 200 pages
Number of books written by author Kalam that have fewer than 200 pages
Number of books that are not written by author Kalam and have fewer than 200 pages
Correct answer
Number of books that are not written by author Kalam and have fewer than 200 pages
Consider the following pseudocode is executed using the "Words" dataset.
Which of the following statements is/are true?
A represents the number of sentences in the "Words" dataset that end with a noun
A represents the number of words in the "Words" dataset that are nouns
outList represents a list of lists of last and first word of each sentence in that order.
outList represents a list of lists of first and last word of each sentence in that order.
Correct answers
A represents the number of sentences in the "Words" dataset that end with a noun
outList represents a list of lists of last and first word of each sentence in that order.
Consider a graph generated from the "Scores" table that is represented by a matrix B. Each node in the graph corresponds to a student from the table. SeqNo is used to label the nodes in the graph. Which of the following statements are true about this graph?
There are two cliques in this graph, one for each gender.
In every clique, there is at least a pair of students having different genders.
All students in a given clique have the same gender.
All students in a given clique are from the same city/town.
There are no cliques in this graph.
Correct answers
All students in a given clique have the same gender.
All students in a given clique are from the same city/town.
The following pseudocode finds the smallest integer present in the input list. Choose the correct code fragment to complete the pseudocode.




Correct answers


Consider the following pseudocode for inserting elements into a sorted list. The pseudocode may have mistakes. Identify all such mistakes (if any).
Line 5: inside if statement condition should be '(not(inserted))'.
Line 6: inside if statement condition should be 'x > z'.
Line 11: [z] needs to be appended to the end of newList.
Line 14: 'x' is appended to the end of the list instead of the beginning.
Correct answers
Line 5: inside if statement condition should be '(not(inserted))'.
Line 11: [z] needs to be appended to the end of newList.
The given pseudocode is executed using the "Words" dataset. At the end of execution A captures the frequency count of the most frequent consonant 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.
Line 1: Incorrect initialization of D
Line 8: Incorrect conditional expression
Line 9: A updated with wrong value
Line 13: Incorrect initialization of i
Line 16: Conditional expression should not use "not" operator
Line 22: i updated at wrong place
Correct answers
Line 8: Incorrect conditional expression
Line 16: Conditional expression should not use "not" operator
Let LA be a non-empty list of integers. A list LB is constructed using the following pseudocode.
Which of the following will return true after the execution of above pseudocode?
length(LB) == length(LA) - 1
LC == [50]
last(LB) == [10]
init(first(rest(LB))) == [20]
first(last(LB)) == [50]
first(init(LB)) == [10]
Correct answers
init(first(rest(LB))) == [20]
first(last(LB)) == [50]
first(init(LB)) == [10]
Let LA be a non-empty list of integers. A list LB is constructed using the following pseudocode.
Which of the following will return true after the execution of above pseudocode?
length(LB) == length(LA) - 1
LC == [50]
last(LB) == LA
init(first(rest(LB))) == [40, 30, 20]
first(last(LB)) == [50]
first(init(LB)) == [50, 40, 30, 20, 10]
Correct answers
init(first(rest(LB))) == [40, 30, 20]
first(init(LB)) == [50, 40, 30, 20, 10]
The following pseudocode is executed using the "Words" dataset. Assume that the rows in the table are sorted in the ascending order of sequence number. What does outList represent at the end of execution?
outList represents a list of lists
Each element in outList represents a list containing words and their letter counts from a sentence except for the adjectives
Each element in outList corresponds to one word from the paragraph
Each element in outList represents the words from a sentence that have part of speech 'adjective'
Correct answers
outList represents a list of lists
Each element in outList represents a list containing words and their letter counts from a sentence except for the adjectives
Let D be a non-empty dictionary. Choose the correct option(s).
Let a be a key of dictionary D, then a is always a string.
For keys a and b in D, if a != b then D[a] == D[b] may or may not be true.
For keys a and b in D, a != b is always True.
If D = { 'a': 5, 'b' : [3, 4, 7], 'c' : 6}, then the value of rest(D[b]) is [3, 4].
Correct answers
For keys a and b in D, if a != b then D[a] == D[b] may or may not be true.
For keys a and b in D, a != b is always True.
Consider the graph given below.
Which of the following statement(s) is/are true?
Vertex 0 is part of every clique of size 3 in the graph.
There exists a clique of size 4 in the graph.
Vertices 3 and 4 belong to at most one common clique of size 3.
The nodes 0 and 1 form a clique of size two.
Correct answers
There exists a clique of size 4 in the graph.
The nodes 0 and 1 form a clique of size two.
The following pseudocode is executed using the "Library" dataset. At the end of the execution, A stores a dictionary with the author's name as key mapped to the number of books written by him/her. But the code may have mistakes. Identify all such mistakes (if any). Assume that all statements not listed in the options below are free of errors.
Replacing the condition given in line 4 with the statement given below will provide the correct result.

Interchanging Line 4 and 7 will provide the correct result.
Interchanging Line 5 and 8 will provide the correct result.
The pseudocode will provide the correct result even without getting modified.
Correct answers
Replacing the condition given in line 4 with the statement given below will provide the correct result.

Interchanging Line 5 and 8 will provide the correct result.
Consider the following pseudocode is executed using the "Words" dataset.
Which of the following statements is/are true?
A represent the number of sentences in the "Words" dataset that do not end with a noun
A represent the number of words in the "Words" dataset that are nouns
outList represents list of lists of first and last word of each sentence in that order.
outList represents list of lists of last and first word of each sentence in that order.
Correct answers
A represent the number of sentences in the "Words" dataset that do not end with a noun
outList represents list of lists of first and last word of each sentence in that order.
Consider the following pseudocode for inserting elements into a sorted list. The pseudocode may have mistakes. Identify all such mistakes (if any).
Which of the following statements is/are true at the end of the execution?
Line 3: variable 'inserted' is initialised to True so it will never enter the nested if block for comparison.
Line 6: inside if statement condition should be 'x > z'.
Line 11: [z] needs to be appended to the end of newList.
Line 14: 'x' is appended to the end of the list instead of the beginning.
Correct answers
Line 3: variable 'inserted' is initialised to True so it will never enter the nested if block for comparison.
Line 11: [z] needs to be appended to the end of newList.
Consider the following procedure, where L1 and L2 are two non-empty lists.
Choose the correct option(s).
If L1 = [2, 3, 5], L2 = [2, 4, 5], then CompareLists[L1, L2] returns false.
If L1 = [2, 4, 5], L2 = [5, 4, 2], then CompareLists[L1, L2] returns true.
If L1 = [2, 4, 5], L2 = [2, 5, 4], then CompareLists[L1, L2] returns true.
If L1 = [2, 4, 5], L2 = [3, 4, 2], then CompareLists[L1, L2] returns false.
Correct answers
If L1 = [2, 3, 5], L2 = [2, 4, 5], then CompareLists[L1, L2] returns false.
If L1 = [2, 4, 5], L2 = [5, 4, 2], then CompareLists[L1, L2] returns true.
If L1 = [2, 4, 5], L2 = [3, 4, 2], then CompareLists[L1, L2] returns false.
The following pseudocode is executed using the "Words" dataset. Assume that the rows in the table are sorted in the ascending order of sequence number. What does outList represent at the end of execution?
outList represents a list of lists
Each element in outList represents a list containing words and their parts of speech from a sentence except for the adjectives
Each element in outList corresponds to one word from the paragraph
Each element in outList represents the words from a sentence that have part of speech 'adjective'
Correct answers
outList represents a list of lists
Each element in outList represents a list containing words and their parts of speech from a sentence except for the adjectives
The given pseudocode is executed using the "Words" dataset. At the end of execution A captures the frequency count of the least frequent consonant 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.
Line 1: Incorrect initialization of A
Line 8: Incorrect conditional expression
Line 9: A updated with wrong value
Line 13: Incorrect initialization of i
Line 16: Conditional expression should not use "not" operator
Line 22: i updated at wrong place
Correct answers
Line 1: Incorrect initialization of A
Line 8: Incorrect conditional expression
Line 16: Conditional expression should not use "not" operator
Consider the graph given below.
Which of the following statement(s) is/are true?
There are 3 cliques of size three present in the graph.
The degree of vertex 2 is 4.
The maximum size of clique that appears in the graph is 3.
The nodes 0 and 2 form a clique of size two.
Correct answers
The degree of vertex 2 is 4.
The nodes 0 and 2 form a clique of size two.
Let D be a non-empty dictionary. Choose the correct option(s).
Let a be a key of dictionary D, then a is always an integer.
For keys a and b in D, if a != b then D[a] != D[b] may or may not be true.
For keys a and b in D, a == b is always True.
If D = { 'a': 5, 'b' : [3, 4, 7], 'c' : 6}, then the value of init(rest(D[b])) is [4].
Correct answers
For keys a and b in D, if a != b then D[a] != D[b] may or may not be true.
If D = { 'a': 5, 'b' : [3, 4, 7], 'c' : 6}, then the value of init(rest(D[b])) is [4].
reverse is a recursive procedure to reverse a list. Select the correct code fragment to complete the pseudocode given below.
return ([last(L)] ++ reverse(init(L)))
return ([first(L)] ++ reverse(rest(L)))
return ([last(L)] ++ reverse(init(rest(L))) ++ [first(L)])
return ([first(L)] ++ reverse(init(rest(L))) ++ [last(L)])
return ([last(L)] ++ reverse(rest(init(L))) ++ [first(L)])
Correct answers
return ([last(L)] ++ reverse(init(L)))
return ([last(L)] ++ reverse(init(rest(L))) ++ [first(L)])
return ([last(L)] ++ reverse(rest(init(L))) ++ [first(L)])
What will the value of S be at the end of the execution of the following pseudocode?
A written answer, not marked automatically.
What will the value of S be at the end of the execution of the following pseudocode?
A written answer, not marked automatically.
Consider the following procedure.
What will the return value of DoSomething(728) be?
A written answer, not marked automatically.
Consider the following procedure.
What will the return value of DoSomething(456) be?
A written answer, not marked automatically.
In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•
Consider the following graph with six nodes. A is the 6 × 6 adjacency matrix corresponding to this graph. Assume that it has already been computed:
In given subquestions, S represents a list, P represents a dictionary, while A represents adjacency matrix of the above graph. Based on the above data, answer the given subquestions.
What will be the value of S after executing the following pseudocode?
[0, 1, 2, 5, 3, 4]
[0, 1, 4]
[0, 1, 2, 3, 5, 4]
[0, 3, 1, 4, 5]
Correct answer
[0, 1, 2, 3, 5, 4]
The following pseudocode is executing using the “Scores” table. At the end of the execution,matrix represents the adjacency matrix of the graph generated from the “Scores” table.
Based on the above data, answer the given subquestions.
If matrixPh[i] [j] = 1, then:
i scored at most 10 and at least 20 more marks in Physics than j
i scored at least 10 and at most 20 more marks in Physics than j
j scored at least 10 and at most 20 more marks in Physics than i
j scored at most 10 and at least 20 more marks in Physics than i
Correct answer
i scored at least 10 and at most 20 more marks in Physics than j
In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•
Consider the following graph with six nodes. A is the 6 × 6 adjacency matrix corresponding to this graph. Assume that it has already been computed:
In given subquestions, S represents a list, P represents a dictionary, while A represents adjacency matrix of the above graph. Based on the above data, answer the given subquestions.
What will be the value of nodes after executing the following pseudocode?
[5, 2, 1, 0, 3, 4]
[5, 2, 1, 4, 0, 3]
[5, 2, 3, 0, 1, 4]
Cannot be determined
Correct answer
Cannot be determined
The following pseudocode is executing using the “Scores” table. At the end of the execution,matrix represents the adjacency matrix of the graph generated from the “Scores” table.
Based on the above data, answer the given subquestions.
Choose the correct statement based on the main data pseudocode.
For all i, j with i ≠ j, + = 1
For all i, j with i ≠ j, if = 1 then = 0
For all i, j with i ≠ j, if = 0 then = 1
For all i, j with i ≠ j, if = 1 then = 1
For all i, j with i ≠ j, if = 0 then = 0
Correct answer
For all i, j with i ≠ j, if = 1 then = 0
Let M be an adjacency matrix of a graph G given below, where = 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.
Consider the below pseudocode
What will be the values of p and q at the end of execution?
p = 1, q = 1
p = 2, q = 1
p = 1, q = 2
p = 2, q = 2
Correct answer
p = 2, q = 1
Let M be an adjacency matrix of a graph G given below, where = 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 sub questions.
Consider the below pseudocode
What will the values of p and q be at the end of execution of pseudocode given below?
p = 0, q = 0
p = 1, q = 0
p = 0, q = 1
p = 1, q = 1
Correct answer
p = 1, q = 0
Let M be an adjacency matrix of a graph G given below, where = 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.
Consider the below pseudocode.
What will be the value of count at the end of execution?
A written answer, not marked automatically.
Let M be an adjacency matrix of a graph G given below, where = 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 sub questions.
Consider the below pseudocode.
What will be the of value of count at the end of the execution?
6
7
8
9
Correct answer
9
In the following pseudocode: graph is a matrix• parents is a dictionary• sequence is a list•
Consider the following graph with six nodes. A is the 6 × 6 adjacency matrix corresponding to this graph. Assume that it has already been computed:
In given subquestions, S represents a list, P represents a dictionary, while A represents adjacency matrix of the above graph. Based on the above data, answer the given subquestions.
A written answer, not marked automatically.
Let M be an adjacency matrix of a graph G given below, where = 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.
A written answer, not marked automatically.
The following pseudocode is executing using the “Scores” table. At the end of the execution,matrix represents the adjacency matrix of the graph generated from the “Scores” table.
Based on the above data, answer the given subquestions.
A written answer, not marked automatically.
Let M be an adjacency matrix of a graph G given below, where = 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 sub questions.
A written answer, not marked automatically.