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

SDE - 1

Amazon
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Graph should be on your tips.
Tip 2 : While explaining the solution to interviewer, dont just hop onto the most optimal solution. Start with the brute force one, give the cons of brute force solution, and then go step by step till you reach the optimal solution.
Tip 3 : Improve on your communication skills as well.

Application process
Where: Referral
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Mention only what is required for your profile, for e.g. do not stress too much on your co-curricular stuff. Rather, try explaining more of your technical stuff that is relevant for your job.
Tip 2 : Keep it limited to 1 page. And make sure it's a pdf and not an image.

Interview rounds

01
Round
Easy
Video Call
Duration45 minutes
Interview date18 Feb 2022
Coding problem2

1. Subset Sum Equal To K

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

You are given an array/list ‘ARR’ of ‘N’ positive integers and an integer ‘K’. Your task is to check if there exists a subset in ‘ARR’ with a sum equal to ‘K’.

Note: Return true if there exists a subset with sum equal to ‘K’. Otherwise, return false.

For Example :
If ‘ARR’ is {1,2,3,4} and ‘K’ = 4, then there exists 2 subsets with sum = 4. These are {1,3} and {4}. Hence, return true.
Problem approach

Approach (Using DP) : 

1) Create a boolean 2D array/list ‘DP’ of size (‘N+1’)*(‘K+1’) i.e. ‘DP[N+1][K+1]’.

2) If ‘K’ is equal to 0, then the answer should be ‘true’. Hence, run a loop from 0 to ‘N’ (say iterator = ‘i’):
‘DP[i][0]’ = true.

3) If ‘K’ is not zero but ‘ARR’ is empty then the answer should be ‘false’. Hence, run a loop from 1 to ‘K’ (say iterator = ‘i’):
‘DP[0][i]’ = false.

4) To fill the ‘DP’ table, run a loop from 1 to ‘N’ (say iterator = ‘i’):
4.1) Run a loop from 1 to ‘K’ (say iterator = ‘j’):
‘DP[i][j]’ = ‘DP[i-1][j]’.

4.2) If ‘j’ is greater than equal to ‘ARR[i-1]’:
‘DP[i][j]’ = ‘DP[i][j]’ OR ‘DP[i-1][j - ARR[i-1]]’.

5) Finally, return ‘DP[N][K]’.


TC : O(N*K), where N = size of the array and K = required sum
SC : O(N*K)

Try solving now

2. Overlapping Intervals

Easy
24m average time
0/40
Asked in companies
SprinklrAdobeAmazon

You have been given the start and end times of 'N' intervals. Write a function to check if any two intervals overlap with each other.

Note :
If an interval ends at time T and another interval starts at the same time, they are not considered overlapping intervals.
Problem approach

Approach (Using Sorting) : 

1) Sort the list of intervals first on the basis of their start time and then iterate through the array.

2) If the start time of an interval is less than the end of the previous interval, then there is an overlap and we can return true.

3) If we iterate through the entire array without finding an overlap, we can return false.


TC : O(N * logN), where N = total number of intervals.
SC : O(N)

Try solving now
02
Round
Easy
Video Call
Duration45 minutes
Interview date18 Feb 2022
Coding problem2

1. Reverse Stack Using Recursion

Easy
21m average time
80% success
0/40
Asked in companies
MicrosoftIBMRazorpay

Reverse a given stack of 'N' integers using recursion. You are required to make changes in the input parameter itself.


Note: You are not allowed to use any extra space other than the internal stack space used due to recursion.


Example:
Input: [1,2,3,4,5] 
Output: [5,4,3,2,1]

add image

Problem approach

Reverse stack using recursion.

Try solving now

2. Leftmost & Rightmost Nodes of Binary Tree

Easy
20m average time
80% success
0/40
Asked in companies
AmazonCultfitWizork

Given a Binary Tree of 'N' number of total nodes, return the sequence of values of the leftmost and rightmost node at each level.

For example:
For the given binary tree: 

alt-text

Output: 1 2 3 4 6 7 10

Explanation: The leftmost and rightmost node respectively of each level are
Level 0: 1(only one node is present at 0th level)
Level 1: 2 3
Level 2: 4 6
Level 3: 7 10
Problem approach

I used Level order approach to solve this question and the interviewer was quite satisfied with my approach and he was happy with my response.

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
12648 views
2 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Microsoft
5983 views
5 comments
0 upvotes