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

SDE - 1

Amazon
upvote
share-icon
5 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 Months
Topics: Data Structures, OOPS, System Design (more focus on LLD than HLD), recursion, dynamic programming
Tip
Tip

Tip 1 : Start with clearing your fundamentals first, then focus on solving easy questions first. When you are comfortable with them, gradually increase the question difficulty.
Tip 2 : Consistency and patience is all what it takes. Make a habit of solving atleast 2 ds questions no matter how busy you are. Get started with leetcode daily challenge, It helped me alot as everyday, you get to solve random question.
Tip 3 : Even after solving the question, read the discuss section for that question, you will get good idea about other approaches and check whether you solved with the optimal approach.

Application process
Where: Linkedin
Eligibility: No
Resume Tip
Resume tip

Tip 1 : know what you are writing on resume, interviewer do read them and will dig deep into details about what you have written
Tip 2 : Have atleast one good project

Interview rounds

01
Round
Medium
Telephonic
Duration45 minutes
Interview date1 Apr 2022
Coding problem1

Timing - 3:00 pm (IST) Noon
It was virtual, interview was on chime

1. Decode String

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

You have been given an encoded string. Your task is to decode it back to the original string.

- An encoded string will be of the form <count>[encoded_string], where the 'encoded_string' inside the square brackets is being repeated exactly 'count' times. Note that 'count' is guaranteed to be a positive integer and can be greater than 9.
- There are no extra white spaces and square brackets are well-formed.
For example -
Input: 2[a]
“a” is encoded 2 times, hence the decoded string will be "aa".

Input: 3[a2[b]]
“b” is encoded 2 times, which decodes as 3[abb]. Now, "abb" is encoded 3 times, hence decoded string will be "abbabbabb". 
Problem approach

I had solved this question while preparing, hence I knew the approach and i straight away told my approach. 

I told her the approach which i had in mind, the inteviewer asked one two clarifying questions. My approach was to use stack. 
After having discussion, Interviewer told me to code the solution.
Once i was done writing the code, i had to dry run it over few test cases.
All the test cases interviewer mentioned, I dry run it over my code and explained the output
It was all done in 35 minutes.
Then one two questions regarding my current work

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date15 Apr 2022
Coding problem2

Timing - 1:00 pm (IST) Noon

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 thought about the question and applied BFS in the question
    interviewer focused more on how I was coming to the solution and why will BFS give the minimum time.
    After giving the answer, I was supposed to code the solution.
    I code the solution on time, interviewer was happy and then we moved to the next question.

    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
    NoBrokerOracleGoldman Sachs

    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.
    
    Problem approach

    Step 1 : I gave the brute force solution. Interviewer told me to optimise it.
    Step 2 : I knew the solution already, I gave the o(n+m) solution and he was sartisfied with the approach.
    Step 3 : I coded up the solution and he made me dry run for few test cases. He was happy as i was able to solve both the questions on time.

    Try solving now
    03
    Round
    Easy
    Video Call
    Duration60 minutes
    Interview date19 Apr 2022
    Coding problem1

    Timing - 1 pm noon

    1. Serialize and Deserialize Binary Tree

    Hard
    15m average time
    85% success
    0/120
    Asked in companies
    UbereBayApple

    You have been given a binary tree of integers. You are supposed to serialize and deserialize (refer to notes) the given binary tree.


    You can choose any algorithm to serialize/deserialize the given binary tree. You only have to ensure that the serialized string can be deserialized to the original binary tree.


    Note :
    Serialization is the process of translating a data structure or object state into a format that can be stored or transmitted (for example, across a computer network) and reconstructed later. The opposite operation, that is, extracting a data structure from stored information, is deserialization.
    
    Problem approach

    I gave one solution to have both the inOrder and preorder/postorder. And i can serialise and deserialise binary tree from there.
    Interviewer told me to think of another approach. 
    I have gave the level order traversal approach to the solution,
    Interviewer asked few questions
    and once i was done with my approach, Interviewer told me to code the solution
    He was happy with my solution.

    Try solving now
    04
    Round
    Medium
    Video Call
    Duration60 minutes
    Interview date22 Apr 2022
    Coding problem1

    Timing - 2:00pm IST

    1. Clone a Linked List with random pointers

    Easy
    0/40
    Asked in companies
    ThalesAmazonQualcomm

    You are given a linked list containing 'n' nodes, where every node in the linked list contains two pointers:


    (1) ‘next’ which points to the next node in the list

    (2) ‘random’ which points to a random node in the list or 'null'.


    Your task is to create a 'deep copy' of the given linked list and return its head.


    Note:
    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.
    


    Problem approach

    I had solved this question previously
    I told the solution and how i will go about it. He was satisfied with the approach and asked me to code the solution. 
    Interviewer gave me one test case to dry run, upon successfully doing it
    Interviewer seemed happy.

    Try solving now
    05
    Round
    Easy
    Video Call
    Duration60 minutes
    Interview date28 Apr 2022
    Coding problem1

    Timing 4:00pm

    1. Capacity To Ship Packages Within D Days

    Moderate
    15m average time
    85% success
    0/80
    Asked in companies
    Morgan StanleyAmazonCoinbase

    You are the owner of a Shipment company. You use conveyor belts to ship packages from one port to another. The packages must be shipped within 'd' days.


    The weights of the packages are given in an array 'weights'. The packages are loaded on the conveyor belts every day in the same order as they appear in the array. The loaded weights must not exceed the maximum weight capacity of the ship.


    Find out the least-weight capacity so that you can ship all the packages within 'd' days.

    Problem approach

    I gave the brute force solution, interviewer told me to optimise it
    I was able to solve it using binary search, interviewer then told me to code the solution
    After this question
    He asked few situation based question like
    Time when you work under tight deadlines, time when you deep dive to fix a bug

    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
    3084 views
    0 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Amazon
    2294 views
    1 comments
    0 upvotes
    company logo
    SDE - 1
    3 rounds | 6 problems
    Interviewed by Amazon
    1592 views
    0 comments
    0 upvotes
    company logo
    SDE - 1
    4 rounds | 8 problems
    Interviewed by Amazon
    8962 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
    5983 views
    5 comments
    0 upvotes