DEV Community

Cover image for Amazon SDE 1 Interview Experience: I received the acceptance letter!
OA VO Interview
OA VO Interview

Posted on

Amazon SDE 1 Interview Experience: I received the acceptance letter!

Timeline

January: Job application
February: Initial interview
Mid-May: Interview invitation
June: Final interview

The Interview Process

Round 1: LP+Coding
BQ 1: How do you adjust your work strategy and manage tasks when facing time pressure?

BQ 2: How do you adapt and effectively execute new tasks or goals during work transitions or changes?

2 LP questions, followed by several follow-up questions. For the second BQ, the interviewer encouraged me to choose a story that better aligns with the LP. Here, I combined my past project experience from school with the STAR method to answer. The interviewer was very satisfied with my second answer and kept nodding in agreement.

Q: Similar to designing an iterator to retrieve the next smallest number from K arrays.

Here, I used object-oriented design (OOD) and a min-heap. We discussed test cases (TC) and scenarios (SC). The initial implementation went smoothly, but I was later asked about the scalability of this solution for more arrays and how to perform arbitrary operations on K arrays. I’m not sure if my answer was correct; I suspect there may be multiple acceptable solutions. I also asked the interviewer a few questions afterward, and the conversation went smoothly.

Round 2:Coding
Q1: Merge all intervals that may overlap and return the merged result.

The key to this problem lies in sorting the preprocessing. If the intervals are sorted by their starting points, adjacent intervals can be merged in order. For example, after sorting, you only need to compare the endpoint of the current interval with the starting point of the next interval to determine whether they need to be merged. The endpoint of the merged interval is the maximum value of the two, and the starting point is the starting point of the current interval. Here, I used a greedy algorithm and solved it smoothly.

Q2: Determine whether the sum of the path from the root to the leaf of a binary tree is equal to the target value.

The DFS solution works fine. First, recursively traverse the tree, accumulate the path sum, and then determine whether it meets the target. When the current path does not meet the rules, perform backtracking.

Round 3:Coding
Q: Find the number of islands in a 2D array

The algorithm checks each position in the two-dimensional grid one by one to ensure that every land position is taken into account. By using the loops for i in range(len(grid)) and for j in range(len(grid[0])), all positions are traversed to ensure that no possible islands are missed.
When an unvisited land position is encountered, DFS is initiated to mark all adjacent land positions (adjacent in all four directions) as visited (changed to ‘0’). Once marked as visited, other land positions on the same island will not be counted again.

The DFS recursive traversal continues to expand until all adjacent land areas have been visited and marked, which exactly covers the entire range of the island. DFS ensures that each time it is initiated, it marks an entire connected land area, which meets the definition of an island in the problem statement.

Each time DFS is initiated, it means a new island has been found, so the counter is incremented by one. Through this mechanism, the final value of the counter is exactly the number of islands, meeting the problem requirements.

Follow-up: If you could turn a body of water into land, how would you operate to obtain the largest island?

This follow-up question was a bit tricky for me, but after discussing methods with the interviewer, we found the correct solution. The interviewer approved all my answers and discussed technical details and software engineering practices.

## Interview Summary & Suggestions
I received the offer letter on June 10. I recommend that everyone thoroughly research all Amazon LPs until you can recite them off the top of your head, and prepare two different STAR cases for each LP. It is best to use data in your cases to prove that your logical thinking is clear. You can also show your enthusiasm for the company and its employees. The interview process is very energy-consuming, so please be prepared physically and mentally. If you encounter any difficulties or have any questions, please feel free to come here to find solutions.

Top comments (0)