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

SDE - 1

Amazon
upvote
share-icon
4 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 12 months
Topics: Data Structures & Algorithms, OOPS, Trees, Dynamic Programming, Operating System
Tip
Tip

Tip 1 : Focus on DSA
Tip 2 : Try to solve the same problem with a different approach to get a better understanding of the problem.
Tip 3 : Stick to the standard set of problems and Have a more focus on Trees because it is companies favourite topic you can expect at least one question in there every round.

Application process
Where: Referral
Eligibility: 6 CGPA
Resume Tip
Resume tip

Tip 1 : Try to have a single page resume 
Tip 2 : Put proper links related to your coding profile so that anyone who is looking at your resume can actually visit and see the same
Tip 3 : Mention all your achievements clearly

Interview rounds

01
Round
Medium
Online Coding Interview
Duration150 minutes
Interview date14 Nov 2021
Coding problem2

This round contains Four-Part which is the standard Amazon QA
Part-1
There will be 7 Debugging questions which you have to solve in 20 min
Part-2
There will be 2 coding questions which you have to solve in 70 min
Part-3
You can expect 20-30 questions regarding Amazon 16 LeaderShip principle where you have to based on 4 options you have to choose the most appropriate one
Part 4
I don't remember the exact number but I guess it was 24 questions in 30 minutes which were aptitude question

1. Connecting Cities With Minimum Cost

Moderate
10m average time
90% success
0/80
Asked in companies
SamsungAmazonSquadstack

There are ‘N’ cities numbered from 1 to ‘N’ and ‘M’ roads. Each road connectss two different cities and described as a two-way road using three integers (‘U’, ‘V’, ‘W’) which represents the cost ‘W’ to connect city ‘U’ and city ‘V’ together.

Now, you are supposed to find the minimum cost so that for every pair of cities, there exists a path of connections (possibly of length 1) that connects those two cities together. The cost is the sum of the connection costs used. If the task is impossible, return -1.

Problem approach
  1. So as soon as I saw this problem I just understood that it is a graph problem and it is related to minimizing the cost 
  2. Any the edges are undirected and there is no negative cycle in the graph
  3. And I understood that having a cycle will just increase the cost no I have to make sure I won't form any cycle
  4. Then as it was a kind of direct use of MST so I wrote the code corresponding to it.
Try solving now

2. Count Distinct Substrings

Moderate
10m average time
90% success
0/80
Asked in companies
AdobeAmazonIntuit

Given a string 'S', you are supposed to return the number of distinct substrings(including empty substring) of the given string. You should implement the program using a trie.

Note :
A string ‘B’ is a substring of a string ‘A’ if ‘B’ that can be obtained by deletion of, several characters(possibly none) from the start of ‘A’ and several characters(possibly none) from the end of ‘A’. 

Two strings ‘X’ and ‘Y’ are considered different if there is at least one index ‘i’  such that the character of ‘X’ at index ‘i’ is different from the character of ‘Y’ at index ‘i’(X[i]!=Y[i]).
Problem approach

So for this, I used a hash map and 2 pointers to solve the question

Try solving now
02
Round
Easy
Face to Face
Duration45 minutes
Interview date15 Feb 2022
Coding problem2

It was a coding Round
The interview started with his introduction and the told me to introduce myself and then told he will be paste a question in the text editor and I have to write a production-level code for the same

1. Top View Of Binary Tree

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

You are given a Binary Tree of 'n' nodes.


The Top view of the binary tree is the set of nodes visible when we see the tree from the top.


Find the top view of the given binary tree, from left to right.


Example :
Input: Let the binary tree be:

Example

Output: [10, 4, 2, 1, 3, 6]

Explanation: Consider the vertical lines in the figure. The top view contains the topmost node from each vertical line.
Problem approach

Used Hashmap to solve the same

Try solving now

2. K-th Largest Sum Subarray

Easy
10m average time
90% success
0/40
Asked in companies
OlaAmazonSolomon Capital

Given an array of integers, find the Kth largest sum subarray For example, given the array [1, -2, 3, -4, 5] and K = 2, the 2nd largest sum subarray would be [3, -4, 5], which has a sum of 4.

Please note that a subarray is the sequence of consecutive elements of the array.

Problem approach

Used heap in order to solve this quesiton

Try solving now
03
Round
Easy
Face to Face
Duration45 minutes
Interview date22 Feb 2022
Coding problem2

This interview was taken by an SDM, She had close to 9 years of experience
The interviewer started in the same fashion She introduced herself and then asked me to do the same
Then she pasted the quest link

1. Add Strings

Easy
0/40
Asked in companies
AppleOracleFacebook

You are given two non-negative integers, ‘NUM1’ and ‘NUM2’, in the form of strings. Return the sum of both strings.


Note :
You do not need to print anything, it has already been taken care of. Just implement the given function.
Example:
Let ‘NUM1’ be: “5”
Let ‘NUM2’ be: “21”
The sum of both numbers will be: “26”.
Problem approach

So she told me i will be getting the two values in a form of string
So I told I will first store each digit in the linked list and then used recursion to solve question

Try solving now

2. N-ary tree Level Order Traversal

Moderate
20m average time
80% success
0/80
Asked in companies
AmazonLinkedInArgano

You are given an N-ary tree where every node has at most ‘N’ child nodes. You need to find the level order traversal of this tree

Note:
Note that the level order traversal must not contain any null values, simply return the tree in level order.
Problem approach

Used bfs to solve the above question

Try solving now
04
Round
Easy
Face to Face
Duration40 minutes
Interview date4 May 2022
Coding problem1

This interview was taken by an Senior SDM, She had close to 18 years of experience
The interviewer started in the same fashion She introduced herself and then asked me to do the same
Then she pasted the quest link

1. Children Sum Property

Moderate
36m average time
70% success
0/80
Asked in companies
AmazonQualcommSamsung

Given a binary tree of nodes 'N', you need to modify the value of its nodes, such that the tree holds the Children sum property.

A binary tree is said to follow the children sum property if, for every node of that tree, the value of that node is equal to the sum of the value(s) of all of its children nodes( left child and the right child).

Note :
 1. You can only increment the value of the nodes, in other words, the modified value must be at least equal to the original value of that node.
 2. You can not change the structure of the original binary tree.
 3. A binary tree is a tree in which each node has at most two children.      
 4. You can assume the value can be 0 for a NULL node and there can also be an empty tree.
Problem approach

You have to just focus on the fact when you have to make change in the value

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
3085 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
2295 views
1 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
8963 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
5984 views
5 comments
0 upvotes