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

Intern

Amazon
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : You need a strong aptitude for knowledge as a first tip
Tip 2 : Solve questions from previous coding questions
Tip 3 : Make sure your resume includes at least two projects

Application process
Where: Company Website
Resume Tip
Resume tip

Tip 1 : Have at least 2 good projects mentioned in your resume with a link
Tip 2 : Focus on skills, internships, projects, and experiences.
Tip 3 : Make it simple, crisp, and one page

Interview rounds

01
Round
Medium
Online Coding Interview
Duration70 minutes
Interview date1 Aug 2019
Coding problem2

Round 1: Online Assessment:

 

1. Two Sum

Easy
10m average time
90% success
0/40
Asked in companies
MeeshoAdobeInfo Edge India (Naukri.com)

You are given an array of integers 'ARR' of length 'N' and an integer Target. Your task is to return all pairs of elements such that they add up to Target.

Note:

We cannot use the element at a given index twice.

Follow Up:

Try to do this problem in O(N) time complexity. 
Problem approach

Try to solve the question in expected time complexity

Try solving now

2. Binary Tree Pruning

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

You have been given a Binary Tree where the value of each node is either 0 or 1. Your task is to return the same Binary Tree but all of its subtrees that don't contain a 1 have been removed.

Note :

A subtree of a node X is X, plus every node that is a descendant of X.

For Example :

Look at the below example to see a Binary Tree pruning.
Input: [1, 1, 1, 0, 1, 0, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]

alt text

Output: [1, 1, 1, -1, 1, -1, 1, -1, -1, -1, -1]

For example, the input for the tree depicted in the below image would be :

alt text

1
2 3
4 -1 5 6
-1 7 -1 -1 -1 -1
-1 -1

Explanation :

Level 1 :
The root node of the tree is 1

Level 2 :
Left child of 1 = 2
Right child of 1 = 3

Level 3 :
Left child of 2 = 4
Right child of 2 = null (-1)
Left child of 3 = 5
Right child of 3 = 6

Level 4 :
Left child of 4 = null (-1)
Right child of 4 = 7
Left child of 5 = null (-1)
Right child of 5 = null (-1)
Left child of 6 = null (-1)
Right child of 6 = null (-1)

Level 5 :
Left child of 7 = null (-1)
Right child of 7 = null (-1)

The first not-null node (of the previous level) is treated as the parent of the first two nodes of the current level. The second not-null node (of the previous level) is treated as the parent node for the next two nodes of the current level and so on.
The input ends when all nodes at the last level are null (-1).

Note :

The above format was just to provide clarity on how the input is formed for a given tree.

The sequence will be put together in a single line separated by a single space. Hence, for the above-depicted tree, the input will be given as:
1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1
Problem approach

First I tried to apply brute force but it did not work. Tried the standard approach then and it somehow worked 

Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date6 Aug 2019
Coding problem1

There was only 1 round of interviews for Summer Internships, duration ranged from 30 minutes to 80 minutes. Most were over around 50 minutes.

The interviewer introduced himself and then asked me to introduce myself.
My interview lasted for only 60 minutes
He told me that my interview was going to test me on my coding and problem-solving skills.

1. Swap Nodes in Pairs

Moderate
40m average time
60% success
0/80
Asked in companies
Dell TechnologiesWalmartOLX Group

You are given a singly linked list of integers.

Your task is to swap every two adjacent nodes, and return the head of the modified, linked list.

For Example:

We have a linked list 1->2->3->4->5->6->7 and so on. You are supposed to swap pairs of a linked list like swap (1,2), (3,4), (5,6), and so on.
Note:
1. You may not modify the data in the list’s nodes; only nodes themselves may be changed. Because imagine a case where a node contains many fields, so there will be too much unnecessary swap.

2. If a pair of a node does not exist, then leave the node as it is.
Problem approach

Approach 1:
In every swap linked list question, you should always think about temp holder which point to next node.
And once init these temp holder, we can swap on these nodes which follows description.
After swapping, we update current pointers to temp holder
In this question we separate nodes into pairs since we have to swap between these pair
Step 1. Init temp holder Use nextPair to store next pair's position
Step 2. Swap, make second point to first, prev point to second, and first point to nextPair
Step 3. Update: Update prev and current pointer to corresponding temp holder

Complexity Analysis
Time: O(N) : Let n be length of nodes
Space: O(1)

Try solving now
03
Round
Medium
HR Round
Duration45 minutes
Interview date7 Aug 2019
Coding problem2

This was a technical + HR round taken by two interviewers.

1. Element with large number of occurrence

Easy
15m average time
85% success
0/40
Asked in company
Amazon

Ninja gets very irritated when he finds duplicate elements with large number of occurrences in an array, say 'ARR' of 'N' integers. He wants to find the element with large number of occurrences in the array so that he can remove that element later from that array.

Ninja asks for your help to find such element from the array. Help Ninja!

Note:
An element is having large number of occurrence if that element occurs more than floor('N' / 2) times in the array. If there is no such element present, print -1.
Problem approach

Expected O(logn) time solution.

Try solving now

2. Basic HR Questions

  • What are your strengths and weakness?
  • What do you know about the work ethics of Amazon?
  • Where do you see yourself after 5 years?
Problem approach

Just stay honest and answer confidently

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
Intern
2 rounds | 3 problems
Interviewed by Amazon
1163 views
1 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
8962 views
0 comments
0 upvotes
company logo
Fullstack Developer
2 rounds | 4 problems
Interviewed by Amazon
7905 views
2 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
Intern
2 rounds | 2 problems
Interviewed by Microsoft
1499 views
0 comments
0 upvotes
company logo
Intern
2 rounds | 2 problems
Interviewed by Adobe
1020 views
0 comments
0 upvotes
company logo
Intern
3 rounds | 4 problems
Interviewed by Oracle
1298 views
0 comments
0 upvotes