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
Journey
After graduating from Thapar University in 2023, I began my career as an intern at Byju's, where I worked for 9 months in backend development, optimizing features for their learning platform. This hands-on experience sharpened my technical skills and problem-solving abilities, preparing me for larger challenges in software engineering. Motivated to take the next step, I applied to Amazon and started rigorous preparation for their interview process, focusing on data structures, algorithms, system design, and Amazon's Leadership Principles. The interview process included a phone screen followed by onsite rounds, which involved coding challenges, system design problems, and behavioral questions. I was tested on my ability to solve complex problems, design scalable systems, and demonstrate leadership in real-world scenarios. After successfully navigating this challenging process, I was thrilled to receive an offer for the SDE-1 role at Amazon. My journey, from my internship at Byju's to securing a full-time position at Amazon, has been a valuable learning experience that solidified my passion for software development and my eagerness to contribute to Amazon's mission.
Application story
I applied for the SDE-1 role at Amazon through their official careers portal after seeing the job opening. The entire process was conducted online, starting with the application submission and an online coding assessment. After clearing the assessment, I was scheduled for virtual interviews, which included both coding and behavioral rounds. The interviewers were clear and prompt with feedback at each stage, and the process was smooth and well-structured, culminating in an offer after successfully completing the online interviews.
Why selected/rejected for the role?
I was selected for the SDE-1 role at Amazon because I demonstrated strong problem-solving skills, a solid understanding of data structures and algorithms, and a clear alignment with Amazon's Leadership Principles. My ability to think critically under pressure and communicate my thought process effectively played a key role. I also showcased my experience from my internship, where I worked on scaling systems and handling real-world challenges. The selection process validated my technical foundation and my preparation for tackling complex problems in a fast-paced environment.
Preparation
Duration: 3 months
Topics: Arrays & Strings, Heaps, Binary Search, Trees & Graphs, DP, Linked Lists, Stacks & Queues.
Tip
Tip

Tip 1: Focus on problem-solving, not just coding.
Tip 2: Practice mock interviews and time management.

Application process
Where: Linkedin
Eligibility: No criteria (Salary: 20 LPA)
Resume Tip
Resume tip

Tip 1: Focus on relevant projects and experience. Ensure your resume highlights projects that demonstrate your technical skills, problem-solving abilities, and hands-on experience with tools and technologies. Projects that align with the role you're applying for will capture the recruiter’s attention.

Tip 2: Keep it concise and structured. Avoid long paragraphs and focus on bullet points to make your resume easy to skim. Use clear headings, brief descriptions, and quantifiable achievements to effectively convey your contributions.

Interview rounds

01
Round
Medium
Online Coding Test
Duration90 minutes
Interview date27 Aug 2023
Coding problem2

The online test consists of two coding questions to be completed in 90 minutes. The questions are of medium difficulty, and I was able to solve both of them in under 40 minutes.

1. Count Number of Subsequences

Moderate
15m average time
85% success
0/80
Asked in companies
Tata CommunicationsAmazonHCL Technologies

Given an array of non-negative integers ‘A’ and an integer ‘P’, find the total number of subsequences of ‘A’ such that the product of any subsequence should not be more than ‘P’.

A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.
Note
You need to print your answer modulo 10^9 + 7.
For Example
Let us take  A = [1,2,3] and P = 4. 
All the subsequences not having product more than ‘4’ are {1}, {2}, {3}, {1,2}, {1,3}. Therefore count is equal to ‘5’.
Problem approach

Step 1: I started by thinking about the properties of subsequences. The number of subsequences in an array is 2^n, where n is the length of the array, because each element can either be included or excluded from a subsequence.

Step 2: I then implemented a simple formula using the power of 2 to calculate the total number of subsequences:
Total Subsequences = 2^n

Step 3: The interviewer pointed out that this formula counts the empty subsequence as well, so I adjusted the solution by subtracting 1 to exclude the empty subsequence.

Step 4: The interviewer was satisfied with the solution, and I concluded that the correct result is 2^n - 1 subsequences (excluding the empty subsequence).

Try solving now

2. Merge Two Sorted Arrays

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

Ninja has been given two sorted integer arrays/lists ‘ARR1’ and ‘ARR2’ of size ‘M’ and ‘N’. Ninja has to merge these sorted arrays/lists into ‘ARR1’ as one sorted array. You may have to assume that ‘ARR1’ has a size equal to ‘M’ + ‘N’ such that ‘ARR1’ has enough space to add all the elements of ‘ARR2’ in ‘ARR1’.

For example:

‘ARR1’ = [3 6 9 0 0]
‘ARR2’ = [4 10]
After merging the ‘ARR1’ and ‘ARR2’ in ‘ARR1’. 
‘ARR1’ = [3 4 6 9 10]
Problem approach

