Kanbay Previous Years Solved Sample Placement Papers
-
If he is averse recommending my name, he should not hesitate to admit it.
a) about
b) for
c) to
d) against
Ans: Option C
Solution:
The correct preposition is "averse to." The phrase should read: "averse to recommending my name." -
EPITOMIZE
a) disappoint
b) distend
c) exemplify
d) generate
Ans: Option C
Solution:
"Epitomize" means to represent or exemplify something perfectly. -
According to pirate lore, a terrible would follow whoever opened the treasure chest.
a) precursor
b) precession
c) rendition
d) insurgence
e) malediction
Ans: Option E
Solution:
"Malediction" means a curse, fitting the context of the pirate lore. -
Let A be a square matrix of size n x n. Consider the following program. What is the expected output?
C = 100
for i = 1 to n do
for j = 1 to n do
{
Temp = A[i][j] + C
A[i][j] = A[j][i]
A[j][i] = Temp - C
}
for i = 1 to n do
for j = 1 to n do
Output(A[i][j]);
a) Transpose of matrix A
b) Adding 100 to the upper diagonal elements and subtracting 100 from diagonal elements of A
c) The matrix A itself
d) None of these
Ans: Option A
Solution:
The program effectively swaps elements \( A[i][j] \) and \( A[j][i] \) without altering their values. This results in the transpose of matrix \( A \). -
Consider a hash table with 9 slots. The hash function is h(k) = k mod 9. The collisions are resolved by chaining. The following 9 keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17, 10. The maximum, minimum, and average chain lengths in the hash table, respectively, are:
1) 3, 0, and 2
2) 4, 0, 1
3) 3, 0, and 1
4) 3, 3, and 3
Ans: Option 3
Solution:
- Keys and hash slots: \( 5 \mod 9 = 5 \), \( 28 \mod 9 = 1 \), \( 19 \mod 9 = 1 \), \( 15 \mod 9 = 6 \), \( 20 \mod 9 = 2 \), \( 33 \mod 9 = 6 \), \( 12 \mod 9 = 3 \), \( 17 \mod 9 = 8 \), \( 10 \mod 9 = 1 \). - Resulting chain lengths: Slot 1: [28, 19, 10] — length 3 (max). Slot 2: [20] — length 1. Slot 3: [12] — length 1. Slot 5: [5] — length 1. Slot 6: [15, 33] — length 2. Slot 8: [17] — length 1. Slot 0: [Empty] — length 0 (min). - Maximum chain length = 3. - Minimum chain length = 0. - Average chain length = \( \frac{9}{9} = 1 \).