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

SDE - 1

Amazon
upvote
share-icon
3 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 2 years
Topics: DSA, ALGORITHMS, Dynamic Programming, Graph, OOPS, Pointers
Tip
Tip

Tip 1 : Practice as many questions as u can
Tip 2 : Focus on DSA

Application process
Where: Company Website
Eligibility: No
Resume Tip
Resume tip

Tip 1 : Add some good projects
Tip 2 : Don't add copied Projects

Interview rounds

01
Round
Easy
Online Coding Interview
Duration90 minutes
Interview date5 Dec 2021
Coding problem2

90 minutes round Seven debugging questions, two coding questions, Behavioural questions

1. Maximum Path Sum Between Two Leaves

Hard
50m average time
35% success
0/120
Asked in companies
DirectiMicrosoftMathworks

You are given a non-empty binary tree where each node has a non-negative integer value. Return the maximum possible sum of path between any two leaves of the given tree.

The path is also inclusive of the leaf nodes and the maximum path sum may or may not go through the root of the given tree.

If there is only one leaf node in the tree, then return -1.

Problem approach

traverse the tree and find maximum sum from leaf to root in left subtree, find maximum sum from leaf to root in right subtree of X, add the above two calculated values then return the maximum value

Try solving now

2. Path In A Tree

Moderate
0/80
Asked in companies
AmazonMicrosoftFacebook

You are given a binary tree with ‘N’ number of nodes and a node ‘X’. Your task is to print the path from the root node to the given node ‘X’.

A binary tree is a hierarchical data structure in which each node has at most two children.

Example:
Here, for ‘X ’= 7, the output will be 1 3 7.
Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date14 May 2022
Coding problem2

The interviewer directly stated with coding question. He asked me 2 coding questions and he was aspecting the optimal working code of both.

1. Boundary Traversal

Hard
20m average time
85% success
0/120
Asked in companies
Goldman SachsOYOExpedia Group

You are given a binary tree having 'n' nodes.


The boundary nodes of a binary tree include the nodes from the left and right boundaries and the leaf nodes, each node considered once.


Figure out the boundary nodes of this binary tree in an Anti-Clockwise direction starting from the root node.


Example :
Input: Consider the binary tree A as shown in the figure:

alt text

Output: [10, 5, 3, 7, 18, 25, 20]

Explanation: As shown in the figure

The nodes on the left boundary are [10, 5, 3]

The nodes on the right boundary are [10, 20, 25]

The leaf nodes are [3, 7, 18, 25].

Please note that nodes 3 and 25 appear in two places but are considered once.
Problem approach

I solved it by making 3 function, one for left, one for right and one for bottom.

Try solving now

2. Maximum Consecutive Ones

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

Given a binary array 'ARR' of size 'N', your task is to find the longest sequence of continuous 1’s that can be formed by replacing at-most 'K' zeroes by ones. Return the length of this longest sequence of continuous 1’s.

Problem approach

I solved this question by 2 pointers by taking left and right pointers and moving the right point untill it was possible to switch the zeroes else move the left pointer

Try solving now
03
Round
Medium
Face to Face
Duration60 minutes
Interview date26 May 2022
Coding problem1

The interviewer started with tell me about your self. Then he started asking about my previous intenship projects and some Common Hr questions like why you want to join amazon. This went for almost 30 minutes then he asked me to solve a coding question similar to Rotten Orange question.

1. Rotting Oranges

Moderate
20m average time
78% success
0/80
Asked in companies
Samsung R&D InstituteSalesforceSamsung

You have been given a grid containing some oranges. Each cell of this grid has one of the three integers values:

  • Value 0 - representing an empty cell.
  • Value 1 - representing a fresh orange.
  • Value 2 - representing a rotten orange.
  • Every second, any fresh orange that is adjacent(4-directionally) to a rotten orange becomes rotten.

    Your task is to find out the minimum time after which no cell has a fresh orange. If it's impossible to rot all the fresh oranges then print -1.

    Note:
    1. The grid has 0-based indexing.
    2. A rotten orange can affect the adjacent oranges 4 directionally i.e. Up, Down, Left, Right.
    
    Problem approach

    I solved this question by BFS.

    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 - 1
    3 rounds | 5 problems
    Interviewed by Amazon
    3085 views
    0 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Amazon
    2295 views
    1 comments
    0 upvotes
    company logo
    SDE - 1
    3 rounds | 6 problems
    Interviewed by Amazon
    1593 views
    0 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Amazon
    8963 views
    0 comments
    0 upvotes
    Companies with similar interview experiences
    company logo
    SDE - 1
    4 rounds | 5 problems
    Interviewed by Microsoft
    58238 views
    5 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Samsung
    12649 views
    2 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Microsoft
    5984 views
    5 comments
    0 upvotes