Preparing for an interview? Check out Cracking the Coding Interview
Published on

Amazon | SDE 2 | Luxembourg | Rejected

Author
  • Shared Anonymously

Had given OA for some other position in Europe but the recuriter reached out on email for an interview.

Phone Screening:

  1. 30 minutes of Behavioural (Tell me the most complex thing you worked on and another similar question)
  2. We are getting strings of usernames who are logging in our application and we need to tell the Last one time logged in user.
    For eg:
    user1
    user2
    user1
    user3
    user4
    user3

The person who visited the oldest time and has logged in only once is "user1"
It was smiliar to LRU with a few changes, so I used that as it can be implemented in O(1) average time and the interviewer was happy with the solution.
Follow up: How to manage space.

Onsites were all on one day

Onsite 1: (HLD round)
First 30 minutes were Behavioural questions. I felt that she didn't like my answer to one of the question and I had to justify it to her a few times.
This didn't go well for me, I was asked to design a Booking application. The interviewer went deep into handling consecutive transactions and she didn't like my solution but then she gave me a hint about what she thinks will work which I implemented and showed her but also pointed out fre major concerns with her approach. Didn't do too well in this round.

Onsite 2: (LLD/Design round)
First 30 minutes were LP again and this time the interviewer was really happy with my answers.
I was given a question to design a Pizza restaurant system, I used all the design principles and design pattern knowledge I had. I think I did really good and the interviewer seemed happy as well.

Onsite 3: (DSA)
First 30 minutes were LP again and the interviewer was not too senior and he was relating to my answers.
I was given a question which had an inverted n-ary tree. Each node represented an employee and it pointed to it's manager. We needed to find the closest manager for two given employee.
It was similar to inverted tree Lowest Common Ancestor, I told him two approaches, one with traversing and storing and then comparing, and the other without storing and traversing. I also mentioned all the edge cases.
He said to implement the first and I did that but for the second implementation, no time was left but he seemed satisfied.

Onsite 4: (DSA)
First 40-45 minutes were LP.
I was asked this: https://leetcode.com/problems/row-with-maximum-ones/description/
I first gave the brute force, which was O(nm)
Then I told we can just count 0s and figure out 1s but in worst case it would be O(nm) again.
Then I told him we can do binary search on the rows and this will be O(nlogM). He asked me to implement it and I did it but the interviewer converse much after the LP part.
I knew I could figure out a way to do it in O(n+m) but I had only 10 minutes in this round and that was already over.

I think the rounds were easy, but having 1.5 yoe, the first interviewer didn't like my LP answers and I didn't do well in HLD round.
A little more hardwork and I could have cracked it, but let's try again after the cooldown.

ReportMark as Helpful