Adobe MTS-1

Anonymous User
1673
Apr 29, 2022

Round 1-

Q1. Store tree in any DS such that you can query its left and right child in O(1) operation?
1

2 3

4 5 6

Q2. First Non repeating character in a String?
I/p-aapple
o/p- l

Q3. Maximum Number of Jump possible
1 1 0
1 1 2
1 0 0
=>6
(0,0) (0,1) (1,1) (1,2) (1,0) (2,0) (2,1)
Here
a. each element in the matrix signifies that the exact unit of cells you have to jump
b. Each cell must be visited only once.
c. The direction of motion is up,down,left & right.

Round 2-

(Puzzle)A takes 1 minute to cross the bridge.
B takes 2 minutes to cross the bridge.
C takes 5 minutes to cross the bridge.
D takes 8 minutes to cross the bridge.
There is only one torch with them and the bridge cannot be crossed without the torch.
There cannot be more than two persons on the bridge at any time, and when two people cross the bridge together, they must move at the slower person’s pace.
Minimum time such that every individual crosses the bridge in minimum time.

If the tree is symmetric or not?/symmetric binary tree

1
/
2 2
/ \ /
3 4 4 3

But the following is not:
1
/
2 2

3 3

Implement a stack which will support following operations in O(1) time complexity?
push() which adds an element to the top of stack.
pop() which removes an element from top of stack.
findMiddle() which will return middle element of the stack.
deleteMiddle() which will delete the middle element.
Verdict - Rejected

Comments (2)