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)) Quiz 2 paper sat on 16 Aug 2026, in the May 2026 term: 14 questions for 51 marks in 120 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.
The following pseudocode is executed using the Scores dataset.
What does L contain at the end of the execution?
Towns/cities where the highest and second highest total scores among students from that town/city differ by at most 10
Towns/cities where every student has a total score within 10 marks of every other student from that town/city
Towns/cities where the highest and second highest total scores among students from that town/city differ by more than 10
Towns/cities where the first two students read from that town/city differ in total score by at most 10
Correct answer
Towns/cities where the highest and second highest total scores among students from that town/city differ by at most 10
The following pseudocode is executed using the Library dataset.
What does D store at the end of the execution?
For each publisher, the name and year of one of its earliest English books in the dataset
For each publisher, the name and year of one of its latest English books in the dataset
For each publisher, the number of English books published by it
For each publisher, the name and year of its earliest book, irrespective of language
Correct answer
For each publisher, the name and year of one of its earliest English books in the dataset
The following pseudocode is executed on the Words dataset.
What does represent at the end of execution?
Total number of words having at least 8 letters.
Total number of nouns having at least 8 letters.
Total number of sentences having at least 8 words.
Total number of distinct words having at least 8 letters.
Correct answer
Total number of words having at least 8 letters.
The following procedure takes a list of integers as input.
What is returned by ?
—
—
—
—
Correct answer
—
The following pseudocode is executed using the Shopping Bills dataset.
What does represent for a category C?
The average price of distinct item names in category C, where each item name is counted once
The average unit price of all purchased units belonging to category C across all bills
The average total bill amount of bills that contain at least one item from category C
The total cost of all items belonging to category C across all bills
Correct answer
The average unit price of all purchased units belonging to category C across all bills
The following pseudocode is executed using the Shopping Bills dataset. What will D represent at the end of the execution?
For an item C, and a shop S, is set to True if and only if the item is sold for a constant price
For an item C, and a shop S, is set to True if and only if the item is billed in more than one bill
For an item C, and a shop S, is set to True if and only if the item is sold for variable price
For an item C, and a shop S, is set to True if and only if the item is billed in exactly one bill
Correct answer
For an item C, and a shop S, is set to True if and only if the item is sold for variable price
The following pseudocode is executed using the Words dataset. Choose all the correct statements.
counts nouns that are palindromes
Every word in L is a noun such that no pair of letters at symmetric positions (first–last, second–second-last, etc.) is the same.
A word whose is not "Noun" can still increase if the word is a palindrome
A noun with equal to 1 will always increase
Correct answers
counts nouns that are palindromes
Every word in L is a noun such that no pair of letters at symmetric positions (first–last, second–second-last, etc.) is the same.
A noun with equal to 1 will always increase
The procedure visitedShop returns the list of names of people who have visited a particular shop in the Shopping Bills dataset. It accepts the shop's name as a parameter. Additionally, each customer must be represented exactly once in the returned list. The following pseudocode may have mistakes. Identify all such mistakes (if any).
Error in line 2
Error in line 6
Error in line 7
Error in line 16
Error in line 18
Error in line 19
No error
Correct answers
Error in line 2
Error in line 7
Error in line 16
The following pseudocode is executed on the Scores dataset. Assume uniquely identifies each student.
Which of the following statements are always true?
Every sequence number stored in is also present in .
stores the sequence numbers of students whose Mathematics marks are at least 90.
—
—
Correct answers
Every sequence number stored in is also present in .
stores the sequence numbers of students whose Mathematics marks are at least 90.
—
The following pseudocode is executed using the Library dataset. Choose all the correct statements.
For each genre G, contains each author at most once
For each genre G, is the total number of pages across all books in that genre
If an author has three books in the same genre, at most one of those books contributes to
If an author has more than one book in the same genre with different page counts, may depend on the order in which the rows are read
For each genre G, is the sum of pages of the latest book written by each author in that genre
Correct answers
For each genre G, contains each author at most once
If an author has three books in the same genre, at most one of those books contributes to
If an author has more than one book in the same genre with different page counts, may depend on the order in which the rows are read
Consider the following procedure.
What is returned by
A written answer, not marked automatically.
The given pseudocode is executed using a dataset having the same fields as the Words dataset, and contains the following words: "I ordered this product from Gitark. I am very happy to share my review regarding this awesome product. It is not only nice to use, but also has a very cool look. I think this is the best product which can be bought in this price range." Consider the following information: returns a list of unique elements of list L. For example, will return . 1. returns the number of common elements in lists L1 and L2.2. Ignore the upper and lower case, and punctuation symbols while comparing with other 3. words.
What will be the value of posSen at the end of the execution of the above pseudocode?
A written answer, not marked automatically.
What is the value of S at the end of the execution of the following pseudocode?
A written answer, not marked automatically.