Tip 1: Rehearse former interview questions from online platforms.
Tip 2: Try to solve at least one problem daily.
Tip 3: Be consistent.
Tip 4: Be confident during the interview.
Tip 5: Don't underestimate the behavior-related questions for Amazon. Prepare at least one story for each of their leadership principles.
Tip 1: One Page Resume
Tip 2: Precise and to the point
I received the OA link in my email four days ago and blocked my calendar for two hours on February 7th. The interview was very easy and straightforward. It primarily consisted of three sections:



Two strings are said to be anagram if they contain the same characters, irrespective of the order of the characters.
If 'STR1' = “listen” and 'STR2' = “silent” then the output will be 1.
Both the strings contain the same set of characters.
I applied a brute force solution, and all the test cases passed.
It was purely a coding round. The interviewer was an SDE-2. I was supposed to solve two questions in 50 minutes. The overall level of the interview was easy to medium.



The given linked list is 1 -> 2 -> 3 -> 4-> NULL. Then the reverse linked list is 4 -> 3 -> 2 -> 1 -> NULL and the head of the reversed linked list will be 4.
Can you solve this problem in O(N) time and O(1) space complexity?
Initially, I proposed the approach of storing the nodes in a stack and then popping them out and appending them one by one, which was taking O(N) time and space as well. The interviewer further asked me if there could be any optimization possible. Then I came up with the iterative approach to reverse the list in place, which takes O(1) space.



If the input tree is as depicted in the picture:
The Left View of the tree will be: 2 35 2
I proposed two solutions using recursion and level order traversal. The interviewer asked me to implement it using level order traversal, which I did using a queue. Then we discussed the overall time and space complexity.
This round was also conducted on the same day. For the first 5 minutes, we introduced ourselves and explained the work we are currently doing. Then he explained the pattern of the interview, for which I had to solve one hard question followed by a 15-minute discussion on LPs. The interviewer was very helpful and provided hints if absolutely needed. Overall, the experience was good.



Vertices are numbered through 0 to V-1.
I asked a lot of questions to clarify the problem statement. Then, I explained the approach to solve it using DFS. The interviewer asked about the time complexity and how to optimize the approach. After looking in detail, I found that we can store intermediate results somewhere instead of calculating them again. I then modified the approach based on DP + DFS and discussed the time complexity.
This round was taken by one of their senior managers, but the pattern was similar to the last round. For the initial 15 minutes, we discussed the current work and went over my resume. He also asked two LP questions, which I answered based on the STAR pattern. For 40 minutes, he asked two medium problems to solve, and the last 5 minutes were reserved for any questions.



Input: 'n' = 3, 'm' = 4
'queries' = [[1, 1], [1, 2], [2, 3]]
Output: [1, 1, 2]
Explanation:
Initially, the grid was:
0 0 0 0
0 0 0 0
0 0 0 0
After query (1, 1):
0 0 0 0
0 1 0 0
0 0 0 0
There is one island having land (1, 1).
After query (1, 2):
0 0 0 0
0 1 1 0
0 0 0 0
Since (1, 1) and (1, 2) share a common edge, they form one island. So there is one island having lands (1, 1) and (1, 2).
After query (2, 3):
0 0 0 0
0 1 1 0
0 0 0 1
Now there are two islands, one having lands (1, 1) and (1, 2), and another having land (2, 3).
So the number of islands after each query is [1, 1, 2].
We discussed the approach first and then jumped to the solution. Approach:



I presented the naive approach, and then he told me to optimize it. I tried and suggested a few methods, but I was missing some edge cases. I kept thinking aloud but was unable to provide an optimized solution. They mentioned that we had passed 45 minutes of the interview, so let’s just discuss the high-level approach.
This was a bar raiser round. The interviewer that I got for this round was not quite friendly and helpful. They just focused on Leadership Principles, asking multiple LP questions and digging into detail on each of my answers with follow-up questions. A few questions I remember are:
I provided my answers using the STAR method and Amazon Leadership Principles.
Then, there was an LLD problem, and we discussed the high-level approach.
Design the Alexa charge connection and battery details to be rendered on different devices using both audio and textual displays.
I provided the solution following the SOLID principles; there were many back-and-forth discussions.

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?