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
Preparation
Duration: 13 Months
Topics: Data Structures, Algorithms, Java, JavaScript, ReactJs
Tip
Tip

Tip 1 : Always be consistent in preparation.
Tip 2 : Focus on understanding and learning rather than the number of questions

Application process
Where: Referral
Eligibility: No
Resume Tip
Resume tip

Tip 1 : Mention some good projects and explain them.
Tip 2 : Keep it clean and concise.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 Minutes
Interview date15 Nov 2021
Coding problem2

There were 2 data structure questions to be done in 70 minutes and 20 minutes for workstyle assessments.

1. Sell Diminishing Bricks

Moderate
25m average time
70% success
0/80
Asked in companies
HikeAmazonSoft Suave

Ninja has started a new business of selling bricks. There are ‘N’ types of bricks of distinct types present in his shop, and each brick’s cost is the number of bricks of that type currently present in his shop. The total number of each type of brick in the shop is given in an array 'ARR'. Ninja has received an order of ‘L’ bricks in his shop. Your task is to find the maximum profit Ninja can attain by this order.

Try solving now

2. Water Jug Problem

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

You are given two water jugs with capacities X and Y litres respectively. Both the jugs are initially empty. There is an infinite amount of water supply available. The jugs do not have markings to measure smaller quantities.

The following operations are allowed:

• Fill any of the jugs entirely with water.
• Empty any of the jugs.
• Pour water from one jug into another till the other jug is full, or the first jug itself is empty.

You are required to tell whether it is possible to measure exactly ‘Z’ litres using both of the jugs.

If Z litres of water is measurable, you must have Z litres of water contained within one or both buckets by the end.

For example:

In order to measure 2 litres from jugs of 4 and 6 litres we can follow the following steps-

• Fill 6-litres jugs to its maximum capacity.
• Pour water from 6-litres jug to the jug with 4-litres capacity.
• Pour water from 6-litres jug to the jug with 4-litres capacity.
Try solving now
02
Round
Easy
Face to Face
Duration60 Minutes
Interview date8 Feb 2022
Coding problem2

It was a face-to-face interview and the Interviewer asked 2 Easy-medium DSA problems.

1. Detect And Remove Cycle

Easy
10m average time
90% success
0/40
Asked in companies
WalmartOracleGoldman Sachs

You have been given a Singly Linked List of integers, determine if it forms a cycle or not. If there is a cycle, remove the cycle and return the list.

A cycle occurs when a node's ‘next’ points back to a previous node in the list.

Problem approach

I solved this problem by using Floyd Cycle Detection Algorithm.

Try solving now

2. Sort 0 1 2

Easy
22m average time
0/40
Asked in companies
Expedia GroupWalmartHCL Technologies

You have been given an integer array/list(ARR) of size 'N'. It only contains 0s, 1s and 2s. Write a solution to sort this array/list.

Note :
Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.
Problem approach

I solved this problem in a single traversal by defining ranges to 0,1 and 2.

Try solving now
03
Round
Easy
Face to Face
Duration60 Minutes
Interview date20 Feb 2022
Coding problem2

It was again DSA round, In which they asked me 2 DSA problems.

1. Container With Most Water

Moderate
15m average time
90% success
0/80
Asked in companies
BNY MellonAmazonSAP Labs

Given a sequence of ‘N’ space-separated non-negative integers A[1],A[2],A[3],......A[i]…...A[n]. Where each number of the sequence represents the height of the line drawn at point 'i'. Hence on the cartesian plane, each line is drawn from coordinate ('i',0) to coordinate ('i', 'A[i]'), here ‘i’ ranges from 1 to ‘N’. Find two lines, which, together with the x-axis forms a container, such that the container contains the most area of water.

Note :
1. You can not slant the container i.e. the height of the water is equal to the minimum height of the two lines which define the container.

2. Do not print anything, you just need to return the area of the container with maximum water.
Example

water-diagram

For the above Diagram, the first red marked line is formed between coordinates (2,0) and (2,10), and the second red-marked line is formed between coordinates (5,0) and (5,9). The area of water contained between these two lines is (height* width) = (5-2)* 9 = 27, which is the maximum area contained between any two lines present on the plane. So in this case, we will return 3* 9=27.
Problem approach

The interviewer asked me for 2 approaches to this problem, first I solved using prefix array, and the second with the stack.

Try solving now
Hard
0/120
Asked in companies
MicrosoftMakeMyTripAmazon

For a given two-dimensional integer array/list of size (N x M), print it in a spiral form. That is, you need to print in the order followed for every iteration:

a. First row(left to right)
b. Last column(top to bottom)
c. Last row(right to left)
d. First column(bottom to top)

 Mind that every element will be printed only once.

Refer to the Image:

Spiral path of a matrix

Try solving now
04
Round
Medium
HR Round
Duration60 Minutes
Interview date18 Mar 2022
Coding problem2

It was a behavioral + DSA round.

1. Basic HR Questions

Mention a time when you over-delivered than someone's expectations.

Mention a time when you gave a solution that is out of the box.

Problem approach

Tip 1 : Always answer in the STAR method.
Tip 2 : Never hesitate in answering.
Tip 3 : If anything doesn't relate to you, simply tell the interviewer.

2. Serialize and Deserialize Binary Tree

Hard
15m average time
85% success
0/120
Asked in companies
UbereBayApple

You have been given a binary tree of integers. You are supposed to serialize and deserialize (refer to notes) the given binary tree.


You can choose any algorithm to serialize/deserialize the given binary tree. You only have to ensure that the serialized string can be deserialized to the original binary tree.


Note :
Serialization is the process of translating a data structure or object state into a format that can be stored or transmitted (for example, across a computer network) and reconstructed later. The opposite operation, that is, extracting a data structure from stored information, is deserialization.
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
3084 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
2294 views
1 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Amazon
1592 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
58237 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