Open In App

Amazon Interview Experience for 2 months SDE (On-Campus) 2022

Last Updated : 03 Jan, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Round 1: Online Assessment

In this round, there were two coding questions. The first question was DP problem which was easy to identify, the second question was based on DP as well, and it was related to strings in a grid.

I was able to solve one question completely, and for the second question, one test case was failing. After approximately waiting for 20 days the results of the online assessment came and I was shortlisted.

Round 2: Interview

My interview lasted for more than one hour. There were two interviewers, one was asking the questions and the second was cross-questioning.

At first, they both introduced themselves and later they asked for my introduction. Both the interviewers appreciated me for the way I introduced myself.

After the introduction, I was given a coding problem:

  • You are given an input array that consists of only 0’s and 1’s. Assume that 0 and 1 represent cars. Also, a car with a value of 0 will move only from left to right and a car with a value of 1 will move from right to left. Now, I have to find out how many car crossings occur. (car crossing will occur when a car with value 1 crosses a car with value 0).

I answered this question first with a time complexity answered this question first with a time complexity of O(n^2). He later asked me to optimize the code. I used a suffix array to reduce my time complexity from O(n^2) to O(n).

He asked me to dry run the code and explain my approach with the given example in detail, after he was satisfied with my approach he asked me to code the same in the editor provided.

After this, he gave me another question:

, this question I have not done before, but it was easy to figure out that it was a modification of NEXT GREATER ELEMENT.

Firstly I explained to him my brute force solution, and he asked me to optimize the code, I then told him the O(n) approach using stack, and he was continuously asked questions about every line I was writing. He asked me to explain the approach with the given example. Once he was satisfied with the approach completely, he asked me to code it.

After finishing both questions, he asked me if I had any questions for them. I asked a couple of questions, and they both answered my questions in detail. And my interview ended after this.

FINAL VERDICT: SELECTED

Hope this helps!


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads