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

SDE - 1

Amazon
upvote
share-icon
4 rounds | 8 Coding problems

Interview preparation journey

expand-icon
Journey
Amazon visited our campus for placements. The company first conducted resume shortlisting and sent online test links to only those who were shortlisted. There were four rounds including one online assessment and three rounds of interviews.
Application story
The company visited our campus and instructed everyone to apply using a resume through the link provided by the TPO. Subsequently, shortlisting was conducted based on the submitted resumes.
Why selected/rejected for the role?
I was rejected in the final round. Although I managed to build the solution from scratch and wrote code to cover test cases, I failed to achieve 100% efficiency and overlooked a few edge cases. I believe this is the reason for my rejection.
Preparation
Duration: 1.5 months
Topics: Arrays, LinkedList, Trees, Graphs, Binary Search, CS fundamentals
Tip
Tip

Tip 1: Prioritize practicing frequently asked interview questions initially. 

Tip 2: Start with a brute force approach rather than immediately aiming for optimized code. 

Tip 3: Seek assistance from the interviewer when facing difficulties. Stay calm and persistent when stuck, and keep trying without feeling tense.

Application process
Where: Campus
Eligibility: Above 60% throughout academics
Resume Tip
Resume tip

Tip 1: List the projects and give a brief note about them.
Tip 2: Place only skills that you are confident in.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration120 minutes
Interview date12 Feb 2022
Coding problem2

The assessment consisted of a few multiple-choice questions (MCQs) and 2 coding questions to be completed within a 2-hour timeframe. A 24-hour window was provided, allowing us to take the test at any convenient time from home.

1. Beautiful String

Moderate
30m average time
70% success
0/80
Asked in companies
SAP LabsAmazonJaguar Land Rover

Suppose we are given an empty string ā€œinputStringā€. We have to convert this ā€œinputStringā€ into a ā€œBeautiful Stringā€

We can perform any number of operations on ā€œinputStringā€ to convert it to ā€œBeautiful Stringā€.

Operation :

You have to insert ā€œabcā€ to ā€œinputStringā€ in every operation.
If ā€œinputStringā€ is empty just insert ā€œabcā€ in ā€œinputStringā€
If ā€œinputStringā€ is not empty, you can insert ā€œabcā€ in any position in ā€œinputStringā€ in such a way that:
1. ā€œ LEFT PORTION OF ā€œinputStringā€ ā€ + ā€œ abc ā€ + ā€œ RIGHT PORTION OF ā€œinputStringā€ ā€ = ā€œBeautiful Stringā€.
2. ā€œ LEFT PORTION OF ā€œinputStringā€ ā€ maybe EMPTY OR ā€œaā€ OR ā€œabā€ OR ā€œabcā€.
3. ā€œ LEFT PORTION OF ā€œinputStringā€ ā€ maybe EMPTY OR ā€œcā€ OR ā€œbcā€ OR ā€œabcā€.

Your task is to find whether the given string ā€œinputStringā€ is a ā€œBeautiful Stringā€, or not.

Note :
The given string "inputString" cannot be empty.
Try solving now

2. K Closest Points To Origin

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

Your house is located at the origin of a 2-D plane. You have 'N' neighbours who live at 'N' different points on the plane. You want to visit exactly 'K' different neighbours who live closest to your house, you are given a 2 - D matrix 'POINTS'. So, find out the coordinates of the neighbours you are going to visit. The answer is guaranteed to be unique.

Note:

The distance between two points on a plane is the Euclidean Distance.
For Example:
If N = 2, K = 1 and the points are {2,3}, {-1, 2}.

Then the distance of the first point from the origin is sqrt((2 - 0) ^ 2 + (3 - 0) ^ 2) = sqrt(13).

The distance of the second point from the origin is sqrt((-1 - 0) ^ 2 + (2 - 0) ^ 2) = sqrt(5).
Follow Up:
Can you solve this in O(N log K) time complexity?
Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date21 Mar 2022
Coding problem2

It was an interview round with an Amazon software engineer of SDE3 or above level. The interview was conducted through Amazon's video-based platform called Chime. It was scheduled for around 10:30 AM. The interviewer was very helpful; he made me feel comfortable before starting the interview.

 


 

1. Remove Consecutive Duplicates

Easy
0/40
Asked in companies
OlaWalmartSamsung

You are given a string ā€˜str’ of size ā€˜N’. Your task is to remove consecutive duplicates from this string recursively.

For example:

If the input string is ā€˜str’ = ā€aazbbbyā€, then your output will be ā€œazbyā€.
Note that we are just removing adjacent duplicates.
Problem approach

