Amazon interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Amazon
upvote
share-icon
3 rounds | 8 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: DSA, OOPS, DBMS, Machine Learning, ReactJS, HTML/CSS, C++, Javascript, Deep Learning
Tip
Tip

Tip 1 : Only mention courses and topics in your Resume you are confident in and it would be better if you revise OOPS, DBMS.
Tip 2 : Explain your project in STAR format and also read about the leadership qualities. 
Tip 3 : Before the interview try to check important topics or things specific to the company. Like trees and Linked list are important topics for Amazon

Application process
Where: Campus
Eligibility: above 7 CGPA and only for circuital branches
Resume Tip
Resume tip

Tip 1 : Only mention courses, topics and projects in your Resume you are confident in.
Tip 2 : Do unique projects in the area which you want to apply to.
Tip 3 : Keep updating your resume according to the role you are applying to

Interview rounds

01
Round
Medium
Online Coding Interview
Duration150 mins
Interview date15 Sep 2021
Coding problem4

This round was for approx 2.5 hours and had 5 sections. Each section had its time limit and time didn’t carry over from one section to another.

1. NINJA'S TRUCK

Easy
0/40
Asked in companies
AmazonYamaha Motor India

Ninja is assigned a task to deliver some boxes which contain different units having different weights. With the help of his truck, he will earn money on the basis of the number of units of boxes he will deliver by his truck. Ninja truck has some capacity on the number of boxes he can put on his truck.

So your task is to find a way so that ninja will choose boxes in a way that units will be maximum and he would be able to get more money you will be provided with an array of ‘BOX’

where BOX[i] = [countofBoxes, unitsperBox]:
countofBoxes is the number of boxes of type I.
unitsperBox is the number of units in each box of type I.
And an integer ‘K’ denoting the limit of boxes on the truck.
Problem approach

Step 1 : sort boxTypes so that boxes with the most units appear first.
Step 2 : Iterate through the boxes in sorted order.
Step 3 : Instead of counting down one by one how many boxes to take, we can calculate how many boxes of the current type to take by taking min(truckSize, numberOfBoxes). This is because the truck can fit at most truckSize more boxes, but we have numberOfBoxes left.
Step 4 : Decrease the remaining truckSize by subtracting the number of boxes we included.

Try solving now

2. Maximum In Sliding Windows Of Size K

Moderate
20m average time
80% success
0/80
Asked in companies
AppleWalmartOYO

Given an array/list of integers of length ‘N’, there is a sliding window of size ‘K’ which moves from the beginning of the array, to the very end. You can only see the ‘K’ numbers in a particular window at a time. For each of the 'N'-'K'+1 different windows thus formed, you are supposed to return the maximum element in each of them, from the given array/list.

Problem approach

Step 1 : Create a descending order map, and insert first k elements. our map's first element will;point to the greatest element in the map.
Step 2 : In the second for loop, as its a sliding window, I'm removing the first elem(
a[k-i]) and adding the current upcoming elem (a[i]) into the window.
Step 3 : for that I'm decreasing the element's frequency in the map. also note that decreasing the freq to 0 wont delete the elem from the map, so I'm using m.erase to delete the elem , and incrementing the frequency of the curr elem. and deriving the greatest elem in the map again using it->first.

Try solving now

3. Puzzle

This was another section of Work Life assessment. Each question had a slider which was in the middle at the start, we had to move it either way which we think is most appropriate according to us.
Both sides have different viewpoints and two options most likely and more likely.
ViewPoint 1 ----------------------------------------------------------------------- ViewPoint 2
<-----Most Likely--------More Likely----O-----More Likely-----------Most Likely------->
It had 4 options and we had to select one which we thought was most suitable

Problem approach

Tip 1: These questions should be explained according to Amazon's Leadership principles

 

4. Puzzle

It had 24 questions. You cannot navigate( move back and forth) in questions. Time is the key here, the questions were really basic and easy, encoding-decoding questions, some paragraph based questions, series based questions

02
Round
Easy
Video Call
Duration50 mins
Interview date20 Sep 2021
Coding problem2

It was almost an hour-long interview, the platform was Amazon Chime. The interviewer was told a few minutes ago that he had to take the interview so he told me to give an intro while he was going through my resume. For about the first 5-10 minutes, only a small discussion happened like my interests, etc. Then he informed me that he will be asking 2 questions based on DSA and shared with me the online editor link where he gave the question, I had to explain the logic and code in that same editor.

1. Kth smallest node in BST

Moderate
15m average time
80% success
0/80
Asked in companies
WalmartMakeMyTripAmazon

