Tip 1 : Prepare General dsa questions
Tip 2 : Revise dsa regularly
Tip 3 : Study core cse subject
Tip 1 : Mention recent job experience
Tip 2 : Mention good projects
Browser proctored. Only 2 coding questions were there. Timing was 60 minutes. Questions were of medium level


1- In one successful operation, Ninja can remove two positive integers, ‘A’ and ‘B’, and insert their sum, i.e., ‘A’ + ‘B’ into the position of either ‘A’ or ‘B’.
2- To insert sum in the position of element ‘A’, the condition 2 * ’A’ >= ‘B’ should be satisfied. Similarly, to insert the sum in the position of element ‘B’, the condition 2 * ‘B’ >= A should be satisfied.
3- We will insert the sum at one position, and the value at the other position should be changed to -1.
4- The resultant array should contain only 1 positive element.
A combination is different if they lead to a different position of the element that remains positive at the end of all successful operations for that combination.
Let ‘ARR’ be: {2, 1}
Combination 1:
Pick 2 and 1 and insert their sum at the position of 2: [3, -1]
Combination 2:
Pick 2 and 1 and insert their sum at the position of 1: [-1, 3]
So total combinations are 2.
1- I used 1 simple loop and no extra space.
2- In each step keep reducing number of elements by adding adjacent numbers
3 - return the number after last iteration



1. You are not required to print the output explicitly, it has already been taken care of. Just implement the function and return the minimum number of parentheses required to make a string valid.
It was an online interview on amazon chime platform. 2 coding questions were asked then some amazon leadership principal based questions;



1. A ‘path’ is a sequence of adjacent pair nodes with an edge between them in the binary tree.
2. The ‘path’ doesn’t need to pass through the root.
3. The ‘path sum’ is the sum of the node’s data in that path.
1. Use recursion
2. traverse entire tree
3. keep track of maximus sum of subtree visited so far
4. compare the maximum sum and update the ans variable



1. If the list is empty, the function immediately returns None because there is no middle node to find.
2. If the list has only one node, then the only node in the list is trivially the middle node, and the function returns that node.
Tip 1 : Use two pointer approach
Tip 2 : Update slow pointer by one step and fast pointer by two step
Tip 3 : when loop break slow pointer gives you middle point
It was another online coding interview and then followed by some behavioural questions.



Can you solve each query in O(logN) ?
1. use binary search
2. find the point from which array is rotated by using modified binary search
3. then find element using normal binary search either on low-rotated-point or rotated-point - high range



1. use either bfs or dfs
2. I traversed graph using dfs
3. when I reached a node which was already visited then returned true
3. return false if there is no cycle

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?