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

SDE - 2

Amazon
upvote
share-icon
5 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Journey
An HR from Amazon reached out to me on linkedIn regarding the job. Total interview rounds: 5 There are 4 technical rounds and one bar raiser round which you need to clear in order to get into the company.
Application story
An HR reached out to me on LinkedInn regarding the job opening, after my resume got shortlisted 5 rounds of interview were conducted. 1 online coding round, 1 video call coding round, 1 HLD round, 1 LLD round and 1 bar raiser round
Why selected/rejected for the role?
Rejected for the role. I failed in bar raiser round as Interviewer was not fully satisfied with my approach.
Preparation
Duration: 3 months
Topics: Java, OOPs, Data Structures, Algorithms, System Design, Spring Boot
Tip
Tip

Tip 1 : Prepare Easy and Medium level questions
Tip 2 : Prepare for System Design and your current projects
Tip 3 : Practice 2-3 questions daily. 
Consistency is the key.

Application process
Where: Linkedin
Eligibility: 2+ years experience
Resume Tip
Resume tip

Tip 1: Every information on the resume should be correct and on your fingertips
Tip 2: Mention good projects on your resume and the impact you made on that project

Interview rounds

01
Round
Medium
Online Coding Interview
Duration120 minutes
Interview date10 Jun 2021
Coding problem2

First round was 105 minutes coding round, followed by 10-15 minutes work style survey. It consists medium level coding problem.

1. Largest rectangle in a histogram

Hard
25m average time
75% success
0/120
Asked in companies
FacebookAppleAmazon

You have been given an array/list 'HEIGHTS' of length ‘N. 'HEIGHTS' represents the histogram and each element of 'HEIGHTS' represents the height of the histogram bar. Consider that the width of each histogram is 1.

You are supposed to return the area of the largest rectangle possible in the given histogram.

For example :
In the below histogram where array/list elements are {2, 1, 5, 6, 2, 3}.

alt text

The area of largest rectangle possible in the given histogram is 10.
Problem approach

TC: O(n)
SC: O(n)

Try solving now

2. Pair Sum

Easy
15m average time
90% success
0/40
Asked in companies
Media.netExpedia GroupQuikr

You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to return the list of all pairs of elements such that each sum of elements of each pair equals 'S'.

Note:

Each pair should be sorted i.e the first value should be less than or equals to the second value. 

Return the list of pairs sorted in non-decreasing order of their first value. In case if two pairs have the same first value, the pair with a smaller second value should come first.
Problem approach

TC: O(n)
SC: O(n)

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date14 Oct 2021
Coding problem2

First round was 1hr coding round on video call. It consists of one easy and one medium level coding problem. Interviewer was very polite and helpful.

1. Move Zeroes To End

Moderate
30m average time
70% success
0/80
Asked in companies
Thought WorksSAP LabsMicrosoft

Given an unsorted array of integers, you have to move the array elements in a way such that all the zeroes are transferred to the end, and all the non-zero elements are moved to the front. The non-zero elements must be ordered in their order of appearance.

For example, if the input array is: [0, 1, -2, 3, 4, 0, 5, -27, 9, 0], then the output array must be:

[1, -2, 3, 4, 5, -27, 9, 0, 0, 0].

Expected Complexity: Try doing it in O(n) time complexity and O(1) space complexity. Here, ‘n’ is the size of the array.

Problem approach

I gave the single array traversal solution and interviewer was satisfied with the approach.
TC: O(n)
SC: O(1)

Try solving now

2. Spiral Order Traversal of a Binary Tree

Easy
20m average time
75% success
0/40
Asked in companies
PayUAtlassianAmazon

You have been given a binary tree of 'N' nodes. Print the Spiral Order traversal of this binary tree.

For example
For the given binary tree [1, 2, 3, -1, -1, 4, 5, -1, -1, -1, -1]
    1
   / \
  2   3
     / \
    4   5

Output: 1 3 2 4 5
Problem approach

I gave the BFS based solution and interviewer was satisfied with the approach.
TC: O(n)
SC: O(n)

Try solving now
03
Round
Medium
Video Call
Duration60 minutes
Interview date22 Oct 2021
Coding problem1

This round was High level System design round. This was also video call round. Interviewer was helpful.

1. Design Question

Design instagram

Problem approach

Tip 1: Don't throw buzz words. You should have the proper understanding of the terms you are saying.
Tip 2: Practice at least 8-10 system design case studies.
Tip 3: Prepare fundamental theory well

04
Round
Medium
Video Call
Duration60 minutes
Interview date19 Nov 2021
Coding problem1

This round was Low level System design round. This was also video call round. Interviewer was helpful.

1. Design Tic-Tac-Toe

Moderate
30m average time
70% success
0/80
Asked in companies
AmazonUberAdobe

Ninja has to design a 2 players game Tic-Tac-Toe played on an ‘N’ * ‘N’ grid.

Ninja has to assume the following rules while playing the game:

This game is played between two people (Player 1 and Player 2). Player 1 chooses ‘X' and Player 2 chooses ‘O’ to mark their cells. A move is guaranteed to be valid and is placed on an empty block.

A player who successfully places 'N' of their marks in a horizontal, vertical, or diagonal row wins the game. Once a winning condition is reached, no more moves are allowed.

As Ninja is busy planning his strategy, he asks you for help. Your task is to complete the function ‘move(row, col, player)’ where ‘row’ and ‘col’ represent the current row and column of the grid ‘player’ P (either 1 or 2) chooses to place his sign.

The function must return an integer which is either 0, 1, and 2 representing:

0: No one wins.
1: Player 1 wins.
2: Player 2 wins.

Example:

Let us assume if ‘N’ = 3 and player 1 places ‘X’ and player 2 places ‘O’ on the board.

Problem approach

Tip 1: Don't throw buzz words. You should have the proper understanding of the terms you are saying.
Tip 2: Practice at least 8-10 system design case studies.
Tip 3: Prepare fundamental theory well

Try solving now
05
Round
Hard
Video Call
Duration60 minutes
Interview date6 Jan 2022
Coding problem1

This round was. Bar Raiser round. This was also video call round. Interviewer was helpful.

1. Design Question

Design debugger

Problem approach

Step 1 : I first gave two pass solution. It was not good enough.
Step 2 : Interviewer asked me to optimise the solution.
Step 3 : Then i gave solution with one pass solution and interviewer was satisfied.

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 - 2
5 rounds | 8 problems
Interviewed by Amazon
1865 views
0 comments
0 upvotes
company logo
SDE - 2
3 rounds | 4 problems
Interviewed by Amazon
2446 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 8 problems
Interviewed by Amazon
3375 views
0 comments
0 upvotes
company logo
SDE - 2
5 rounds | 7 problems
Interviewed by Amazon
911 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 2
5 rounds | 12 problems
Interviewed by Walmart
29892 views
8 comments
0 upvotes
company logo
SDE - 2
4 rounds | 7 problems
Interviewed by Dunzo
3164 views
0 comments
0 upvotes
company logo
SDE - 2
3 rounds | 4 problems
Interviewed by Samsung
2588 views
0 comments
0 upvotes