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
Preparation
Duration: 2 months
Topics: Graph , Dynamic Programming, Array, String, System Design
Tip
Tip

Tip 1 : Practice a lot.
Tip 2 : Focus on system design 
Tip 3 : Focus on amazon Leadership principles.

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

Tip 1: Mention relevant details for job you are applying. 
Tip 2: Be objective and concise.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date8 Jul 2020
Coding problem2

1. Number of Islands

Moderate
34m average time
60% success
0/80
Asked in companies
AppleZomatoAtlassian

You are given a 2-dimensional array/list having N rows and M columns, which is filled with ones(1) and zeroes(0). 1 signifies land, and 0 signifies water.

A cell is said to be connected to another cell, if one cell lies immediately next to the other cell, in any of the eight directions (two vertical, two horizontal, and four diagonals).

A group of connected cells having value 1 is called an island. Your task is to find the number of such islands present in the matrix.

Problem approach

I used DFS to find number of distinct components.

Try solving now

2. Add First and Second Half

Moderate
35m average time
65% success
0/80
Asked in companies
LenskartAmazonGoogle

You are given a Singly Linked List of N nodes such that each node represents a single digit.

Your task is to return a node 'X', where 'X' represents the head of the Linked List storing the digits of the sum(most significant digit at the head) formed by adding the 1st half and 2nd half of the given Linked List.

Note:

1. When N is odd consider the middle element to be part of 1st half.

2. The sum should not contain any leading zero, except the number 0 itself.
For Example:
Given Linked List: 1-2-3-4-5-5-6

First half: 1-2-3-4    
Second half: 5-5-6

Output Linked List: 1-7-9-0 = (1234 + 556 = 1790)

Follow Up:

Can you add both halves without finding the length of Linked List and in O(1) space?
Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date4 Aug 2020
Coding problem1

1. Next greater element

Moderate
20m average time
90% success
0/80
Asked in companies
DunzoCIS - Cyber InfrastructureCisco

You are given an array arr of length N. You have to return a list of integers containing the NGE(next greater element) of each element of the given array. The NGE for an element X is the first greater element on the right side of X in the array. Elements for which no greater element exists, consider the NGE as -1.

For Example :

If the given array is [1, 3, 2], then you need to return [3, -1, -1]. Because for 1, 3 is the next greater element, for 3 it does not have any greater number to its right, and similarly for 2.
Problem approach

Solved using stack.

Try solving now
03
Round
Hard
Video Call
Duration60
Interview date7 Jul 2020
Coding problem2

1. Word Break

Hard
36m average time
55% success
0/120
Asked in companies
HikeGoogleGroww

You are given a string 's', and a dictionary of words 'dict' containing 'n' words. Your task is to add spaces in 's' to form valid sentences, where each word is a word from the dictionary.


You need to return all possible sentences that can be formed using the given dictionary.


Note :
The same word from a dictionary can be used as many times as possible to make sentences.
Problem approach

Paraphrasing the solution in my words

Let's take an example. s="catsand" and wordDict = ["cat", "cats", "and", "sand"].

The solution starts by taking the string S( "catsand") initially finding whether whole string is present or not . IN this case it is not present in the dict.

Now breaking the string and then finding
s.substr( i) gives the substring from ith index till the end. so string word goes as

atsand // not present
tsand // not present

sand //present then the remainder is calculated which is cat in this case and recursive function is called and same thing is done with cat which will return cat and also store the result in the unordered map . Now comes the combine part where both the string are combined and the pushed in the result " cat sand".

and // then comes and which is present so now again wordbreak called on remainder which is cats now and this will return cats. Now both strings are combined and inserted into result . result = {. "cat sand", "cats and"}; Now after the loop ending the result is returned and also stored in map.

Try solving now

2. Valid Parenthesis

Easy
10m average time
80% success
0/40
Asked in companies
OracleSwiggyAmerican Express

You're given a string 'S' consisting of "{", "}", "(", ")", "[" and "]" .


Return true if the given string 'S' is balanced, else return false.


For example:
'S' = "{}()".

There is always an opening brace before a closing brace i.e. '{' before '}', '(' before ').
So the 'S' is Balanced.
Problem approach

Used the stack approach.

Try solving now
04
Round
Easy
Video Call
Duration60 minutes
Interview date30 Jul 2020
Coding problem1

1. System Design

Design a local transport system like BMTC.

05
Round
Easy
Video Call
Duration60 minutes
Interview date5 Aug 2020
Coding problem1

1. Project Questions

It was mix of HLD, LLD design discussion of your project. Make sure you know enough about your projects. Questions asked were based on Amazon leadership principles. Amazon mainly focuses on those principles.

Problem approach

Tip 1: Revolve your answers around amazon leadership principles.
Tip 2: Make sure you do have good knowledge of your projects.

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 create a function in JavaScript?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - 2
3 rounds | 4 problems
Interviewed by Amazon
1563 views
0 comments
0 upvotes
company logo
SDE - 2
5 rounds | 7 problems
Interviewed by Amazon
1020 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 8 problems
Interviewed by Amazon
2029 views
0 comments
0 upvotes
company logo
SDE - 2
5 rounds | 7 problems
Interviewed by Amazon
508 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 2
5 rounds | 12 problems
Interviewed by Walmart
24080 views
8 comments
0 upvotes
company logo
SDE - 2
4 rounds | 7 problems
Interviewed by Dunzo
2466 views
0 comments
0 upvotes
company logo
SDE - 2
3 rounds | 4 problems
Interviewed by Samsung
2057 views
0 comments
0 upvotes