Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Amazon interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Amazon
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 Months
Topics: Dynamic Programming, Graphs, LinkedList, Trees, BIt Manipulation
Tip
Tip

Tip 1 : I believe for cracking interviews data structures and algorithms is the only thing that needs to be practiced. 
Tip 2 : Rather than focusing on the number of questions focus on the quality of questions and different approaches for same question.
Tip 3 : The company wants to measure your problem solving skills not the number of submissions you have made on different platforms.

Application process
Where: Campus
Eligibility: Must be from CSE department, CGPA above 6
Resume Tip
Resume tip

Tip 1 : Make sure there are no grammatical errors. 
Tip 2 : Whatever projects you are listing on your resume, make sure you have in depth knowledge about those projects even if they are borrowed from somewhere else.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration145 Minutes
Interview date15 Sep 2020
Coding problem2

the online round was conducted around 5 pm. Round 1 was the initial online round. It was made up of 4 sections - a code debugging section (20 minutes), a coding test (70 minutes), a workstyles assessment (20 minutes) and a reasoning ability section (35 minutes). For me the level of this online test was way below standard. Code debugging and aptitude part were very very easy. The coding questions that I got were also easy but there were a couple of good questions that other students got. But overall, the level was easy. I think the selection was made totally based on the workstyle assessment. Amazon focuses largely on its 14 leadership principles. Make sure to incorporate these principles in your answers. Again, do not start lying blatantly. Make smart and well thought out lies.

1. Subtree of Another Tree

Easy
10m average time
90% success
0/40
Asked in companies
MicrosoftFacebookAmazon

Given two binary trees T and S, check whether tree S has exactly the same structure and node values with a subtree of T, i.e., check if tree S is a subtree of the tree T.

A subtree of a tree T is a tree S consisting of a node in T and all of its descendants in T. The subtree corresponding to the root node is the entire tree; the subtree corresponding to any other node is called a proper subtree.

Try solving now

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

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

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.
Try solving now
02
Round
Easy
Video Call
Duration120 minutes
Interview date7 Nov 2020
Coding problem3

This was the first technical interview. This is where it started to feel like Amazon. At first the interviewer gave his introduction, then I introduced myself and afterwards we moved to the coding part. He gave me three questions out of which I coded the solution for two and gave the approach for the third one. He was so helpful throughout the entire interview. I was stuck at the first questions and speaking out loud helped me there as he instantly realized what mistake I was making and quickly pointed it out. Out of all the interviews it was my best experience so far. For technical interviews at amazon you will have to prepare everything as they asked questions on almost all data structures. So, I would suggest you to do as much questions on leetcode as possible. Medium level questions would be enough according to me no need to do a lot of high-level questions. But if you are associated with pep coding then just do the class questions sincerely and you are good to go. Also, one thing I would like to add is to make sure that the variable names that you use are meaningful. Both my interviewers were very satisfied with my code and one of them even thanked me for writing clean code.

1. Maximum Of All Subarrays Of Size k

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

You are given an array “A” of N integers. Your task is to find the maximum element in all K sized contiguous subarrays from left to right.

For Example:
If A = [3, 2, 3], and K = 2.
Then max of [3, 2] = 3 and max of [2, 3] = 3
So, the answer will be [3, 3]

If A = [3, 2, 3, 5, 1, 7] and K = 3.
Then max of [3, 2, 3] = 3 
Then max of [2, 3, 5] = 5 
Then max of [3, 5, 1] = 5 
Then max of [5, 1, 7] = 7 
So  the answer will be [3, 5, 5, 7]
Follow Up :
Can you solve the problem in O(N) time complexity and O(K) space complexity?
Try solving now

2. Chocolate Problem

Moderate
15m average time
85% success
0/80
Asked in companies
AdobePaytm (One97 Communications Limited)JP Morgan

Given an array/list of integer numbers 'CHOCOLATES' of size 'N', where each value of the array/list represents the number of chocolates in the packet. There are ‘M’ number of students and the task is to distribute the chocolate to their students. Distribute chocolate in such a way that:

1. Each student gets at least one packet of chocolate.

2. The difference between the maximum number of chocolate in a packet and the minimum number of chocolate in a packet given to the students is minimum.

Example :