You have been given a Binary Search Tree of integers. You are supposed to return the k-th (1-indexed) smallest element in the tree.


For example:
For the given binary search tree and k = 3

Example

The 3rd smallest node is highlighted in yellow colour.   
Problem approach

Step 1 : Initially, I gave the naive approach of traversing the tree in Inorder and while traversing, keep track of the count of the nodes visited. If the count becomes k, print the node and end the program. Complexity of this code is O(n) time and O(h) auxiliary space which I explained too and further asked if it is required to improve before starting to implement it.
Step 2 : Then I was asked to solve the problem in O(1) auxiliary space. I thought for a while and explained to him the Morris Traversal to traverse the tree in constant space O(1) space sol. He got a rough idea and asked me to implement it and then I walked him through the code by explaining each section of code with help of an example and he was satisfied.

Try solving now

2. First non repeating character

Easy
15m average time
80% success
0/40
Asked in companies
QuikrHCL TechnologiesMakeMyTrip

Ninja is now bored with numbers and is now playing with characters but hates when he gets repeated characters. Ninja is provided a string, and he wants to return the first unique character in the string.The string will contain characters only from the English alphabet set, i.e., ('A' - 'Z') and ('a' - 'z'). If there is no non-repeating character, print the first character of the string. If there is no non-repeating character, return the first character of the string.

Problem approach

Step 1 : Initially, I explained an array-based approach similar to this one:Method 3 of https://www.geeksforgeeks.org/given-a-string-find-its-first-non-repeating-character/ 
So each time the find answer function is called we will have to traverse the fi[256] array each time to return the answer.
Step 2 : Then he asked me to try a different approach for a situation in which the Find Answer function is called very frequently and hence to improve the time complexity for that function. So I explained to him a new approach which was queue-based. I also explained improvement in time complexity by using queue and then asked me to implement it and so I did and again explained each section of code with 2 test examples by dry-running it.

Try solving now
03
Round
Medium
Video Call
Duration75 mins
Interview date20 Sep 2021
Coding problem2

This round was taken by a manager. He introduced himself and asked for a short 2minute introduction of mine. Then he shared a code editor link where he explained the first question.

1. Find Character Case

Easy
0/40
Asked in company
Amazon

Write a program that takes a character as input and prints either 1, 0, or -1 according to the following rules.

1, if the character is an uppercase alphabet (A - Z)
0, if the character is a lowercase alphabet (a - z)
-1, if the character is not an alphabet
Constraints :
Input can be any character.
Problem approach

Step 1 : I gave the recursive approach, he told me to code.
Step 2 : After that he told me to dry run the approach for {a,b,c}, i tried to make the recursion tree on the editor but it was all messy after a few steps. He then shared a whiteboard link for that, it was taking lot of time doing there so finally he shared his whatsapp and told to do it on paper and send him the image, around 35 minutes were passed until then, i shared him a tree but it was incomplete but i explained how i am moving ahead and generating output. He was convinced and we moved to the next question.

Try solving now

2. Gas Stations

Moderate
10m average time
90% success
0/80
Asked in companies
OlaPhonePeApple

You have been given a circular path. There are 'N' petrol pumps on this path that are numbered from 0 to N - 1 (Both inclusive). Each petrol pump has two values associated with it:

1)The amount of petrol that is available at this particular petrol pump.
2)The distance to reach the next petrol pump.

You are on a truck having an empty tank of infinite capacity. You can start the tour from any of the petrol pumps. Your task is to calculate the first petrol pump from where the truck will be able to complete the full circle or determine if it is impossible to do so.

You may assume that the truck will stop at every petrol pump and it will add the petrol from that pump to its tank. The truck will move one kilometre for each litre of petrol consumed.

Problem approach

Step 1 : I had solved this question before and after some time told him the O(n) approach. He told me to code. I did so explaining each step along. I had two nested for loops in the code, so he inquired about how the approach is linear in time. 
Step 2 : We had some discussion on the code and I had to explain some parts to him again. He suggested some changes too. I deleted 4-5 lines for making those changes and for 5 minute or so was lost bringing it back due to connection issues and stuff. He told me that he had to keep a backup of the code and the changes so I should comment the unnecessary parts and not remove it. 
Step 3 : After that time was almost over and he asked if I had any questions for him. I asked about the work culture, and about the responsibilities an intern takes.

Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by Amazon
2162 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 7 problems
Interviewed by Amazon
1068 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
1043 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Amazon
3502 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15499 views
1 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Microsoft
8187 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Microsoft
4914 views
2 comments
0 upvotes