Initially, I attempted to solve it using n passes, where in each pass, we try to remove adjacent characters. However, the interviewer asked me to optimize the solution. I then utilized a stack approach, ensuring that each character was visited only once. This optimization reduced the time complexity to O(n).

Try solving now

2. Frequency In A Sorted Array

Easy
15m average time
85% success
0/40
Asked in companies
SprinklrOlaUrban Company (UrbanClap)

You are given a sorted array 'ARR' and a number 'X'. Your task is to count the number of occurrences of 'X' in 'ARR'.

Note :
1. If 'X' is not found in the array, return 0.
2. The given array is sorted in non-decreasing order.
Problem approach

At first, I suggested using a hash map to store the count of every element. However, the interviewer requested a further reduction in both time and space complexity. In response, I implemented a binary search algorithm to find the first and last occurrences of the element, subsequently returning the difference between them.

Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date23 Mar 2022
Coding problem2

The interview was scheduled for the morning at 11:00 AM. The interviewer joined promptly and introduced himself before requesting my introduction. The interview, conducted via Chime, began with project-related questions, followed by inquiries about data structures and coding.

1. Binary Tree Zigzag Traversal

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

You have been given a Binary Tree of 'N' nodes, where the nodes have integer values. Your task is to print the zigzag traversal of the given tree.

Note:
In zigzag order, level 1 is printed from left to right fashion, level 2 is printed from right to left. and level 3 is printed from left to right again, and so on…..
For example:
For the given binary tree

1

The zigzag  traversal is [1, 4, 3, 5, 2, 7, 6]
Problem approach

I initially attempted to print the level order traversal but later modified the approach to print the zigzag traversal.

Try solving now

2. Longest Increasing Subsequence

Moderate
30m average time
65% success
0/80
Asked in companies
IBMVisaOYO

For a given array with N elements, you need to find the length of the longest subsequence from the array such that all the elements of the subsequence are sorted in strictly increasing order.

Strictly Increasing Sequence is when each term in the sequence is larger than the preceding term.

For example:
[1, 2, 3, 4] is a strictly increasing array, while [2, 1, 4, 3] is not.
Try solving now
04
Round
Easy
Video Call
Duration60 minutes
Interview date28 Apr 2022
Coding problem2

It was a managerial round scheduled for 10:00 AM. A software engineer at the managerial level promptly joined the call.

1. The Celebrity Problem

Moderate
30m average time
60% success
0/80
Asked in companies
OlaVisaApple

There are ā€˜N’ people at a party. Each person has been assigned a unique id between 0 to 'N' - 1(both inclusive). A celebrity is a person who is known to everyone but does not know anyone at the party.

Given a helper function ā€˜knows(A, B)’, It will returns "true" if the person having id ā€˜A’ know the person having id ā€˜B’ in the party, "false" otherwise. Your task is to find out the celebrity at the party. Print the id of the celebrity, if there is no celebrity at the party then print -1.

Note:
1. The helper function ā€˜knows’ is already implemented for you.
2. ā€˜knows(A, B)’ returns "false", if A doesn't know B.
3. You should not implement helper function ā€˜knows’, or speculate about its implementation.
4. You should minimize the number of calls to function ā€˜knows(A, B)’.
5. There are at least 2 people at the party.
6. At most one celebrity will exist.
Problem approach

I was struggling to find the approach and got the idea that it could be solved using a pointer approach to optimize the time complexity and space complexity. I gave my approach and the interviewer was happy with it. I tried to write the code. Basic test cases were passed. But one of the edge cases is not passed. I tried to modify the code but could not be able to complete it.

Try solving now

2. Bursting Balloons

Moderate
40m average time
60% success
0/80
Asked in companies
Samsung ElectronicsAdobeMicrosoft

You are given an array 'ARR' of N integers. Each integer represents the height of a balloon. So, there are N balloons lined up.

Your aim is to destroy all these balloons. Now, a balloon can only be destroyed if the player shoots its head. So, to do the needful, he/ she shoots an arrow from the left to the right side of the platform, from an arbitrary height he/she chooses. The arrow moves from left to right, at a chosen height ARR[i] until it finds a balloon. The moment when an arrow touches a balloon, the balloon gets destroyed and disappears and the arrow continues its way from left to right at a height decreased by 1. Therefore, if the arrow was moving at height ARR[i], after destroying the balloon it travels at height ARR[i]-1. The player wins this game if he destroys all the balloons in minimum arrows.

You have to return the minimum arrows required to complete the task.

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 - 1
3 rounds | 5 problems
Interviewed by Amazon
0 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Amazon
3085 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Amazon
1593 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
8962 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Samsung
12649 views
2 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Microsoft
5983 views
5 comments
0 upvotes