Tip 1 : Practice as many questions as u can
Tip 2 : Focus on DSA
Tip 1 : Add some good projects
Tip 2 : Don't add copied Projects
90 minutes round Seven debugging questions, two coding questions, Behavioural questions



traverse the tree and find maximum sum from leaf to root in left subtree, find maximum sum from leaf to root in right subtree of X, add the above two calculated values then return the maximum value




Here, for ‘X ’= 7, the output will be 1 3 7.
The interviewer directly stated with coding question. He asked me 2 coding questions and he was aspecting the optimal working code of both.



Input: Consider the binary tree A as shown in the figure:

Output: [10, 5, 3, 7, 18, 25, 20]
Explanation: As shown in the figure
The nodes on the left boundary are [10, 5, 3]
The nodes on the right boundary are [10, 20, 25]
The leaf nodes are [3, 7, 18, 25].
Please note that nodes 3 and 25 appear in two places but are considered once.
I solved it by making 3 function, one for left, one for right and one for bottom.



I solved this question by 2 pointers by taking left and right pointers and moving the right point untill it was possible to switch the zeroes else move the left pointer
The interviewer started with tell me about your self. Then he started asking about my previous intenship projects and some Common Hr questions like why you want to join amazon. This went for almost 30 minutes then he asked me to solve a coding question similar to Rotten Orange question.



1. The grid has 0-based indexing.
2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
I solved this question by BFS.

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?