Amazon | Internship SDE interviews | All stages | All Questions | Offer
Anonymous User
1185

Hello Everyone,

I recently interviewed with Amazon and wanted to share the process with everybody. It hasn't been two business days yet so I haven't received an offer nor have I been rejected. I did a decent ammount of leetcode prior, and inbetween the OA and the "on-site" zoom interview, I did approximately a week of leetcode mediums and looked through many of the Amazon tagged questions. Received an offer exactly 5 business days after.

Step 1: Recieved Online Assesment Part 1 :
I submitteded by application on 2/9/2022. Like an idiot, I forgot to click I was a current student. After I realized and fixed that, I immediately received an OA on 2/16. I completed the OA on 2/17, both the coding and the workstyles assessment. On 2/26 (due date of the part 1) I received an interview offer for the "on-site".

Q1. (Note borrowed from here, same OA question)
You are an amazon delivery and you have some boxes that you have to deliver, but there are some conditions -

You can take 2 boxes of same weight in one round
you can take 3 boxes of same weight in one round
You have to find the minimum number of rounds to deliver the boxes or -1 if it is not possible to deliver them.

Example cases -
Input: boxes - [2, 2, 3, 3, 2, 4, 4, 4, 4, 4]
Output: 4
Explanation: 3 boxes of weight 2 in 1st round, 2 boxes of weight 3 in 2nd round, 3 boxes of wt 4 in 3rd and 2 boxes of wt 4 in 4th round.

Input: boxes - [2, 3, 3]
Output: -1
Explanation: There is only one box with weight 2 and we can only take either 2 or 3 boxes in one round not lesser.

My Approach:
EDIT: adding the code, might not be 100% accurate but doinging by memory

def num_trips(nums: list)->int:
import collections
import math
c = collections.Counter(nums)

tot_trips = 0

for count in c.values():
	if count == 1: return -1
	tot_trips += math.ceil(count/3)

return tot_trips

Make a Counter of frequency of weights

If there is any weight with frequency 1 return -1

otherwise iterate through all frequencies and calculate minimum number of rounds for that frequency.

this is similar to minimum number of coins to change the particular value where coins are 2 and 3
Let f is the maximum of frequency of any weight and there are c unique weights then
Time Complexity: O(n)
Space Complexity: O(1) for 26 characters

Q2 :
I actually kinda forgot this one but I believe it was "First non-repeating letter of a string" but will not type it out because I forgot. My solution was to once again use the Counter class in Python. Time complexity O(n), Space Complexity O(1) for 26 characters.

Overall:
I thought this round was overall pretty easy, mostly cause they were leetcode easies. I was able to complete this round in about half the allotted time and both were correct upon submission.

Step 2: Recieved Online Assesment Part 2 :
Within 24 hrs of completing my coding interview I was sent part2 behavioral and workstyle assesment
Kind of annoying but basically asking you which calls would you make, ranking effectiveness of solutions and debugging some Java code. I believe this is standard and not changing, as my friend received the exact same assessment.

Step 3: Final Interview :
I recieved a mail saying there was one final round of interview with an engineer and asking me to send my availability for the same. I was informed that it is a 45 min Interview with behavioural and technical question. I received this one week after I received my first OA. I believe I did well and think that contributed to receiving it so quickly.

Interview Day :
I joined the interview 5 minutes earlier and the interviewer was a few minutes late. Interviewer introduced himself and asked me to do the same. In introducing himself, he mentioned he worked at Amazon for 2 years with his anniversary being today. In the process of me congratulating him, he dabbed. I promise this is not a joke. I started laughing and we continued the interview.

Interviewer: I haven't read your resume but let me start out by asking you some behavioral questions and I know you're applying as an intern so if you haven't been in any of these experiences please just say so and we can skip the question.

he said there would be few behavioural questions and few technical after them, He also informed me that he would be taking notes and asked me not to misunderstand that as being distracted or checking messages or typing. He was a very chill dude who made an effor to make it relatively enjoyable.

Interviewer : Tell me about a time when you did something outside the project scope or your area of expertise.

