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

SDE - 1

Amazon
upvote
share-icon
5 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 Months
Topics: Data structures and Algorithms, OOPS concepts, Operating Systems, Trees, Binary Search, Dynamic Programming
Tip
Tip

Tip 1 : Consistently practice DSA questions.
Tip 2 : Regularly participating in contests held on competitive programming platforms(codeforces, codechef etc) will definitely help in developing an aptitude for problem solving and also improves speed to solve such questions
Tip 3 : Revise basic questions of OOPS and OS like polymorphism, race condition, semaphores, deadlock etc.

Application process
Where: Referral
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Only mention your most important skills and achievements to keep it short and precise.
Tip 2 : Have a sound knowledge of all projects mentioned.

Interview rounds

01
Round
Easy
Online Coding Test
Duration90 minutes
Interview date7 Sep 2021
Coding problem2

It consisted of two sections - first section had two coding questions and second section had to submit explanations for your solutions. One of the question was a simple spiral traversal of a two-dimensional matrix. Other was a straightforward binary search question. Level of this round was very easy.

1. Spiral Matrix

Easy
15m average time
80% success
0/40
Asked in companies
WalmartOracleApple

You are given a 2-D array 'MATRIX' of dimensions N x M, of integers. You need to return the spiral path of the matrix.

Example Of Spiral Path:

Spiral path of a matrix

Try solving now

2. Covid Vaccination

Moderate
0/80
Asked in companies
OracleAmerican ExpressShareChat

We are suffering from the Second wave of Covid-19. The Government is trying to increase its vaccination drives. Ninja wants to help the Government to plan an effective method to help increase vaccination following safety measures. Time is running out. Can you help the nation?

You are given two positive integers: ‘n,’ ‘maxVaccines’ denoting the number of days for which this vaccination drive will go on and the total number of vaccines available for the drive, respectively. You have to find the number of vaccines administered each day. You are also given a number ‘dayNumber,’ and we are interested to know the maximum number of vaccines that can be administered on ‘dayNumber’ th day.

The rules of the vaccination drive :

1. There should be a positive number of vaccines administered each day during the vaccination drive.

2. The absolute difference between the number of vaccines in two consecutive days should not exceed 1.

3. The sum of all the elements of the vaccines array does not exceed maxVaccines, that is, you cannot administer more vaccines than what is provided to you.

4. Vaccines administered on ‘dayNumber’ th day should be maximized.

Try solving now
02
Round
Medium
Telephonic
Duration60 Minutes
Interview date26 Nov 2021
Coding problem1

This was the first F2F interview. He started by asking me about the work I did in my previous company. He seemed genuinely interested in knowing the project I was working on. Also asked me some technical questions related to that project. Asked a couple of questions related to the skills I had mentioned on my resume like AWS lambda etc. I was able to answer all question correctly except one. Then I was given one coding task to solve. I was required to start coding instantly and explain what I was doing simultaneously. Other than the coding task, interviewer asked me a couple of behavioral questions

1. OS Question

Static and Dynamic Memory allocation

Problem approach

The problem statement was very vague, so I started asking questions. I asked him about what's the input and what exactly is expected to do with it. He explained further that I can assume things that are not given in the problem statement. He also mentioned that he will be judging me based on those assumptions. I was a little surprised but then I started creating the problem statement myself and also explained him what I was doing. He gave me hints wherever I was making wrong assumptions. Basically I assumed there was a finite memory available for processor and there is a stream of process with different memory requirements. It could be allocation or deallocation. I was going for a non-contiguous memory allocation and was thinking of using linked list for that purpose but the interviewer clarified that I need to implement a contiguous memory allocation. I used an array and for each input process I traverse the memory array and find a contiguous subarray of required size and allocation each memory unit of that subarray to that process.

03
Round
Easy
Telephonic
Duration60 Minutes
Interview date26 Nov 2021
Coding problem2

Asked me two coding questions.

1. Binary strings with no consecutive 1s

Moderate
25m average time
65% success
0/80
Asked in companies
Wells FargoAmazonGoogle inc

You have been given an integer 'N'. Your task is to generate and return all binary strings of length 'N' such that there are no consecutive 1's in the string.


A binary string is that string which contains only ‘0’ and ‘1’.


For Example:
Let ‘N'=3, hence the length of the binary string would be 3. 

