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

SDE - 1

Amazon
upvote
share-icon
3 rounds | 11 Coding problems

Interview preparation journey

expand-icon
Journey
I was advised by my seniors to practice DSA from the very starting of B.Tech but I did not took that seriously. Honestly speaking, I regretted not taking their advice and in third year I started doing coding and I had to increase practice hours because I started late. But by the end of Third year, I was confident in both DSA and development but even then, I kept on revising the concepts.
Application story
I applied through their website. After almost a week, HR called and confirmed all details and then a week later, interviews were scheduled on Zoom to evaluate on basis of DSA and System design mainly.
Why selected/rejected for the role?
Every thing was fine but in the third round, I was asked a question related to shell scripting which I was not able to answer correctly. It required some deep knowledge. So always understand every concept in depth and mention only those things in resume that you are confident about.
Preparation
Duration: 6 months
Topics: Computer Fundamentals, Data Structures and Algorithms
Tip
Tip

Tip 1 : Participate in live contests on websites like Codechef, Codeforces, etc as much as possible.
Tip 2 : Practice previous interview questions from LeetCode, GeeksForGeeks.
Tip 3 : Revise Computer Science subjects like DBMS, OOPS thoroughly.

Application process
Where: Company Website
Eligibility:
Resume Tip
Resume tip

Only write those things in the resume which you are confident of and keep practicing.

Interview rounds

01
Round
Easy
Online Coding Test
Duration90 minutes
Interview date15 Aug 2020
Coding problem3

This is a written round on paper for everyone. Three coding questions were given. Two out of three must be correct covering every single edge case to qualify for the next round. Only the most optimal solution was to be considered. 

1. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
MicrosoftAccentureSAP Labs

You are given an array 'arr' of length 'n', consisting of integers.


A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.


Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.


The sum of an empty subarray is 0.


Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Problem approach

I used the Kadane algorithm to solve this question and wrote a clean code with which could work on negative numbers also.

Try solving now

2. Connect n ropes with minimum cost

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

You have been given 'N' ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal to sum of their lengths. We need to connect the ropes with minimum cost.

The test-data is such that the result will fit into a 32-bit integer.

Problem approach

I solved this question using a priority queue(max heap) by inserting all elements in the priority queue and then taking the maximum two out of them and pushing their sum again to the priority queue.

Try solving now

3. Left View of Binary Tree

Moderate
30m average time
60% success
0/80
Asked in companies
MicrosoftSalesforceJP Morgan

You have been given a Binary Tree of 'n' nodes, where the nodes have integer values



Example :
If the input tree is as depicted in the picture: 

alt text

The Left View of the tree will be:  2 35 2 
Problem approach

This was again a very standard question and solved it using recursion.

Try solving now
02
Round
Easy
Face to Face
Duration50 minutes
Interview date15 Aug 2020
Coding problem2

This was face to face interview round.

1. Triplets in Binary Tree

Easy
15m average time
85% success
0/40
Asked in companies
AmazonPaytm (One97 Communications Limited)Adobe

You have been given a Binary Tree of integers and an integer 'X'. Find all the triplets in the tree whose sum is strictly greater than 'X'. The nodes in the triplet must hold the relationship of grandparent-parent-child.

For example:
For the given binary tree and X = 9

alt text

{1, 3, 6} is a valid triplet because 6 is a node whose parent is 3 and grand-parent is 1. Also, the sum of these nodes is 1 + 3 + 6 = 10 which is strictly greater than X = 9.
Problem approach

I thought of recursive preorder traversal and then tried storing elements in a stack but could not solve this question. Then the interviewer moved to the next question.

Try solving now

2. Loot Houses

Moderate
26m average time
0/80
Asked in companies
CognizantTata Consultancy Services (TCS)Paytm (One97 Communications Limited)

A thief wants to loot houses. He knows the amount of money in each house. He cannot loot two consecutive houses. Find the maximum amount of money he can loot.

Problem approach

I told the interviewer dynamic programming based solution on either including the current element to current sum or excluding the current element and then he asked me to write its code and I gave properly commented code for this.

Try solving now
03
Round
Easy
Face to Face
Duration60 minutes
Interview date15 Aug 2020
Coding problem6

This was face to face interview round.

1. Basic HR Questions

Tell me about yourself.

Problem approach

 I gave him my basic introduction with previous experience and skills.

2. Basic HR Questions

Why are you looking for a change? You recently joined a company and now again you are giving interviews?

Problem approach

 I simply gave the reason that amazon is better than my previous company so wanted to join it.

3. Basic HR Questions

Tell me the difference between Mutex and Semaphores with a real-life example. (Learn)

Problem approach

Gave him a proper definition of both and then gave him an example based on classical OS problems.

4. Basic HR Questions

What is Normalization, and why it is done? (Learn)

Problem approach

Gave him a basic definition and real-life example of a database of a store.

5. Basic HR Questions

What is REST API? (Learn)

Problem approach

I told him the definition of REST and then explained it through an example of my project in which REST API was used. 

6. Basic HR Questions

Write a shell script to parse a log file. (Learn)

Problem approach

I mentioned that I am familiar with the shell scripting in my resume but could not able to write the script as I didn’t remember the syntax and that’s a learning for me that don’t mention anything about anything if you are not very good about it.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

Which operator is used for exponentiation in Python?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Amazon
1447 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
1468 views
1 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Amazon
723 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
3204 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
51830 views
5 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Samsung
11458 views
2 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Google
10155 views
0 comments
0 upvotes