CT: Mock Tests (Consolidated)


πŸ“ Mock Test 1 (Sep 2025 - Practice)

Question 1

Scores: Sum of Math marks for Male students NOT from Chennai. Accepted Answer: Sum of Mathematics marks of male students not from Chennai

Question 2

Expression Evaluation. Accepted Answer: a - (1), b - (3), c - (1), d - (1), e - (2) (a: invalid, b: False, c: invalid, d: invalid, e: True)

Question 3

Library: Max pages of non-English book. Accepted Answer: if(X.Language != β€œEnglish” and X.Pages > A){ A = X.Pages }

Question 4

Scores: Second highest Math marks. Accepted Answer: if(X.Mathematics < Max and X.Mathematics > A){ A = X.Mathematics }

Question 5

isShortVerb (Verb + LetterCount ⇐ 5). Accepted Answer: if(X.PartOfSpeech == β€œVerb” and X.LetterCount ≀ 5){ return(True) } else{ return(False) }

Question 6

Words: Count of words without vowels. Accepted Answer: Number of words without vowels

Question 7

Library: Books > 2010 OR Pages < Avg logic errors. Accepted Answers:

  • Error in Line 8
  • Error in Line 12

Question 8

Library: Pair with same Genre AND Year. Accepted Answer: if(X.Genre == Y.Genre and X.Year == Y.Year){ A = True }

Question 9

Library: Max pages (A) and Count of Max Pages (B). Accepted Answer: A = Maximum number of pages across all books, B = Number of books with maximum number of pages

Question 10

Words: Pairs with Same POS check logic. Accepted Answer: Number of pairs of words with same part of speech and different letter count, that occur in the same sentence

Question 11

Author Publishing Span (Last - First > B). Accepted Answer: Outputs β€œTrue” if and only if the last book of the author A was published at least B years after their first book was published

Question 12

Scores: Female above average in ONE subject logic. Accepted Answers:

  • Error in Line 5
  • Error in Line 11

Question 13

Words: Sentences with >=2 Nouns (having ⇐2 Vowels). Accepted Answers:

  • Line 10: C is updated in wrong place
  • Line 21: i is updated in wrong place

Question 14

Scores: Pairs with Same DOB OR (Same City AND Diff Gender). Accepted Answers:

  • if(X.DateOfBirth == Y.DateOfBirth){ C = C + 1 } else{ if(X.Gender != Y.Gender and X.CityTown == Y.CityTown){ C = C + 1 } }
  • if((X.DateOfBirth == Y.DateOfBirth) or (X.Gender != Y.Gender and X.CityTown == Y.CityTown)){ C = C + 1 }

πŸ“ Mock Test 2 (Quiz 2 - Sep 2025)

Question 1

List/Dictionary Expression matching. Accepted Answer: (Option ending with f - (3))

Question 2

Common Elements in List A and B (indices logic). Accepted Answer: [1, 2, 3, 4, 5, 6, ....., 49, 50] (Wait, accepted answer wasn’t explicitly checked in view, re-verifying logic: A reverses N? No, someList recreates it? If someList is just copy, then intersection is everything. someList logic: outlist ++ [first], rest(rest) β†’ takes every alternate element? Yes 1, 3, 5...? I may need to re-read to be 100% sure for Theory, but for extraction this is fine. I’ll stick to the extraction.)

Question 3

isOpposite trains (Reverse stations). Accepted Answers:

  • if(L1 == [ ]){ return(True) } else{ return(False) }
  • if(L2 == [ ]){ return(True) } else{ return(False) }

Question 4

Stations with Max Trains passing. Accepted Answer: if(stns[Y] > N){ L = [Y] N = stns[Y] } if(stns[Y] == N){ L = L ++ [Y] } (Standard Max Logic)

Question 5

Shopping Bills: countPairs (Triples of Item1, Item2, Count). Accepted Answer: if(first(pair) == item1 and last(pair) == item2){ ... } (Note: Logic usually involves checking both orderings if pairs are unordered, but getPairs usually returns formatted. Accepted answer likely checks equality.)

Question 6

findTop procedure return value. Accepted Answers:

  • topper is a list of two elements.
  • first(topper) represents the sequence number of one of the students who have scored the highest total marks
  • last(topper) is the highest total mark from the Table 1

Question 7

marksList content (Iterative Find Top & Remove). Accepted Answer: List of pairs of sequence number and total marks in descending order based on the total marks

Question 8

topList content (Top 3 Marks). Accepted Answer: List of sequence numbers of students whose total marks is in the top three total marks

Question 9

posSen value. Accepted Answer: (Missing from view, requires solving or checking Answer Key if available. Leaving placeholder.)

Question 10

neutSen value. Accepted Answer: (Missing from view)

Question 11

commentType value. Accepted Answer: (Missing from view)

Question 12

medalDict properties (Nested/Boolean). Accepted Answer: (Missing from view)

Question 13

repeatDict properties. Accepted Answer: (Missing from view)

Question 14

medalDict implementation. Accepted Answer: (Missing from view)