Open In App

Amazon Interview Experience | SDE-2

Last Updated : 16 Aug, 2019
Like Article

Usually Amazon SDE-2 interviews happens in 2 days schedule. On the 1st day there will be 3 rounds (PS/DS and design rounds). If the feedback is good you then will be called for remaining 2 rounds which are Manager and Bar raiser.

In my case date of joining was very close in some other org, so all 5 rounds happened on one day.

Round 1 PS/DS:
Given a binary tree you have to print endmost node in zig zag fashion.

/     \
2        3
/     \    /    \
4     5   6    7

Output should be : 1, 3, 4, 8
Soln: Level Order traversal using node count approach and using flag to decide which node end you have to print (leftmost or rightmost)

Q2. Given snake and ladder board you have to find minimum no. of move required to reach end of board.
Soln: BFS (link

Round 2: PS/DS

Q1) Given following piece of code and two int arrays A & B of equal size n, explain what is it doing.

ans = 0;
for(int i=0;i<n;i++)
for(int j=0;j<n;j++)
for(int k=0;k<n;k++){

if(A[i]!=B[i] && A[j] ! = B[k] && A[k]!=B[k]){ ans = max(ans, A[i] + A[j] + A[k]);}


Sol’n: Basically this code is finding max sum triplet from A array such that value in those indexes of B array  is different.

Next he asked me to re write this code with better time complexity.

Q2.  Given a binary tree, find path in the tree such that the sum of nodes in path is equal to given K. Path can start from any nodes and can end on any nodes.

/     \
2          3
/     \    /    \
4     5   6    7

Example : for k = 10, there will be 2 paths: 1->3-> 6 and 3->7

Use following concept:

Round 3: Design

Design Dominoes website. This was mainly focused on High level design and you have to mention all the major components like Delivery tracking system, User Signup/Login flow, Fulfillment service etc.
You have to describe complete flow of a order until its delivery to customer.
Interviewer also asked me to write schema details for few entities.

Round 4: Manager

In the first of half of this round we mostly discussed about my work experience and role which is played in my current team.
In the second half he asked me to design Job management system where user submits a job and specify the time its should run just like Airflow app.

Round 5: Bar raiser
This one was mostly discussion oriented to judge on the basis of Amazon leadership principles. You have to mention few scenarios about your work and how you have applied those leadership principles.

Few questions which I remember were why did I used Golang instead of Java, most challenging tasks which I have worked on.

Finally, after few days I received positive feedback from HR.

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads