Tip 1: Must do Previously asked Interviews and Online Test Questions.
Tip 2: Must have good knowledge of DSA
Tip 3: Do at least two good projects; you must know everything.
Tip 1: Have at least two good projects explained in short with all essential points covered.
Tip 2: Please mention every skill.
Tip 3: Focus on skills, projects, and experiences more.
This round was to test your DSA skills and be well prepared with previously asked questions as they are repeated.


Given a grid of size m * n, let us assume you are starting at (1, 1) and your goal is to reach (m, n). At any instance, if you are on (x, y), you can either go to (x, y + 1) or (x + 1, y).
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and space are marked as 1 and 0 respectively in the grid.
Start traversing through the given ‘A’ 2D matrix row-wise and fill in the values.
For the first row and the first column, set the value to 1 if an obstacle is not found.
If an obstacle is found for the first row and first column, then start filling 0 till the last index in that particular row or column.
Now start traversing from the second row and column (e.g., A[ 1 ][ 1 ]).
If an obstacle is found, set 0 at a particular Grid (e.g., A[ i ][ j ] ); otherwise, set sum of upper and left values at A[ i ][ j ].
Return the last value of the 2D matrix.



Given an array, print the Next Greater Element (NGE) for every element.
Example:
Input: arr[] = [ 4, 5, 2, 25 ]
Output: 4 –> 5
5 –> 25
2 –> 25
25 –> -1
Explanation: except 25 every element has an element greater than them present on the right side
This is the same as the above method, but the elements are pushed and popped only once into the stack. The array is changed in place. The array elements are pushed into the stack until it finds the most significant element on the right of the array. In other words, the elements are popped from the stack when the top of the stack value is smaller in the current array element.
The stack is not empty once all the elements are processed in the array. The left-out elements in the stack don’t encounter any most significant element. So, pop the element from the stack and change its index value to -1 in the array.
The interview started by asking about my past projects and the tech stack I have worked on. Whatever was written in the resume was asked.



Given a string consisting of opening and closing parenthesis, find the length of the longest valid parenthesis substring.
1) Create an array longest of length n (size of the input
string) initialized to zero.
The array will store the length of the longest valid
substring ending at that index.
2) Initialize the result as 0.
3) Iterate through the string from the second character
a) If the character is '(' set longest[i]=0 as no
valid sub-string will end with '('.
b) Else
i) if s[i-1] = '('
set longest[i] = longest[i-2] + 2
ii) else
set longest[i] = longest[i-1] + 2 +
longest[i-longest[i-1]-2]
4) In each iteration, update the result as the maximum of
result and longest[i]
5) Return result.



In a party of N people, only one person is known to everyone. Such a person may be present at the party, if yes, (s)he doesn’t know anyone at the party. We can only ask questions like “does A know B? “. Find the stranger (celebrity) in the minimum number of questions.
We can describe the problem input as an array of numbers/characters representing persons in the party. We also have a hypothetical function HaveAcquaintance(A, B) which returns true if A knows B, and false otherwise. How can we solve the problem?
Create a stack and push all the IDs in the stack.
Run a loop while there are more than one element in the stack.
Pop the top two elements from the stack (represent them as A and B).
If A knows B, A can’t be a celebrity and push B into the stack. Otherwise, B can’t be a celebrity push A in the stack if A doesn't know B.
Could you assign the remaining element in the stack as the celebrity?
Run a loop from 0 to n-1 and find the count of persons who know the celebrity and the number of people whom the celebrity knows.
If the count of persons who know the celebrity is n-1 and the count of people whom the celebrity knows is 0, then return the ID of the celebrity else, return -1.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?