We can have the following binary strings with no consecutive 1s:
000 001 010 100 101 
Problem approach

I calculated number of strings without consecutive 1s and then subtract it from total number of strings. At first I created a two state DP, then interviewer asked me if I can reduce its space complexity. I arrived to a one-state DP solution but he asked me to reduce it further and I was able to do it with a temporary variable.

Try solving now

2. System Design Question

There are election in your country. Write two functions - First method will take the state as input and will return  the name of the party that's winning in that state. Second function will take party as input parameter and will return all the states in which that party is winning.

Problem approach

I created classes for Party and States and declared some member variables. For state, I maintained a variable for current number of maximum votes, update it when each vote is cast to a party. Maintained a paired set of state and its vote in that state. That paired set mapped to each state can be used to answer first query in O(logn). I was not able to implement second query due to time constraint but tried to explain my approach to the interviewer in a limited time.

04
Round
Medium
Telephonic
Duration60 Minutes
Interview date26 Nov 2021
Coding problem1

This was HM round. He asked me some behavioral questions which seemed like a formality. He asked me some questions on OOPS and OS. Then gave me a coding question. Wanted me to explain the approach and run it. I asked him a couple of question at the end of interview related to the work and tech stack used by the team.

1. Number with maximum probability

Easy
10m average time
90% success
0/40
Asked in companies
AmazonCapegemini Consulting India Private Limited

One day Ninja Misha and Ninja Andrew (students of the Ultimate Ninja Ankush) were playing a very simple game. First, each player chooses an integer in the range from 1 to ‘N’. Let's assume that Ninja Misha chose the number ‘numMisha’, and Ninja Andrew chose the number ‘numAndrew’.

Then, by using a random generator they choose a random integer ‘C’ in the range between 1 and ‘N’ (any integer from 1 to ‘N’ is chosen with the same probability), after which the winner is the player whose number was closer to ‘C’. The boys agreed that if ‘numMisha’ and ‘numAndrew’ are located on the same distance from ‘C’, Misha wins.

Andrew wants to win very much, so he asks you to help him. You know the number selected by Ninja Misha, and the number ‘N’. You need to determine which value Ninja Andrew must choose, so that the probability of his victory is the highest possible.

More formally, you need to find such integer ‘numAndrew’ (1 ≤ ‘numAndrew’ ≤ n), that the probability that

| ‘C’ - ‘numAndrew’| < | ‘C’ - ‘numMisha’ | is maximal, where ‘C’ is the equi-probably chosen integer from 1 to ‘N’ (inclusive).

For example:

Given ‘N’ = 4, ‘numMisha’ = 2.
The options available to us are 1, 3, and 4. In this case, choosing 3 would be most optimal because the probability that Andrew wins is 2 / 4, whereas if he chooses 1 or 4 it would be 1 / 4.
Problem approach

I had never seen this question so I came up with a simple and inefficient solution at first. Then he gave me a hint and I was able to improve my solution significantly. I was able to come up with the exact solution and explained it to him. He expected me to code my solution in the remaining time. I wasn't feeling like coding the solution even though I knew it because of the time constraint. He encouraged me to type it but I wasn't able to complete it in time. He seemed convinced with my verbal explanation though.

Try solving now
05
Round
Medium
Telephonic
Duration60 Minutes
Interview date7 Dec 2021
Coding problem1

He asked me some questions about my role in previous organization. Asked me the architecture of the systems I have worked on. Then asked me a coding question.

1. Search In A Row Wise And Column Wise Sorted Matrix

Moderate
15m average time
80% success
0/80
Asked in companies
NoBrokerOracleGoldman Sachs

You are given an 'N * N' matrix of integers where each row and each column is sorted in increasing order. You are given a target integer 'X'.


Find the position of 'X' in the matrix. If it exists then return the pair {i, j} where 'i' represents the row and 'j' represents the column of the array, otherwise return {-1,-1}


For example:
If the given matrix is:
[ [1, 2, 5],
  [3, 4, 9],
  [6, 7, 10]] 
We have to find the position of 4. We will return {1,1} since A[1][1] = 4.
Problem approach

I was not able to solve it in the most efficient way. I explained naive approaches to him. Then came up with a binary search solution. Applied binary search to row and then column. Complexity was O(logn * logm).

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
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
5983 views
5 comments
0 upvotes