Tip 1 : Be very clear with the fundamentals, when we use a particular data structure, what trade-offs are there for commonly used data structures?
Tip 2 : Do practice on a variety of topics and try to give a good number of contests that will help you in solving problems in fixed time.
Tip 1 : Make sure you know everything you put on the resume.
Tip 2 : Have some projects, so you can discuss things with the interviewer.
There were 2 coding problems.
1 medium, 1 Hard


The ant initially faces toward the east side. Every time an ant moves from a block, it inverts it, i.e., changes 0 to 1 and 1 to 0.
If the ant exits the matrix just return -1,-1.
If ‘N’ = 2
mat[2][2] = {{1, 1},
{0, 0}}
startingRow = 0 , startingColumn = 0
moves = 1
The ant is initially facing the east side, it will take a right turn and move 1 stop in the south.
The output will be 1 0.



String S = ababa
Index i = 1
len = 3
The answer to the above test case is 2 since there are two substrings that start at index 1 (1 - based indexing) - “aba”, “ababa”. Both these have a length of at least 3.
The round started with 2 coding Questions and at last, we had a discussion about basic OOPs principles and there was SQL vs NoSQL discussion.



‘N’ = 4, ‘K’ = 2
‘ARR’ = [1, 1, 2, 3]
There are ‘3’ subarrays with ‘2’ distinct elements, which are as follows: [1, 2], [2, 3], [1, 1, 2].
Thus, you should return ‘3’ as the answer.



1. Each array element should belong to exactly one of the subsets.
2. Subsets need not always be contiguous.
For example, for the array : [1, 2, 3], some of the possible divisions are
a) {1,2} and {3}
b) {1,3} and {2}.
3. Subset-sum is the sum of all the elements in that subset.
Input: 'n' = 5, 'arr' = [3, 1, 5, 2, 8].
Ouput: 1
Explanation: We can partition the given array into {3, 1, 5} and {2, 8}.
This will give us the minimum possible absolute difference i.e. (10 - 9 = 1).
The round started with 2 coding Questions.



You may assume that given ‘X’ and ‘Y’ definitely exist in the given binary tree.
For the given binary tree

LCA of ‘X’ and ‘Y’ is highlighted in yellow colour.



The width of each bar is the same and is equal to 1.
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].
Output: 10
Explanation: Refer to the image for better comprehension:

You don't need to print anything. It has already been taken care of. Just implement the given function.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?