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

SDE - 1

Amazon
upvote
share-icon
3 rounds | 7 Coding problems

Interview preparation journey

expand-icon
Journey
I kept practicing DSA and CS fundamentals from the 3rd year of Engineering. Along with it, I was also learning web development and I made some good projects. Amazon was the first company that visited our campus. I left no stone unturned, went through the previous interview experiences, polished my skills and eventually cracked the very first interview that I sat down for in my life.
Application story
This company visited to my campus for the placement. We just had to upload resume and fill all details in the form. First, they took the online assessment. Later, they called us for the interview rounds.
Why selected/rejected for the role?
The basic reason for my selection was my strong knowledge of core DSA fundamentals and my problem-solving ability. I was selected because I had developed skills like DSA, problem-solving, and Logical building ability. I also prepared for the HR round because all the questions asked in the HR round I was already familiar with them. I was able to pick the hints given by interviewer and build my answers based on the hints provided.
Preparation
Duration: 6 months
Topics: Basic Computer Science background
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: Campus
Eligibility: 6 CGPA
Resume Tip
Resume tip

Add projects and Internships if you have done any and add only those things which you really know.

Interview rounds

01
Round
Easy
Online Coding Test
Duration90 minutes
Interview date28 Aug 2019
Coding problem2

This was MCQ+Coding round.

1. Coding MCQs

There were a total of 19 MCQs.

Topics: Trees(5), semaphores(3), deadlocks(5) and algorithms(6)

 

2. Anagram Pairs

Moderate
30m average time
60% success
0/80
Asked in companies
CiscoThought WorksInfosys

Check if two strings are anagram or not.

Problem approach
  • I simply used hashing to solve this problem by checking the frequency of characters in both strings.
Try solving now
02
Round
Easy
Face to Face
Duration90 minutes
Interview date29 Aug 2019
Coding problem2

This was face to face interview round.

1. Next greater number with same set of digits

Moderate
32m average time
70% success
0/80
Asked in companies
AdobeAmazon

Given a number n, find the smallest number that has same set of digits as n and is greater than n. If n is the greatest possible number with its set of digits, then print “not possible”.

Examples:

For simplicity of implementation, we have considered input number as a string.

 

Input:  n = "218765"

Output: "251678"

 

Input:  n = "1234"

Output: "1243"

 

Input: n = "4321"

Output: "Not Possible"

 

Input: n = "534976"

Output: "536479"

Problem approach
  • I have done this question earlier so just use already built algorithm which traverses the number from the back.
Try solving now

2. Circular Move

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

Given a sequence of moves for a robot, check if the sequence is circular or not. A sequence of moves is circular if first and last positions of robot are same. A move can be on of the following.

 

 G - Go one unit

 L - Turn left

 R - Turn right  

Examples:

 

Input: path[] = "GLGLGLG"

Output: Given sequence of moves is circular  

 

Input: path[] = "GLLG"

Output: Given sequence of moves is circular

Problem approach
  • I simply started from 0,0 point and if the robot again reaches to 0,0 point then motion is circular. I explained my whole approach on paper to the interviewer.
Try solving now
03
Round
Easy
Face to Face
Duration90 minutes
Interview date29 Aug 2019
Coding problem3

This was face to face interview round.

1. Number of islands

Moderate
34m average time
60% success
0/80
Asked in companies
AmazonUberApple

Given a boolean 2D matrix, find the number of islands. A group of connected 1s forms an island. For example, the below matrix contains 5 islands

 

Example:

 

Input : mat[][] = {{1, 1, 0, 0, 0},

                  {0, 1, 0, 0, 1},

                  {1, 0, 0, 1, 1},

                  {0, 0, 0, 0, 0},

                  {1, 0, 1, 0, 1}  

Output : 5

This is a variation of the standard problem: “Counting the number of connected components in an undirected graph”.

 

 

Before we go to the problem, let us understand what is a connected component. A connected component of an undirected graph is a subgraph in which every two vertices are connected to each other by a path(s), and which is connected to no other vertices outside the subgraph.

For example, the graph shown below has three connected components.

Problem approach
  • Simply gave the interviewer, Depth-first search based approach by visiting adjacent connected components and counting the number of islands. The interviewer was satisfied with my approach.
Try solving now

2. Reverse stack .

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

Reverse stack using recursion.

Problem approach
  • I told him proper algorithm with code on paper to the interviewer. He asked me to dry run the algorithm which I did by taking an example of stack.
Try solving now

3. Print leftmost and rightmost nodes of a Binary Tree

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

Given a Binary Tree, Print the corner nodes at each level. The node at the leftmost and the node at the rightmost.

For example, output for following is 15, 10, 20, 8, 25.

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

Which collection class forbids duplicates?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Amazon
1406 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
1457 views
1 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Amazon
705 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Amazon
3069 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
51680 views
5 comments
0 upvotes
company logo
SDE - 1
4 rounds | 8 problems
Interviewed by Samsung
11432 views
2 comments
0 upvotes
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Google
10121 views
0 comments
0 upvotes