I started with something about my intership experience about a project I worked on outside what I'm familiar. He interupted to clarify the question that he wanted something within a project I did outside my expertise. I clarified and he was cool and asked some follow ups about what I was responsible specifically in the side project

Interviewer : Tell me about a time where you had to choose between moving forward or staying put to finish up the work:

I talked about another project during my internship and the exact situation of what moved me forward. He told me that he didn't have any follow ups cause I answered it well and jokingly said he was frustrated. His follow up question was weird but I assume it was because he had to ask a follow up.

Overall behaviorals: So Amazon interviewing it seems you're required to ask clarifying questions and/or interrupt you at some time about your response to see how you handle it. I just related a lof of my answers to the Leadership Principles and he seemed to like those answers.

Coding Question :

Finally for coding he started by asking me given a complete/full BST, return an array with all the numbers sorted.

I suggested that it would definitely be an traversal problem. I forgot about in-order traversal so I talked through post-order and pre-order saying I'd prefer post. He corrected me and I discussed how I'd solve it before coding up a solution using recursion. I believe he wanted to check that I knew what the solution and why these design choice because some people just copy code or he implied that but didn't explicitly state that. I also outright stated the assumptions I made for the problem, such as instance variables names for the BST as there wasn't an explicitly stated constructor or anything. I was transparent to the fact I had done tree problems on leetcode and stated that I would use their template.

def answer(root: node)->list:
return_list=[]
def inorder(r: node):
if r.left: inorder(r.left)
return_list.append(r.val)
if r.right: inorder(r.right
inorder(root)
return return_list
Time Complexity : O(n)
Space Complexity : O(n)

I forgot to mention space and time complexities, which I think is bad but he didn't ask. He asked me questions about why I used a function within a function and why I appended to a list. I responded with I thought it was cleaner with recursion and I didn't want to deal with the complexities of passing a list as an argument. Finally he asked me about if in python as he said he didn't know you could do that. I said at least with the python versions I'm familiar with you can.

Next, he asked me to do the same in reverse. I realized we were running low on time so I definitely felt a little more rushed doing this one. I discussed several approaches I would use, first thinking that the value at index n, the children would be at 2n and 2n+1. Ultimately I realized that that works for pre order and discussed other methods of solving, settling on realizing that the middle is the root node, and the left of the middle are left subtrees and the right are right subtrees, basically creating a left tree and right tree.

Approach : recursive tree building

def answer(inorder: list:->node
def build(left:int , right:int)->node:
if left<rightL
mid = (left+right)//2
left_tree = build(left, mid-1)
right_tree = build(mid+1, right)
return node(inorder[mid], left_tree, right_tree)
else:
return node(inorder[left])
if not inorder: return None
return build(0, len(inorder)-1)
Time Complexity : O(n)
Space Complexity : O(n)

I felt more rushed on this one likely because he wanted to give me time to ask questions. For example, I accidentally started by passing a list to the inner function build before he suggested passing pointers which was a better solution. I also forgot the empty list case but he suggested that to me and I added an if statement to cover that edge case. Afterwards, I tried going through the solution with a few cases manually but he stopped me and told me it was good and we moved on for time constraints.

Overall: Easy and medium leetcode problems, felt as if I didn't have the most time on the problems to digest them, thus felt rushed a bit in solving and didn't always develop answers on my own naturally.

Openned up to questions: Just asked him some questions relating to leadership principles and those situations and he answered them very pleasantly.

Offer: Received offer 7 days after, approximately 5 business days. Received some updates in my portal such as the job has been moved to another position, indicating I got it on day 6. I only received updates to my portal at like 10-11 PM EST.

Advice: The problems amazon chooses are usually mediums. It appears in these interviews time management is hard because they want to ask behaviorals and chat but they definitely need more time for the technicals, so don't rush when it comes to there. Studying DSA is very important to solving these too. On Reddit, there are amazon tagged problems, do some of those to understand the type of questions they'd ask. Chances are, if you were very clear in talking about your behaviorals and also are clear of your data structures you should be set. From my experience, the DSA questions are one easy, and one medium, not impossible questions.

Comments (1)