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

SDE - Intern

Amazon
upvote
share-icon
3 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Journey
My coding journey started from my college Thapar Institute. I was not very much familiar with the coding stuff so I consulted my professors and seniors and they helped me a lot in telling me how to kickstart in the field. I learned various concepts like DSA, WEB Dev, ML during my college life till now.
Application story
I used to practice on CodeChef daily. One day, when I opened Codechef, I was notified about these openings in Amazon for the SDE Intern post. I thought that it can be a life-changing moment for me if I got selected. So, I applied for these posts.
Why selected/rejected for the role?
I was selected for the post because I was confident during the interviews, and I was also given the correct approach to the problems. I was also building the optimal solutions rather than just jumping directly to them.
Preparation
Duration: 1 month
Topics: Data structures, OOPS, Algorithms, Operating System, DBMS
Tip
Tip

Tip 1 : Data structures and algorithms are the most fundamental and important thing to prepare.
Tip 2 : Don't ignore OOPS.
Tip 3 : Solve DSA questions regularly.

Application process
Where: Codechef
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Avoid unnecessary details like hobbies, date of birth, parent's name, photo, etc., and keep it one-pager.
Tip 2 : Add a link to your GitHub, LinkedIn, website, phone number, etc.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration90 minutes
Interview date18 Apr 2020
Coding problem2

I solved almost all the MCQs correctly and passed all the test cases for both the questions.

1. Max GCD Pair

Moderate
35m average time
75% success
0/80
Asked in companies
VisaApplePhonePe

You are given an array of positive integers. Find the GCD(Greatest Common Divisor) of a pair of elements such that it is maximum among all possible pairs. GCD(a, b) is the maximum number x such that both a and b are divisible by x.

For example: 
If the given array is {1, 5, 2, 3, 4}, the output will be 2 (which is GCD of 2 and 4, all other pairs have a GCD of 1)
Try solving now

2. Kevin and his Fruits

Moderate
25m average time
75% success
0/80
Asked in companies
AmazonAppleOLX Group

Kevin has ‘N’ buckets each consisting of some fruits. Kevin wants to eat at least ‘M’ fruits and so, he decided to set a marker (integer) as maximum as possible such that if he eats “number of fruits in the i-th bucket - marker” fruits then it must be at least ‘M’.

Example:

Let’s assume, we have 5 buckets each having 10, 40, 30, and 20 fruits respectively. And, Kevin wants to eat at least 30 fruits. 

Now, if we set our marker at 20 then Kevin can eat: (10 - 20) = -10 => 0 (fruit’s count can’t be negative) fruits from 1st bucket, (40 - 20) = 20 fruits from 2nd bucket, (30 - 20) = 10 fruits from the third bucket, and (20 - 20) = 0 fruits from the last bucket.

So, he can eat 0 + 20 + 10 + 0 = 30 fruits in total.
Note:
Each bucket may not have the same amount of fruits. It is guaranteed that the sum of all fruits (including all the buckets) will be greater than M. Kevin can only eat fruits from a particular bucket if and only if the bucket has more fruits than the marker.
Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date13 May 2020
Coding problem3

1. Bracket Number

Easy
15m average time
85% success
0/40
Asked in companies
GoogleFlipkartDunzo

Given a string ‘S’ comprising of some brackets. You need to print the number of every bracket.

For Example:
If S = (pq)() 
Then the output will be 1 1 2 2. First pair of opening and closing brackets will get the same number and so does the 2nd pair.
Try solving now

2. Least common ancestor

Moderate
25m average time
75% success
0/80
Asked in companies
FacebookVisaGoogle

You are given an arbitrary binary tree with N nodes, whose nodes have their values in the range of integers. You are given two nodes x, y from the tree. You have to print the least common ancestor of these nodes.

Least common ancestor of two nodes x, y in a tree or directed acyclic graph is the lowest node that has both nodes x, y as its descendants.

For example look at the tree below, the LCA of node 1 and 5 is 3.

Note :

You have to return the deepest node which has both x, y as its descendants.
There may be cases where one of u or v is not present in the tree. In those cases, the reference provided to u or v will be NULL.
Try solving now

3. Operating System

Threading, Process, Semaphore, Deadlock, hashmap implementation, time complexity. (Learn)

03
Round
Medium
Video Call
Duration45 minutes
Interview date2 May 2020
Coding problem2

1. Running median

Hard
46m average time
50% success
0/120
Asked in companies
AmazonHikeMyntra

You are given a stream of 'N' integers. For every 'i-th' integer added to the running list of integers, print the resulting median.

Problem approach

I solved it using heaps.
We can use a max heap on the left side to represent elements that are less than the effective median, and a min-heap on the right side to represent elements that are greater than the effective median.

After processing an incoming element, the number of elements in heaps differs utmost by 1 element. When both heaps contain the same number of elements, we pick the average of heaps root data as the effective median. When the heaps are not balanced, we select an effective median from the root of the heap containing more elements.

Try solving now

2. Detect Cycle in a Directed Graph

Moderate
25m average time
65% success
0/80
Asked in companies
FlipkartAmazonAmerican Express

Given a directed graph, check whether the graph contains a cycle or not. Your function should return true if the given graph contains at least one cycle, else return false.

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

Which SQL keyword removes duplicate records from a result set?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by Amazon
1427 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 7 problems
Interviewed by Amazon
589 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
597 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Amazon
1409 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
13230 views
1 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Microsoft
7646 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Google
5474 views
1 comments
0 upvotes