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

SDE - 2

Amazon
upvote
share-icon
2 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 4 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Solve RS Aggarwal Aptitude and Problem Solving Books.
Tip 2 : Practice Coding questions from prepInsta.
Tip 3 : Worked on communication skills

Application process
Where: Campus
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Medium
Online Coding Test
Duration60 Minutes
Interview date5 Jul 2022
Coding problem5

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Power of Two

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

You have been given an integer 'N'.


Your task is to return true if it is a power of two. Otherwise, return false.


An integer 'N' is a power of two, if it can be expressed as 2 ^ 'K' where 'K' is an integer.


For example:
'N' = 4,
4 can be represented as 2^2. So, 4 is the power of two, and hence true is our answer.
Try solving now

2. Transactions

Easy
15m average time
90% success
0/40
Asked in company
Amazon

Alex is going to some stores where he will carry out some transactions. In each store, he will either pay some money, or he will receive some money. Initially, Alex has 0 amount with him. So he currently has an array 'money' containing the transaction amounts (both positive and negative) in the same order he did at stores. Can you find out the maximum amount that he will have with him after any(possibly 0) number of transactions?

Note: that at some point, the amount left with Alex can become negative. For example, in the transactions [1, -3], after the second transaction, the money left with Alex is -2.

Example: Let the transaction amounts be [1, -2, 5]. Here we can see that the amount left after the first transaction is 1 after the second is -1 and after the third is 4. So the maximum value is 4.

Try solving now

3. Ninja Fight

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

Two Ninjas, “Ninja 1” and “Ninja 2”, are here to fight and they want to prove themselves stronger than the other, and to prove so they decided to play a game and whosoever will be the winner of the game will be stronger than the other.

The Game is, given an integer 'N' at the start, the Ninja in his turn has to select a positive integer x such that 'N' is divisible by x ('N' % x = 0) and subtract x from 'N'. The game stops when 'N' becomes 1, now if both the Ninjas alternate their turns starting from “Ninja 1”, your task is to determine the winner if both the Ninjas play optimally.

The player who makes the last move is the winner i.e. The player who is unable to make the move is the loser.

Note:
x should never be equal to the current value of 'N'.
Try solving now

4. Restore Peace

Hard
50m average time
55% success
0/120
Asked in companies
OlaAmazon

There is a kingdom with ‘N’ cities that are connected by roads. The cities are connected to form a tree, where cities represent the nodes, and the roads represent the edges. The cities are numbered from 0 to ‘N-1’ and the length of each road is 1 unit.

A tree is a hierarchical data structure defined as a collection of nodes.

Now, a battle is going on in some cities of the kingdom, where the king must visit to restore peace. Initially, the king is at the 0th node(root node). The cities where battles are going on will be given as an input array, and the king has to visit in the same order as given in the input array 'battles'. You have to find the total length of the road the king has to travel to restore peace in all the cities.

For Example:
For the test case:
N = 3, Q = 2
Edge 1 connects 0 and 1
Edge 2 connects 0 and 2
battles = [1, 2]

The king has to visit first city 1 and then city 2. To visit city 1, he has to travel 1 unit, and now he is in city 1. To visit city 2 from city 1, he has to travel another 2 units. So overall, he has to travel 3 units of distance.
Try solving now

5. Star Pattern

Easy
0/40
Asked in companies
IBMAmazonUnthinkable Solutions

Pattern for N = 4


Hint
As taught in the video, you just have to modify the code so that instead of printing numbers, it should output stars ('*').

The dots represent spaces.



Try solving now
02
Round
Medium
HR Round
Duration20 Minutes
Interview date14 Sep 2022
Coding problem1

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Basic HR Questions

1. Tell me about yourself?
2. Why are you interested in this position? 
3. Why are you leaving your current job? 
4. Can you describe a work or school instance in which you messed up? 
5. Tell me about a time when you experienced conflict with a co-worker and how you dealt with it?

Problem approach

Tip 1 : Communicate well
Tip 2 : Give point to point answer
Tip 3 : Highlight your skills

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 - 2
3 rounds | 4 problems
Interviewed by Amazon
2446 views
0 comments
0 upvotes
company logo
SDE - 2
5 rounds | 7 problems
Interviewed by Amazon
2239 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 8 problems
Interviewed by Amazon
3375 views
0 comments
0 upvotes
company logo
SDE - 2
5 rounds | 7 problems
Interviewed by Amazon
911 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 2
5 rounds | 12 problems
Interviewed by Walmart
29892 views
8 comments
0 upvotes
company logo
SDE - 2
4 rounds | 7 problems
Interviewed by Dunzo
3164 views
0 comments
0 upvotes
company logo
SDE - 2
3 rounds | 4 problems
Interviewed by Samsung
2588 views
0 comments
0 upvotes