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: Linked List, Binary Search, Dynammic Programming, Two pointer, Hashmap and heap,OOPS, Stack and Queues
Tip
Tip

Tip 1 : Try to cover all most common questions of all topics(atleast 300+ questions)
Tip 2 : Try to see as many interview experience as possible of the company you are applying.
Tip 3 : Try to give atleast 2-3 mock interview before main interview

Application process
Where: Campus
Eligibility: 7 CGPA with no Backlogs.
Resume Tip
Resume tip

Tip 1 : Try to put competitive programming ranks if possible or Coding Ninjas Certificate, or any proof that you do programming regularly.
Tip 2 : Try to add atleast 2 projects, and study about those projects well/

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 Minutes
Interview date29 Sep 2020
Coding problem2

It was in the evening, test consists of technical MCQ as well as Aptitude quesitons. There were debugging round of 7 questions and 2 coding questions (medium-hard leetcode level).

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. Clone Linked List with Random Pointer

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

Given a linked list having two pointers in each node. The first one points to the next node of the list, however, the other pointer is random and can point to any node of the list or null. The task is to create a deep copy of the given linked list and return its head. We will validate whether the linked list is a copy of the original linked list or not.

A deep copy of a Linked List means we do not copy the references of the nodes of the original Linked List rather for each node in the original Linked List, a new node is created.

For example,

example

Random pointers are shown in red and next pointers in black.

Try solving now
02
Round
Medium
Video Call
Duration40 minutes
Interview date21 Nov 2020
Coding problem2

It was in Morning. Interviewer was SDE-2 and was experienced.

1. Flip Bit to Win

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

Ninjas are often known for their stealth execution and accuracy to get the job done right. While honing their art of moving through dense forests stealthily, they need the maximum number of continuous trees one after the other for practicing.

Trees are represented by 1s and empty places by 0s (basically a binary representation of a given integer). You are also given an extra tree which you can plant at any empty place (i.e. you can flip one of the zeroes in the binary representation to 1). The tree should be planted such that the maximum number of consecutive trees is maximized.

Your task is to report the maximum number of consecutive trees after plantation.

Note:

You may also choose not to plant that extra tree at all.
For Example:
Input: 54
Output: 5

The binary representation of 54 is 110110.
After flipping the third bit from the left, we get consecutive 5 bits. i.e. 111110.
Try solving now

2. Saving Money

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

Ninja likes to travel a lot, but at the same time, he wants to save as much money as possible.


There are ‘N’ Stations connected by ‘M’ Trains. Each train that he boards starts from station ‘A’ and reaches destination station ‘B’ with a ticket price ‘P’.


Your task is to return the cheapest price from the given ‘source’ to ‘destination’ with up to ‘K’ stops. If there is no such route, return ‘-1’.


For example:
Input:
5 6
0 1 10
0 2 10
0 3 40
1 4 10
2 4 20
4 3 5
0 3 40 

There are three ways to reach station ‘3’ from station ‘0’. The first path is 0->1->4->3, which will cost us 10+ 10+ 5= 25 and the second path 0->2->4->3 will cost us, 10+ 20+ 5 = 35, and the third path 0->3 will cost us 40. 

We can’t take the first path since K = 1 and in this path, we are taking 2 stops, at station ‘1’ and station ‘4’. 

Similarly, there are 2 stops in the second path. Hence we’ll finally choose the 3rd path i.e. 0->3, which is colored in blue.
Try solving now
03
Round
Easy
Video Call
Duration60 Minutes
Interview date21 Nov 2020
Coding problem2

It was in evening. Interviewer was really energetic and funny.

1. Row with Maximum 1's

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

You have been given a non-empty grid ‘mat’ with 'n' rows and 'm' columns consisting of only 0s and 1s. All the rows are sorted in ascending order.

Your task is to find the index of the row with the maximum number of ones.

Note: If two rows have the same number of ones, consider the one with a smaller index. If there's no row with at least 1 zero, return -1.


Example:

Input: 'n' = 3, 'm' = 3, 'mat' = [[1, 1, 1], [0, 0, 1], [0, 0, 0]]

Output: 0

Explanation: The row with the maximum number of ones is 0 (0 - indexed).
Try solving now

2. Knight Probability in Chessboard

Moderate
20m average time
80% success
0/80
Asked in companies
Goldman SachsPhone PeAmazon

You are given an N x N chessboard and a knight. On a chessboard, the knight can supposedly move in 8 different positions from its original position i.e. if the knight is originally at (i,j) then it can move to (i + 2, j + 1), (i + 2, j - 1), (i - 2, j + 1), (i - 2, j - 1), (i + 1, j + 2), (i + 1, j - 2), (i - 1, j + 2), (i - 1, j - 2).

The rows and columns are 0 indexed, so the top-left square is (0, 0), and the bottom-right square is (N - 1, N - 1).

chessboard

(X is the Knight’s current position, O is the position Knight can visit in 1 move)

You have to make K such moves from the initial position of the knight and tell the probability of the knight being within the boundaries of the chessboard i.e you have to consider all possibilities of K moves and determine the probability that after these moves the knight will remain within the chess grid.

Note:

Print output up to 6 decimal places.
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 write a single-line comment in C++?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - Intern
3 rounds | 3 problems
Interviewed by Amazon
1185 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 7 problems
Interviewed by Amazon
413 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
423 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Amazon
654 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
12384 views
1 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Microsoft
7431 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Google
5270 views
1 comments
0 upvotes