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

SDE - 1

Amazon
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 12 months
Topics: Java, OOPS, Data Structures, Algo, Graph, DP, Recursion, BFS, DFS
Tip
Tip

Tip 1 : Solved around 500+ problems on DSA
Tip 2 : Well versed with basics
 

Application process
Where: Referral
Eligibility: 7 cgpa
Resume Tip
Resume tip

Tip 1 : Use proper and clean format
Tip 2 : Highlight all the tech used in projects

Interview rounds

01
Round
Easy
Online Coding Interview
Duration90 minutes
Interview date19 Mar 2022
Coding problem2

1. Count Substrings With K Ones

Moderate
23m average time
0/80
Asked in companies
OlaMedia.netAmazon

You are given a binary array 'arr' of length 'N' and an integer 'k'. Return the number of subarrays having the count of 1's equal to ‘k’.


Example :
Let the array 'arr' be: [1, 0, 1].
Let ‘k’ be: 1

Then the subarrays having the number of ones equal to ‘k’ will be: [1], [1,0], [0,1], [1].
Try solving now

2. Two Sum

Easy
10m average time
90% success
0/40
Asked in companies
MeeshoAdobeInfo Edge India (Naukri.com)

You are given an array of integers 'ARR' of length 'N' and an integer Target. Your task is to return all pairs of elements such that they add up to Target.

Note:

We cannot use the element at a given index twice.

Follow Up:

Try to do this problem in O(N) time complexity. 
Problem approach

-We need to find 2 numbers a, b so that a + b = target.
-We need a HashMap datastructure to store elements in the past, let name it seen.
-The idea is that we iterate b as each element in nums, we check if we found a (where a = target - b) in the past.
-If a exists in seen then we already found 2 numbers a and b, so that a + b = target, just output their indices.
-Else add b to the seen.

Try solving now
02
Round
Easy
Video Call
Duration75 minutes
Interview date7 Apr 2022
Coding problem2

Mainly DSA based round consisting of 2 questions.

1. Group Anagrams Together

Moderate
0/80
Asked in companies
Dell TechnologiesPayPalArcesium

You have been given an array/list of strings 'STR_LIST'. You are supposed to return the strings as groups of anagrams such that strings belonging to a particular group are anagrams of one another.

Note :
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase. We can generalize this in string processing by saying that an anagram of a string is another string with the same quantity of each character in it, in any order.
Example:
{ “abc”, “ged”, “dge”, “bac” } 
In the above example the array should be divided into 2 groups. The first group consists of { “abc”, “bac” } and the second group consists of { “ged”, “dge” }.
Problem approach

First, get a copy of "string". Let's name this copy "sortedStrs".
Second, sort all strings in "sortedStrs".
And we have a hash map unordered_map> map.
Every string in "sortedStrs" will be recorded in this hash map with its position.
In the second loop, we traverse this hash map. And find each value of which size is larger than 1. Then find the original string in "string".

Try solving now

2. Max Stack

Easy
15m average time
85% success
0/40
Asked in companies
AmazonUberInnovaccer

You have to implement a special data structure “MAX_STACK” it would be a hybrid data structure of max heap and stack. Basically, it will have all the functionality of a stack in addition to it the max stack should also give max element in a stack in O(1). you have to implement the following functions:

specialPush(value): should push the value in the stack in O(1).
specialPop( ) : should pop the last element from the stack in O(1).
specialTop( ): should give the element at the top of the stack in O(1).
specialMax( ): should give the maximum element from all the elements that are currently present in the stack in O(1).

In addition it tries to construct it only using the stack data structure.

Four types of queries denote these operations:

Type 1 : for specialPush(value) operation.
Type 2 : for specialPop( ) operation.
Type 3 : for specialTop( ) operation.
Type 4 : for specialMax( ) operation.
Problem approach

make a pair class that will contains current element and max. value in the stack at the time of inserting in the stack.
now make the stack of type pair and store the elements while updating the max element also.

Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date29 Apr 2022
Coding problem1

I was asked in depth details of my project(around 35 minutes) and then a coding quesion

1. Spiral Matrix

Easy
0/40
Asked in companies
GE (General Electric)AmazonSalesforce

You are given a N x M matrix of integers, return the spiral path of the matrix

Example Of Spiral Path

Spiral Path

Problem approach

Initially, we move by the RIGHT direction.
If we meet the boundary or we meet visited cell then we change to the next direction.
Directions are in order [RIGHT, DOWN, LEFT, TOP].
We iterate m*n times to add m*n cells to our anser.

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
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