Given 'N' : 5 (number of packets) and 'M' : 3 (number of students)

subsequence

And chocolates in each packet is : {8, 11, 7, 15, 2}

All possible way to distribute 5 packets of chocolates among 3 students are -

( 8,15, 7 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 8, 15, 2 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’ 
( 8, 15, 11 ) difference of maximum-minimum is ‘15 - 8’ = ‘7’
( 8, 7, 2 ) difference of maximum-minimum is ‘8 - 2’ = ‘6’
( 8, 7, 11 ) difference of maximum-minimum is ‘11 - 7’ = ‘4’
( 8, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’
( 15, 7, 2 ) difference of maximum-minimum is ‘15 - 2’ = 13’
( 15, 7, 11 ) difference of maximum-minimum is ‘15 - 7’ = ‘8’
( 15, 2, 11 ) difference of maximum-minimum is ‘15 - 2’ = ‘13’
( 7, 2, 11 ) difference of maximum-minimum is ‘11 - 2’ = ‘9’

Hence there are 10 possible ways to distribute ‘5’ packets of chocolate among the ‘3’ students and difference of combination (8, 7, 11) is ‘maximum - minimum’ = ‘11 - 7’ = ‘4’ is minimum in all of the above.
Try solving now

3. First Repeated Character

Moderate
30m average time
70% success
0/80
Asked in companies
Goldman SachsDelhiveryExpedia Group

You are given a string 'STR' of lowercase English alphabets. You need to find the repeated character present first in the string.

Example:
If the string is: “abccba”, then the first repeated character is ‘c’, but the repeated character that is present first in the string is ‘a’. You need to print ‘a’.
Note:
Keep in mind that you need to print the repeated character that is present first in the string and not the first repeating character.
Try solving now
03
Round
Medium
Video Call
Duration90 Minutes
Interview date7 Nov 2020
Coding problem1

This was the second technical round. In this round the emphasis was on time and space complexities. Luckily, I again got a very friendly interviewer who helped me a lot during the interview. The interview started with the introductions then we discussed about one of my projects. I was given only one question to solve which I did with the help of interviewer. There is not much difference between the technical round except the slightly greater emphasis on complexities in the second round.

1. Snake and Ladder

Moderate
30m average time
60% success
0/80
Asked in companies
CiscoLinkedInAmerican Express

You have been given a Snake and Ladder Board with 'N' rows and 'N' columns with the numbers written from 1 to (N*N) starting from the bottom left of the board, and alternating direction each row.

For example

For a (6 x 6) board, the numbers are written as follows:

6*6 Board

You start from square 1 of the board (which is always in the last row and first column). On each square say 'X', you can throw a dice which can have six outcomes and you have total control over the outcome of dice throw and you want to find out the minimum number of throws required to reach the last cell.
Some of the squares contain Snakes and Ladders, and these are possibilities of a throw at square 'X':
You choose a destination square 'S' with number 'X+1', 'X+2', 'X+3', 'X+4', 'X+5', or 'X+6', provided this number is <= N*N.
If 'S' has a snake or ladder, you move to the destination of that snake or ladder.  Otherwise, you move to S.
A board square on row 'i' and column 'j' has a "Snake or Ladder" if board[i][j] != -1. The destination of that snake or ladder is board[i][j].
Note :
You can only take a snake or ladder at most once per move: if the destination to a snake or ladder is the start of another snake or ladder, you do not continue moving - you have to ignore the snake or ladder present on that square.

For example, if the board is:
-1 1 -1
-1 -1 9
-1 4 -1
Let's say on the first move your destination square is 2  [at row 2, column 1], then you finish your first move at 4 [at row 1, column 2] because you do not continue moving to 9 [at row 0, column 0] by taking the ladder from 4.

A square can also have a Snake or Ladder which will end at the same cell.
For example, if the board is:
-1 3 -1
-1 5 -1
-1 -1 9
Here we can see Snake/Ladder on square 5 [at row 1, column 1] will end on the same square 5.
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 is a DDL command in SQL?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by Amazon
1167 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 7 problems
Interviewed by Amazon
406 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
418 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Amazon
615 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
12330 views
1 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Microsoft
7423 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Google
5248 views
1 comments
0 upvotes