Step 1: I began by initializing two pointers, one for each array (i=0 and j=0), and an empty result array.
Step 2: I used a while loop to compare the elements at the pointers A[i] and B[j]. I added the smaller element to the result array and moved the pointer of the array from which the element was taken.
Step 3: After completing the main loop, there could still be remaining elements in either A[] or B[], so I appended the rest of the elements from the array that still had remaining elements.
Step 4: The interviewer suggested checking edge cases, such as one of the arrays being empty. I confirmed that the solution handles this case correctly, where the result is just the non-empty array.
Step 5: The interviewer was happy with my solution and suggested that the time complexity of this approach is O(N+M), which is optimal for merging sorted arrays.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date5 Sep 2023
Coding problem2

The Amazon online assessment took place in the afternoon, and the environment was calm and distraction-free, as I completed it from home. The platform was user-friendly, with a clear code editor and an integrated timer, which helped me manage my time effectively. There were no issues with the system, and the questions were challenging yet fair, testing both my problem-solving skills and understanding of algorithms. Although there wasn’t any live interaction with an interviewer, the process was smooth, and I was able to focus fully on solving the coding problems.

1. Clone a binary tree with random pointers.

Moderate
10m average time
90% success
0/80
Asked in companies
SamsungAmazonExpedia Group

You are given a binary tree. Apart from the left and right child pointers, each node in the given binary tree points to a random node in the given binary tree. You are supposed to return a clone of the binary tree.

Cloning a binary tree means making a deep copy of the input binary tree.

Note :
Two nodes may have the same value associated with them.
The root node will be fixed and will be provided in the function.
Problem approach

Step 1: I started by performing a pre-order traversal of the binary tree to process each node.
Step 2: For each node, I checked whether the random pointer points to any of the node's descendants. To do this, I used a helper function that checks if a node is an ancestor of the current node (e.g., by performing a simple traversal of the left and right subtrees).
Step 3: If the random pointer points to one of the successors, I left it as is. Otherwise, I set the random pointer to NULL.
Step 4: The interviewer suggested making the function more efficient by storing the nodes in a hash map during the traversal. This way, I could check if the random pointer points to a valid node in constant time. I implemented the hash map and was able to optimize the solution.
Step 5: The interviewer was satisfied with the solution, which runs in O(N) time, where N is the number of nodes in the binary tree.

Try solving now

2. Generate all parenthesis

Moderate
30m average time
85% success
0/80
Asked in companies
AppleMicrosoftAmazon

You are given an integer 'N', your task is to generate all combinations of well-formed parenthesis having ‘N’ pairs.


A parenthesis is called well-formed if it is balanced i.e. each left parenthesis has a matching right parenthesis and the matched pairs are well nested.


For Example:

For ‘N’ = 3,
All possible combinations are: 
((()))
(()())
(())()
()(())
()()()
Problem approach

Step 1: I started by understanding that to form valid combinations of parentheses, for every opening parenthesis '(', there should be a matching closing parenthesis ')'. 

Step 2: I used a backtracking approach, where I recursively added opening and closing parentheses. I made sure that the number of closing parentheses never exceeded the number of opening parentheses. 

Step 3: For each valid combination, I ensured that no duplicates occurred by maintaining the condition that, at any point, the number of opening parentheses could not exceed N, and the number of closing parentheses could not exceed the number of opening parentheses already added. 

Step 4: I generated all valid combinations and returned the result. To optimize, I used a set or list to store only unique combinations (though for backtracking, this is generally not needed if the logic ensures no duplicates). 

Step 5: The interviewer liked the backtracking approach and confirmed that the solution is optimal, running in O(4^n / n^(3/2)) time, which is the time complexity for generating balanced parentheses combinations.

Try solving now
03
Round
Medium
Video Call
Duration50 minutes
Interview date5 Sep 2023
Coding problem1

The round consisted of a single coding question, where I was asked to remove duplicates from a string in O(n) time without using any hash-based data structures. The environment was online, and I completed the task from home in a quiet setting. After successfully solving the problem, the interviewer transitioned to discussing my resume and asked a few HR questions about my background, experiences, and motivation for applying to Amazon. The overall experience was smooth, with clear instructions and no technical issues during the session.

1. Remove Duplicates

Easy
15m average time
80% success
0/40
Asked in companies
GE (General Electric)AmazonCIS - Cyber Infrastructure

Ninja is playing with numbers but hates when he gets duplicate numbers. Ninja is provided an array, and he wants to remove all duplicate elements and return the array, but he has to maintain the order in which the elements were supplied to him.

Problem approach

Step 1: I first created a boolean array visited[] of size 256 (since there are 256 possible ASCII characters) to track whether a character has already been seen.
Step 2: I then looped through the string character by character. For each character, I checked if it had been marked as visited in the visited[] array.
Step 3: If it hadn’t been visited yet, I added the character to the result string and marked it as visited in the visited[] array.
Step 4: If the character had already been visited, I simply skipped it and moved on to the next character.
Step 5: The interviewer was happy with the solution and pointed out that this approach works in linear time, O(n), as we are only iterating through the string once.

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
2294 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
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