Advanced Topics Question Bank - 150 Questions
Instructions
Topics 1-2: CAT exam level difficulty (challenging reasoning required)
Topics 3-5: Moderate level difficulty
Show all working clearly
Time recommendations: 3 minutes per challenging question, 2 minutes per moderate
question
Total questions: 150 (30 per topic)
Topic 1: Graphs and Family Trees (CAT Level - Questions 1-30)
Question 1
In a family tree, A is the father of B and C. B is the father of D, E, and F. C is the father of G and H.
If each person has exactly 2 children except the youngest generation, and there are 4
generations in total, how many people are in the family tree? What is the relationship between D
and G?
Question 2
A company's organizational chart shows that each manager supervises exactly 3 employees,
except for the CEO who supervises 4 department heads. If there are 5 levels in the hierarchy and
364 total employees, how many managers are there at the 3rd level?
Question 3
In a directed graph representing a tournament, each team plays every other team exactly once. If
team A beats team B, there's a directed edge from A to B. If there are 8 teams and team X has
beaten exactly 5 teams, how many teams have beaten team X?
Question 4
A family reunion has 45 people across 4 generations. The oldest generation has 2 people, and
each person in the first three generations has exactly 3 children. If 8 people from the youngest
generation couldn't attend, how many people are actually present at the reunion?
Question 5
In a social network graph, each person is connected to exactly 4 others. If there are 20 people in
the network and we want to find the minimum number of edges that need to be removed to
disconnect the graph into exactly 3 components, what is this number?
Question 6
A family tree shows that P is the grandfather of Q, R, S, and T. Q and R are siblings, and S and T
are siblings but from a different parent than Q and R. If P has exactly 2 children, and each of his
children has exactly 2 children, what is the relationship between Q and S?
Question 7
In a binary tree representing a family genealogy, each node represents a person, and each person
has at most 2 children. If the tree has 15 nodes and is complete (all levels filled except possibly
the last), what is the maximum possible height of the tree?
Question 8
A company's reporting structure is represented as a tree where each employee reports to exactly
one manager. If there are 127 employees total and each manager (except leaves) has exactly 2
direct reports, how many managers are there?
Question 9
In a weighted graph representing distances between cities, the shortest path from city A to city E
passes through cities B, C, and D in that order. If AB = 45 km, BC = 38 km, CD = 52 km, and DE = 41
km, and there's a direct road from A to E of 165 km, how much distance is saved by taking the
shortest path?
Question 10
A family tree has 5 generations. Generation 1 has 2 people (great-great-grandparents),
generation 2 has 6 people, generation 3 has 12 people, generation 4 has 18 people, and
generation 5 has 24 people. If this pattern continues, how many people would be in generation
6?
Question 11
In a directed acyclic graph (DAG) representing project dependencies, task A must be completed
before tasks B and C. Tasks B and C must be completed before task D. Task D must be completed
before tasks E and F. If each task takes 2 days, what is the minimum project duration?
Question 12
A social network has 100 users. Each user is friends with exactly 6 others. If we select a random
user, what is the probability that two of their friends are also friends with each other?
Question 13
In a family tree, X is the great-grandfather of Y. The path from X to Y passes through exactly 2
intermediate generations. If X has 3 children, each of his children has 2 children, and each of his
grandchildren has 4 children, how many great-grandchildren does X have?
Question 14
A tree diagram shows all possible outcomes of flipping 4 coins. If we want to find the probability
that exactly 2 coins show heads, how many branches lead to this outcome?
Question 15
In a company hierarchy represented as a tree, the CEO is at the root. Each level has exactly twice
as many employees as the level above it. If there are 6 levels and 63 employees total, how many
employees report directly to the CEO?
Question 16
A family genogram shows that A and B are married, C and D are married, and E and F are married.
A and B have 2 children (G and H), C and D have 3 children (I, J, K), and E and F have 1 child (L). If G
marries I, how many in-laws does G have?
Question 17
In a tournament graph with 6 teams, each team plays every other team exactly once. If team
Alpha has won 4 games, team Beta has won 3 games, and team Gamma has won 2 games, what is
the minimum number of games that team Delta could have won?
Question 18
A binary search tree contains the numbers 1, 3, 5, 7, 9, 11, 13, 15. If the tree is balanced and 8 is
the root, what is the maximum number of comparisons needed to find any element?
Question 19
In a family tree, P is the ancestor of Q, R, S, T, U, V, W, X, Y, and Z. If P has 2 children, each of whom
has 2 children, and each of those has 3 children, how many generations are represented in this
tree?
Question 20
A graph represents friendships in a school. If every student has exactly 5 friends, and there are 30
students total, how many friendship connections are there in the school?
Question 21
In a decision tree for a medical diagnosis, each internal node represents a test with 3 possible
outcomes, and each leaf represents a diagnosis. If there are 81 possible diagnoses, what is the
minimum height of the decision tree?
Question 22
A family tree shows 4 generations. The first generation has 1 person, the second has 2 people,
the third has 5 people, and the fourth has 10 people. If this follows a pattern where each
generation has n more people than the previous generation, what is the value of n?
Question 23
In a directed graph representing a food web, each arrow points from prey to predator. If species
A is eaten by species B, C, and D, and species B is eaten by species E and F, how many paths of
length 2 start from species A?
Question 24
A company's organizational chart is a tree with 7 levels. The CEO is at level 1, and each person at
levels 1-6 has exactly 3 direct reports. How many people are at level 7?
Question 25
In a social network graph, the degree of each vertex represents the number of friends a person
has. If the sum of all degrees is 240 and there are 40 people in the network, what is the average
number of friends per person?
Question 26
A family tree represents 5 generations of a family. If the probability that any person in the tree is
male is 0.6, and there are 31 people in the tree, what is the expected number of females?
Question 27
In a tournament bracket with 32 teams, each game eliminates exactly one team. How many
games are needed to determine the winner?
Question 28
A tree diagram shows all possible routes from city A to city F, passing through intermediate cities.
If there are 3 routes from A to B, 2 routes from B to C, 4 routes from C to D, 2 routes from D to E,
and 3 routes from E to F, how many different routes are there from A to F?
Question 29
In a family tree, if every married couple has exactly 2 children, and the tree has 4 generations
with 15 people total, how many married couples are there?
Question 30
A bipartite graph represents students and courses, where an edge exists if a student is enrolled
in a course. If there are 20 students and 15 courses, and each student is enrolled in exactly 3
courses while each course has exactly 4 students, how many edges are in the graph?
Topic 2: Binary (CAT Level - Questions 31-60)
Question 31
A number in binary 1101011 is multiplied by 101 (binary). What is the result in decimal?
Question 32
If the binary number 11011001 is shifted left by 3 positions, what is the resulting decimal value?
Question 33
A computer system uses 8-bit binary numbers. If the system represents signed integers using
two's complement, what is the range of integers that can be represented?
Question 34
Two binary numbers 10110110 and 01101101 are added. If there's a carry-out from the most
significant bit, what is the sum in binary?
Question 35
A binary tree has nodes labeled with binary numbers. If the root is 1000 (binary), the left child is
formed by appending 0, and the right child by appending 1, what is the decimal value of the
rightmost node at level 4?
Question 36
In a binary representation, if flipping any single bit in the number 11010110 results in a number
divisible by 3, what is the decimal value of the original number?
Question 37
A binary counter starts at 0000 and increments by 1 each second. After how many seconds will all
4 bits be 1 for the first time?
Question 38
Two binary numbers have a XOR result of 1011001. If one of the numbers is 1101010, what is the
other number in decimal?
Question 39
A binary number has exactly 5 ones and 3 zeros. If the number is greater than 11000000 (binary),
what is the smallest such number in decimal?
Question 40
In binary arithmetic, if 101101 ÷ 11 = quotient + remainder, what is the quotient in decimal?
Question 41
A 6-bit binary number is chosen randomly. What is the probability that the number has exactly 3
ones?
Question 42
If the binary number 1111011 is converted to octal, what is the result?
Question 43
A binary search algorithm is used on a sorted array of 128 elements. What is the maximum
number of comparisons needed to find any element?
Question 44
Two binary numbers when multiplied give 1110110110. If one number is 1011, what is the other
number in binary?
Question 45
In a binary number system, if the number 357 (decimal) is represented, how many 1s are there in
its binary representation?
Question 46
A binary tree has all nodes at odd levels containing 1 and all nodes at even levels containing 0. If
the tree has 4 levels and is complete, what is the sum of all node values?
Question 47
If 101011 (binary) is subtracted from 1110001 (binary), what is the result in hexadecimal?
Question 48
A binary number has the property that when read forwards and backwards, it represents the
same decimal value. If the number has 6 bits, what is the smallest such number in decimal?
Question 49
In binary representation, if a number ends with 101, what is the remainder when the number is
divided by 8?
Question 50
A binary string of length 8 contains exactly 4 ones. How many such strings are there?
Question 51
If the binary number 11011101 is right-shifted by 2 positions (arithmetic shift), what is the result
in decimal?
Question 52
Two binary numbers have a bitwise AND result of 1001100. If one number is 1101110, what are
the possible values for the other number?
Question 53
A binary number when squared gives 10001000001 (binary). What is the original number in
decimal?
Question 54
In a binary tree representing a binary number, each left child represents 0 and each right child
represents 1. If a path from root to leaf represents 101101, what is the decimal value?
Question 55
A 4-bit binary counter counts from 0000 to 1111 and then repeats. If it starts at 0000, what will
be the state after 25 clock pulses?
Question 56
If the binary number 1010111 is converted to base 4, what is the result?
Question 57
A binary number has exactly 6 bits. If exactly 3 bits are 1 and they are all adjacent, how many such
numbers are possible?
Question 58
In binary division, if 1110100 ÷ 101 = quotient, what is the quotient in decimal?
Question 59
A binary number system uses Gray code where adjacent numbers differ by exactly one bit. If the
4-bit Gray code sequence starts with 0000, what is the 10th number in the sequence?
Question 60
If the binary representation of a number has alternating 1s and 0s, starting with 1, and has 8 bits
total, what is the number in decimal?
Topic 3: Recursion (Moderate Level - Questions 61-90)
Question 61
Write a recursive function to calculate the nth Fibonacci number. What is the value of F(8)?
Question 62
A recursive function calculates the factorial of n. If f(5) = 120, what is f(6)?
Question 63
The Tower of Hanoi problem with n disks requires 2^n - 1 moves. How many moves are needed
for 4 disks?
Question 64
A recursive function calculates the sum of digits of a number. If the number is 12345, what is the
sum?
Question 65
In a recursive binary search, if the array has 16 elements and we're searching for an element at
index 10, what is the maximum number of recursive calls?
Question 66
A recursive function calculates the greatest common divisor (GCD) of two numbers using Euclid's
algorithm. What is GCD(48, 18)?
Question 67
The recursive relation T(n) = T(n-1) + T(n-2) with T(1) = 1 and T(2) = 1 defines a sequence. What is
T(6)?
Question 68
A recursive function counts the number of nodes in a binary tree. If the tree has 3 levels and is
complete, how many nodes are there?
Question 69
In a recursive function to reverse a string, if the input is "HELLO", what is the output?
Question 70
A recursive function calculates the power of a number. If base = 3 and exponent = 4, what is 3^4?
Question 71
The recursive relation a(n) = 2*a(n-1) + 1 with a(1) = 1 defines a sequence. What is a(5)?
Question 72
A recursive function finds the maximum element in an array. If the array is [3, 7, 2, 9, 1, 5], what is
the maximum?
Question 73
In a recursive function to check if a number is prime, what is the base case for the number 17?
Question 74
A recursive function calculates the sum of an arithmetic sequence. If the first term is 2, common
difference is 3, and there are 5 terms, what is the sum?
Question 75
The recursive relation T(n) = T(n/2) + 1 with T(1) = 1 represents the time complexity of binary
search. What is T(8)?
Question 76
A recursive function converts a decimal number to binary. If the input is 13, what is the binary
representation?
Question 77
In a recursive function to calculate combinations C(n,r), what is C(5,2)?
Question 78
A recursive function finds the length of a linked list. If the list has elements [1, 2, 3, 4, 5], what is
the length?
Question 79
The recursive relation f(n) = f(n-1) + f(n-3) with f(1) = 1, f(2) = 2, f(3) = 3 defines a sequence. What
is f(6)?
Question 80
A recursive function calculates the product of all elements in an array. If the array is [2, 3, 4], what
is the product?
Question 81
In a recursive function to find the nth triangular number, what is the 6th triangular number?
Question 82
A recursive function checks if a string is a palindrome. Is "RACECAR" a palindrome?
Question 83
The recursive relation T(n) = 2*T(n-1) with T(1) = 3 defines a sequence. What is T(4)?
Question 84
A recursive function calculates the sum of squares of first n natural numbers. What is the sum for
n = 4?
Question 85
In a recursive function to merge two sorted arrays, if array1 = [1, 3, 5] and array2 = [2, 4, 6], what
is the merged array?
Question 86
A recursive function finds the minimum element in an array. If the array is [8, 3, 5, 4, 7, 6], what is
the minimum?
Question 87
The recursive relation a(n) = 3a(n-1) - 2a(n-2) with a(1) = 1, a(2) = 2 defines a sequence. What is
a(4)?
Question 88
A recursive function calculates the sum of even numbers from 1 to n. What is the sum for n = 10?
Question 89
In a recursive function to calculate the depth of a binary tree, if the tree has nodes arranged as 1
at root, 2 and 3 as children of 1, and 4 and 5 as children of 2, what is the depth?
Question 90
A recursive function generates all permutations of a string. How many permutations are there
for the string "ABC"?
Topic 4: Dynamic Programming (Moderate Level - Questions 91-120)
Question 91
Using dynamic programming to solve the Fibonacci sequence, what is the time complexity
compared to the naive recursive approach?
Question 92
In the 0/1 Knapsack problem, if the knapsack capacity is 10 and items have weights [2, 3, 4, 5] and
values [3, 4, 5, 6], what is the maximum value?
Question 93
For the coin change problem, if coins are [1, 3, 4] and the target amount is 6, what is the minimum
number of coins needed?
Question 94
In the Longest Common Subsequence (LCS) problem, if string1 = "ABCD" and string2 = "ACBD",
what is the length of LCS?
Question 95
Using dynamic programming for the climbing stairs problem, if there are 5 stairs and you can
climb 1 or 2 stairs at a time, how many ways are there to reach the top?
Question 96
In the edit distance problem, what is the minimum number of operations to convert "CAT" to
"DOG"?
Question 97
For the maximum subarray problem using Kadane's algorithm, if the array is [-2, 1, -3, 4, -1, 2, 1, -5,
4], what is the maximum sum?
Question 98
In the coin change problem (counting ways), if coins are [1, 2, 3] and the target is 4, how many
ways are there to make the change?
Question 99
Using dynamic programming for the house robber problem, if houses have values [2, 7, 9, 3, 1],
what is the maximum amount that can be robbed?
Question 100
In the longest increasing subsequence problem, if the array is [10, 9, 2, 5, 3, 7, 101, 18], what is
the length of the longest increasing subsequence?
Question 101
For the matrix chain multiplication problem, if matrices have dimensions 2×3, 3×4, 4×5, what is
the minimum number of scalar multiplications?
Question 102
In the palindrome partitioning problem, what is the minimum number of cuts needed to partition
"ABCCBA" into palindromes?
Question 103
Using dynamic programming for the subset sum problem, if the set is {3, 34, 4, 12, 5, 2} and target
sum is 9, is it possible to find a subset with this sum?
Question 104
In the longest palindromic subsequence problem, if the string is "BBABCBCAB", what is the
length of the longest palindromic subsequence?
Question 105
For the minimum path sum problem in a grid, if the grid is [[1,3,1],[1,5,1],[4,2,1]], what is the
minimum path sum from top-left to bottom-right?
Question 106
In the word break problem, if the string is "CATSANDDOG" and dictionary contains ["CAT",
"CATS", "AND", "SAND", "DOG"], can the string be segmented?
Question 107
Using dynamic programming for the unique paths problem, if the grid is 3×3, how many unique
paths are there from top-left to bottom-right?
Question 108
In the jump game problem, if the array is [2, 3, 1, 1, 4], is it possible to reach the last index?
Question 109
For the decode ways problem, if the string is "123", how many ways can it be decoded (A=1, B=2,
..., Z=26)?
Question 110
In the best time to buy and sell stock problem, if prices are [7, 1, 5, 3, 6, 4], what is the maximum
profit?
Question 111
Using dynamic programming for the egg dropping problem, if there are 2 eggs and 10 floors,
what is the minimum number of trials needed in the worst case?
Question 112
In the interleaving string problem, if s1 = "aab", s2 = "axy", s3 = "aaxaby", is s3 an interleaving of
s1 and s2?
Question 113
For the regular expression matching problem, does the string "aa" match the pattern "a*"?
Question 114
In the wildcard matching problem, does the string "adceb" match the pattern "ab*"?
Question 115
Using dynamic programming for the partition equal subset sum problem, if the array is [1, 5, 11,
5], can it be partitioned into two subsets with equal sum?
Question 116
In the distinct subsequences problem, how many distinct subsequences of "rabbbit" equal
"rabbit"?
Question 117
For the scramble string problem, is "great" a scrambled string of "rgeat"?
Question 118
In the burst balloons problem, if balloons have values [3, 1, 5, 8], what is the maximum coins you
can collect?
Question 119
Using dynamic programming for the Russian doll envelopes problem, if envelopes have
dimensions [(5,4), (6,4), (6,7), (2,3)], what is the maximum number of envelopes that can be
nested?
Question 120
In the minimum cost for tickets problem, if days are [1, 4, 6, 7, 8, 20] and costs are [2, 7, 15] for 1-
day, 7-day, and 30-day passes, what is the minimum cost?
Topic 5: Lists, Sublists, and Arrays (Moderate Level - Questions 121-150)
Question 121
Given an array [1, 2, 3, 4, 5], how many subarrays are there in total?
Question 122
Find the maximum sum of any subarray in [−2, 1, −3, 4, −1, 2, 1, −5, 4].
Question 123
In the array [3, 7, 2, 9, 1], what is the second largest element?
Question 124
How many sublists of length 3 can be formed from the list [A, B, C, D, E]?
Question 125
Given two sorted arrays [1, 3, 5] and [2, 4, 6], merge them into a single sorted array.
Question 126
Find the missing number in the array [1, 2, 4, 5, 6] where numbers should be from 1 to 6.
Question 127
In the array [1, 2, 2, 3, 3, 3, 4], find the element that appears most frequently.
Question 128
Rotate the array [1, 2, 3, 4, 5] to the right by 2 positions.
Question 129
Find the intersection of two arrays [1, 2, 2, 1] and [2, 2].
Question 130
In the array [4, 3, 2, 7, 8, 2, 3, 1], find all elements that appear twice.
Question 131
Given an array [1, 2, 3, 4, 5], find all possible pairs that sum to 7.
Question 132
Remove duplicates from the sorted array [1, 1, 2, 2, 3, 4, 4, 5].
Question 133
Find the kth largest element in the array [3, 2, 1, 5, 6, 4] where k = 2.
Question 134
In the array [1, 3, 5, 7, 9], perform binary search to find the index of element 5.
Question 135
Given an array [2, 7, 11, 15] and target 9, find two numbers that add up to the target.
Question 136
Find the longest subarray with equal number of 0s and 1s in [0, 1, 0, 0, 1, 1, 0].
Question 137
In the array [1, 2, 3, 4, 5], find the number of inversions (pairs where i < j but arr[i] > arr[j]).
Question 138
Given an array [1, 2, 3, 4, 5, 6], partition it into two sublists with equal sum.
Question 139
Find the peak element in the array [1, 2, 3, 1] (element greater than its neighbors).
Question 140
In the array [4, 5, 6, 7, 0, 1, 2], find the minimum element (rotated sorted array).
Question 141
Given an array [1, 2, 3, 4, 5], generate all possible permutations.
Question 142
Find the majority element in the array [3, 2, 3] (appears more than n/2 times).
Question 143
In the array [1, 2, 3, 4, 5], find all subarrays that sum to 5.
Question 144
Given two arrays [1, 2, 3] and [4, 5, 6], find their Cartesian product.
Question 145
Find the longest increasing subarray in [1, 3, 2, 4, 5, 2, 3, 4, 5].
Question 146
In the array [1, 4, 2, 3], sort it using bubble sort. How many swaps are needed?
Question 147
Given an array [5, 1, 3, 9, 8], find the range (difference between max and min).
Question 148
Find all triplets in the array [1, 2, 3, 4, 5] that sum to 9.
Question 149
In the array [1, 2, 3, 4, 5], implement selection sort and find the array after 2 iterations.
Question 150
Given an array [3, 1, 4, 1, 5, 9, 2, 6], find the median element.
Answer Key
Topic 1: Graphs and Family Trees (1-30)
1. 15 people, D and G are cousins
2. 27 managers
3. 2 teams
4. 37 people present
5. 18 edges
6. Cousins
7. Height = 4
8. 63 managers
9. 11 km saved
10. 30 people
11. 8 days
12. 1/11 probability
13. 24 great-grandchildren
14. 6 branches
15. 1 employee
16. 5 in-laws
17. 0 games minimum
18. 4 comparisons
19. 4 generations
20. 75 connections
21. Height = 4
22. n = 3
23. 6 paths
24. 729 people
25. 6 friends average
26. 12.4 females expected
27. 31 games
28. 144 routes
29. 7 couples
30. 60 edges
Topic 2: Binary (31-60)
31. 3575 decimal
32. 1752 decimal
33. -128 to 127
34. 100100011 binary
35. 143 decimal
36. 214 decimal
37. 15 seconds
38. 105 decimal
39. 199 decimal
40. 15 decimal
41. 20/64 = 5/16
42. 173 octal
43. 7 comparisons
44. 1010110 binary
45. 6 ones
46. 8
47. 44 hexadecimal
48. 33 decimal
49. 5 remainder
50. 70 strings
51. 55 decimal
52. Multiple possible values
53. 17 decimal
54. 45 decimal
55. 1001 binary
56. 1213 base 4
57. 4 numbers
58. 28 decimal
59. 1111 Gray code
60. 170 decimal
Topic 3: Recursion (61-90)
61. F(8) = 21
62. f(6) = 720
63. 15 moves
64. 15
65. 4 calls
66. GCD = 6
67. T(6) = 8
68. 7 nodes
69. "OLLEH"
70. 81
71. a(5) = 31
72. 9
73. Check divisibility up to √17
74. 50
75. T(8) = 4
76. 1101
77. 10
78. 5
79. f(6) = 9
80. 24
81. 21
82. Yes
83. T(4) = 24
84. 30
85. [1, 2, 3, 4, 5, 6]
86. 3
87. a(4) = 4
88. 30
89. 3
90. 6
Topic 4: Dynamic Programming (91-120)
91. O(n) vs O(2^n)
92. 10
93. 2 coins
94. 3
95. 8 ways
96. 3 operations
97. 6
98. 4 ways
99. 12
100. 4
101. 60
102. 1 cut
103. Yes
104. 7
105. 7
106. Yes
107. 6
108. Yes
109. 3
110. 5
111. 14
112. Yes
113. Yes
114. Yes
115. Yes
116. 3
117. Yes
118. 167
119. 3
120. 11
Topic 5: Lists, Sublists, and Arrays (121-150)
121. 15 subarrays
122. 6
123. 7
124. 10
125. [1, 2, 3, 4, 5, 6]
126. 3
127. 3
128. [4, 5, 1, 2, 3]
129. [2, 2]
130. [2, 3]
131. [(2,5), (3,4)]
132. [1, 2, 3, 4, 5]
133. 5
134. Index 2
135. [2, 7]
136. Length 6
137. 0 inversions
138. [1, 2, 3] and [4, 5, 6] (not possible with equal sum