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

SDE - 1

Amazon
upvote
share-icon
5 rounds | 10 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data structures, OOPS, Operating systems, DBMS, Networking
Tip
Tip

Tip 1 : Be confident while answering questions
Tip 2 : Make the interview conversational and Always keep a smiling face
Tip 3 : Ask something at the end of the interview which shows your interest in the company
Tip 4 : Prepare projects on the skills mentioned in the resume

Application process
Where: Company Website
Eligibility: Development skills and leadership principles
Resume Tip
Resume tip

Tip 1 : Mention projects and internships.
Tip 2 : Keep your resume short and crisp.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date22 May 2020
Coding problem2

Online test which can be attempted anytime between 22 May 2020, 06:00 AM and 25 May 2020, 01:00 AM

1. Evaluation of postfix expression

Easy
15m average time
90% success
0/40
Asked in companies
eBayDirectiSlice

An expression is called the postfix expression if the operator appears in the expression after the operands.

Example :

Infix expression: A + B  *  C - D 

Postfix expression:  A B + C D - *

Given a postfix expression, the task is to evaluate the expression. The answer could be very large, output your answer modulo (10^9+7). Also, use modular division when required.

Note:
1. Operators will only include the basic arithmetic operators like '*', '/', '+', and '-'.

2. The operand can contain multiple digits. 

3. The operators and operands will have space as a separator between them.

4. There won’t be any brackets in the postfix expression.
Problem approach

Create a stack to store operands
Scan the given expression
-> If the element is a number, push it into the stack
-> If the element is an operator, pop operands for the operator from the stack. Evaluate the operator and push the result back to the stack
In the end, the number in the stack is the final answer

Try solving now

2. Dice throws

Hard
35m average time
65% success
0/120
Asked in companies
MicrosoftDisney + HotstarShareChat

You are given D dice, each having F faces numbered 1 to F, both inclusive. The task is to find the possible number of ways to roll the dice together such that the sum of face-up numbers equal the given target S.

Note :
As the answer can be large, return your answer modulo 10^9  + 7.
Follow Up :
Can you solve this using not more than O(S) extra space?
Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date25 Jun 2020
Coding problem2

June 25 2020
Timing: 12:00 pm to 1:00 pm
This round was completely devoted to coding. I was asked to introduce myself and then 2 coding questions were asked.

1. Find first and last positions of an element in a sorted array

Easy
20m average time
80% success
0/40
Asked in companies
AmazonErnst & Young (EY)Google inc

You are given a non-decreasing array 'arr' consisting of 'n' integers and an integer 'x'. You need to find the first and last position of 'x' in the array.


Note:
1. The array follows 0-based indexing, so you need to return 0-based indices.
2. If 'x' is not present in the array, return {-1 -1}.
3. If 'x' is only present once in the array, the first and last position of its occurrence will be the same.


Example:
Input:  arr = [1, 2, 4, 4, 5],  x = 4

Output: 2 3

Explanation: The given array’s 0-based indexing is as follows:
 1      2     4     4     5
 ↓      ↓     ↓     ↓     ↓
 0      1     2     3     4

So, the first occurrence of 4 is at index 2, and the last occurrence of 4 is at index 3.
Problem approach

Firstly, I used binary search to find the element and the used linear search from that index to find the range
Interviewer asked me to optimise the solution.
Then, I used binary search 2 times to find lower bound and upper bound of element.

Try solving now

2. Maze With N doors and 1 Key

Moderate
15m average time
85% success
0/80
Asked in company
Amazon

You are given an 'N * N' 'MAZE' where some cells have a door while some do not and a key that can be used only once to open a door.

You need to find if there exists a path from the top-left cell to the bottom right cell of the maze provided only downward and rightward movements are allowed.

Note:

1. You have only one key. And a key once used is exhausted and no more available with you during the journey through that path in a maze.

2. A cell with value 1, means the door or path is closed. And you have to spend a key to open the door/ reach that cell.

3. A cell with value 0, means that the cell is free to move / door is always open.

4. Top left cell in the maze and bottom-right cell in the maze may also have a door.

5. Downwards movement: From cell (i, j) to (i, j+1).

6. Rightwards movement: From cell (i, j) to (i+1, j).
Try solving now
03
Round
Medium
Video Call
Duration60 minutes
Interview date9 Jul 2020
Coding problem1

9th July 2020
6:30PM to 7:30PM

1. Given an array of strings String 1 : a/b=1.6 String 2 : b/c=2.3 String 3 : p/q=2.8 ...String n: y/m. Then return the value of a/c. There can be more such queries like f/a or anything.

Problem approach

Created a directed and weighted graph with weights equal to the ratio value
Also direct the edges of graphs opposite ways by rearranging ratio
Traversed the graph and multiplied values in the way to get the answer.

04
Round
Easy
Video Call
Duration60 minutes
Interview date23 Jul 2020
Coding problem3

23-July 2020
4:00 PM to 5:00 PM
Coding questions + Several questions on computer fundamentals and networking were asked in a rapid-fire manner.

1. Selling Stock

Moderate
22m average time
0/80
Asked in companies
Goldman SachsPhonePeLinkedIn

You have been given stock values/prices for N number of days. Every i-th day signifies the price of a stock on that day. Your task is to find the maximum profit which you can make by buying and selling the stocks.

 Note :
You may make as many transactions as you want but can not have more than one transaction at a time i.e, if you have the stock, you need to sell it first, and then only you can buy it again.
Problem approach

Naive approach: A simple approach is to try buying the stocks and selling them on every single day when profitable and keep updating the maximum profit so far.

Efficient approach: Find the local minima and store it as starting index. If not exists, return.
Find the local maxima. and store it as ending index. If we reach the end, set the end as ending index.
Update the solution (Increment count of buy sell pairs)
Repeat the above steps if end is not reached.

Try solving now

2. Modification to above question: Modify the code for 'k' number of transactions instead of any number of transactions. I was asked for time and space complexity for each.

Problem approach

Stored all profits
Sorted in reverse order
Sum k most profitable values

3. Network And Threads

If we have our services over several locations, how do we reduce the latency for retrieving data?

What are the types of cache?

Difference between thread and process. Which one is light-weight among thread and process and why?

What happens when we type a URL on our browser?

How servers handle a large amount of load?

Networks among systems are centralized or peer to peer?

05
Round
Medium
Video Call
Duration60 minutes
Interview date6 Aug 2020
Coding problem2

6- Aug 2020
3:00 PM to 4:00 PM
Resceduled to: @5:30 PM
Projects, Fundamentals check, Behavioral, Coding

1. Project Questions

Personal projects + projects completed during internships.

Difference between list and tuple

Difference between deep copying and shallow copying

Overloading and overriding, given 2 examples of overriding , tell why or why not overriding concept will fail here.

Tell me about a time when you have faced some challenging situation in your past (during any project or internship) and how I tackled the situation.

2. Count Ways

Easy
24m average time
81% success
0/40
Asked in companies
FacebookGoldman SachsAmazon

You have been given a directed graph of 'V' vertices and 'E' edges.

Your task is to count the total number of ways to reach different nodes in the graph from the given source node ‘S’. A way is called as different from others if the destination node or used edges differ.

As the total number of such ways can be large, print the total ways modulo 10 ^ 9 + 7.

Note:

1. Include the source node as a destination also.
2. There are no cycles in the given graph.
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
2294 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