Amazon Interview Experience
My interview started with a short 2–3 minute introduction. After that, the interviewer asked me to open the Amazon IDE, which was shared through the Zoom link mentioned in the interview email.
He then asked me to choose a programming language, and I selected C++. He pasted the coding question into the IDE and first asked me to read and explain the problem in my own words.
I started by explaining the problem overview, constraints, and possible edge cases. After that, he asked me to come up with an approach.
I first explained the brute-force approach, including the algorithm and how it could be implemented. He then asked me about its time and space complexity and why the complexity was what I mentioned.
After that, he asked me to come up with a better approach. I came up with an approach using the lower-bound concept (similar to binary search) and explained the intuition, algorithm, and complexity.
I also mentioned that the solution could potentially be optimized further and explained another approach with its intuition. However, the interviewer wanted me to proceed with the binary-search-based approach, so we moved forward with that.
Binary Search Discussion
Before writing the code, he asked me what type of binary search I was using. I explained that it was based on the lower-bound concept.
He then gave me an example and asked me to perform a complete dry run, writing down every iteration.
This was probably the most challenging part of the interview.
The interviewer went very deep into the dry run. At almost every step, he asked questions like:
The dry run itself took around 20–30 minutes, and the level of questioning made it quite intense and uncomfortable at times because he wanted to understand every single decision in the algorithm.
We performed detailed dry runs for two coding questions.
After the dry runs, he asked me to implement the binary-search-based solution in the Amazon IDE. I wrote the solution in C++.
Leadership / Behavioral Round
After the coding round, the interviewer moved to leadership-related questions. He asked several behavioral questions based on situations involving teamwork, deadlines, feedback, and influencing others.
The questions were:
Tell me about a time when you had to deliver a project under a tight deadline. What sacrifices did you have to make to meet the deadline?
Give me a time when, while working on team goals, your goals were out of alignment with other teams.
Tell me about a time when you received critical/tough feedback from a senior. What was the feedback, and what did you do about it?
Tell me about a time when, while working in a hackathon team, you had to influence others who had a different plan. What did you do, and what was the outcome?
He also asked one question related to my project:
Coding Question
The coding problem was based on a binary matrix where every row is sorted in non-decreasing order, meaning all "0"s appear before all "1"s.
«Given a binary matrix "mat", find the index of the row containing the maximum number of "1"s. If multiple rows contain the same maximum number of "1"s, return the index of the first such row. Return "-1" if the matrix contains no "1"s.»
Example:
0 0 1 0 1 1 0 0 0
Output:
1
The overall interview was medium difficulty from a coding perspective. The coding questions themselves were manageable, but the interviewer went very deep into the dry runs and reasoning behind every step.
The biggest takeaway for me was that it wasn't enough to simply know the binary-search approach. I had to be able to justify every decision, explain why certain elements/rows could be eliminated, handle edge cases, and defend the complexity and logic of the solution.
So, if you're preparing for a similar interview, don't just practice writing the code. Make sure you can explain your approach clearly and perform a complete dry run while answering “why?” at every step.