Amazon SDE 2 interview experience
Company: Amazon
Role: sde ii
Interview Stage: Onsite
Location: unknown
Year: unknown
Original Post Content:
I was asked the below question in one of the face to face interview (virtual) round.
Implement an algorithm which does the following operations on a stream of integers.
1. Insert and delete from start, end and middle of the stream at any given point.
2. Get middle element from stream at any given point.
I explained an algorithm using doubly linked list with O(1) time complexity for all the operations but unfortunately got rejected with feedback shared by recruiter that I wasn't able to come up with a solution in the time complexity expected by interviewer (not sure if interviewers from Amazon have devised an algorithm which works better than O(1) time complexity). The interviewer wasn't even interested in listening to my solution. I was explaining all my thought process and from time to time had to ask him if he was listening or not, and he'll just ask again what I was explaining.
Just a note to any Amazon interviewer reading this post 'A candidate puts a lot of effort and time in preparing for interviews, and sometimes they get interview call after applying to 100+ job postings, so if you have already selected someone or made your mind to reject the candidate beforehand then please don't take the interviews or at least don't give false feedback, let the feedback be genuine. For you it is just an interview but for a candidate it is much more than that'