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

SDE - Intern

Amazon
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 7-8 months
Topics: Graphs, Trees, Object oriented programming, Stacks & Queues, Dynamic Programming
Tip
Tip

Tip 1 : Focus on more efficient approaches for each problem
Tip 2 : Study the basics in great detail
Tip 3 : Keep practicing as much as you can

Application process
Where: Campus
Eligibility: 5 CPI and above, No active backlogs
Resume Tip
Resume tip

Tip 1 : Have AWS or related skills on the resume
Tip 2 : Have proper knowledge about everything mentioned in your resume

Interview rounds

01
Round
Medium
Online Coding Interview
Duration120 minutes
Interview date26 Aug 2021
Coding problem2

The test was scheduled at 9 am on Amazon's personal test platform. 
The test consisted of:
7 Debugging Questions
2 Coding Questions
10 Mental Ability MCQs
HR Questions based on Amazon's Leadership Principles

The debugging questions were easy where we just had to select the option in which line the code snippet would be giving error. 
The HR questions were based on 16 leadership principles of amazon such as dive deep, think big

1. N-ary tree Level Order Traversal

Moderate
20m average time
80% success
0/80
Asked in companies
AmazonLinkedInArgano

You are given an N-ary tree where every node has at most ‘N’ child nodes. You need to find the level order traversal of this tree

Note:
Note that the level order traversal must not contain any null values, simply return the tree in level order.
Try solving now

2. Maximum Sum Of Nodes

Moderate
30m average time
70% success
0/80
Asked in companies
DunzoWalmartSprinklr

You have been given a binary tree with an integer value associated to each node. You are supposed to choose a subset of these nodes such that the sum of these chosen nodes is maximum. Keep in mind that no two of the chosen nodes must be adjacent to each other.

Note :
Two nodes are said to be adjacent to each other if they are directly connected to each other. This means that if a node is taken as part of the sum, then none of its children can be considered for the same and vice versa.
For example :
For the given binary tree

Example

Nodes used in consideration for maximum sum such that no two of them are adjacent are highlighted. Maximum sum of nodes = 1 + 1 + 1 + 4 + 5 = 12.
Try solving now
02
Round
Easy
Video Call
Duration45 minutes
Interview date30 Aug 2021
Coding problem2

This was the interview round which lasted for about 45 minutes. 
First the interviewer asked me to introduce myself and later asked 2 coding questions. I was asked to share my screen through Amazon chime on the link shared by interviewer.
The interviewer was very chill and he made me quite comfortable before starting the interview.

1. 0 1 Knapsack

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

A thief is robbing a store and can carry a maximal weight of W into his knapsack. There are N items and the ith item weighs wi and is of value vi. Considering the constraints of the maximum weight that a knapsack can carry, you have to find and return the maximum value that a thief can generate by stealing items.

Try solving now

2. Rat in a Maze

Easy
15m average time
85% success
0/40
Asked in companies
Samsung R&D InstituteDeutsche BankMakeMyTrip

You are given a starting position for a rat which is stuck in a maze at an initial point (0, 0) (the maze can be thought of as a 2-dimensional plane). The maze would be given in the form of a square matrix of order 'N' * 'N' where the cells with value 0 represent the maze’s blocked locations while value 1 is the open/available path that the rat can take to reach its destination. The rat's destination is at ('N' - 1, 'N' - 1). Your task is to find all the possible paths that the rat can take to reach from source to destination in the maze. The possible directions that it can take to move in the maze are 'U'(up) i.e. (x, y - 1) , 'D'(down) i.e. (x, y + 1) , 'L' (left) i.e. (x - 1, y), 'R' (right) i.e. (x + 1, y).

Note:
Here, sorted paths mean that the expected output should be in alphabetical order.
For Example:
Given a square matrix of size 4*4 (i.e. here 'N' = 4):
1 0 0 0
1 1 0 0
1 1 0 0
0 1 1 1 
Expected Output:
DDRDRR DRDDRR 
i.e. Path-1: DDRDRR and Path-2: DRDDRR

The rat can reach the destination at (3, 3) from (0, 0) by two paths, i.e. DRDDRR and DDRDRR when printed in sorted order, we get DDRDRR DRDDRR.
Problem approach

I was already prepared for this type of problem so I followed the approach mentioned in this article.to store the paths in a vector of strings
Link: https://www.codingninjas.com/codestudio/problem-details/rat-in-a-maze_1215030

Then for finding the efficient path I iterated through each element of the vector and counted the change from 'D' to 'R' and stored it into a temporary variable and compared with min variable initialized with -INT_MAX

If the current count is less than min count then min count = current count and the path is stored in a string variable
Return the string variable after all elements of vector has been iterated.

Further there was a discussion on time and space complexity.

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 - Intern
3 rounds | 3 problems
Interviewed by Amazon
2162 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 7 problems
Interviewed by Amazon
1068 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
1042 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Amazon
3501 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15499 views
1 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Microsoft
8186 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Microsoft
4914 views
2 comments
0 upvotes