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

SDE - Intern

Amazon
upvote
share-icon
2 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: Data Structures, Standard Template Library(STL), Linked Lists, Binary Trees, Binary Seacrh Trees, Dynamic Programming, Heaps, Graphs, Operating Systems.
Tip
Tip

Tip 1 : Practice Atleast 300 Problems from LeetCode and GeeksforGeeks(GFG).
Tip 2 : Don't ignore subjects like Operating Systems, Computer Networks, and Database Management Systems.
Tip 3 : Be well prepared with your projects.

Application process
Where: Other
Eligibility: Above 6.5 CGPA
Resume Tip
Resume tip

Tip 1 : Mention all the projects in your resume.
Tip 2 : Make Sure that your resume is simple and also try to fit all the information in only one page.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration135 minutes
Interview date18 Sep 2020
Coding problem2

Round 1- The online round had 4 sections:
1) Code Debugging Section: 7 questions to be debugged in 20 minutes (C/C++/Java)
2) Coding questions: There were 2 coding questions
3) Workstyle and Behavioural assessment: 20 minutes 
4) Reasoning Ability: 35 minutes (easy-medium)(Aptitude and Logical Reasoning Questions)

1. Check whether second string can be formed from characters of first string

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

You are given two strings STR1 and STR2. You need to check whether STR2 can be formed from the characters of STR1. Both the strings can contain any characters.

For example:
If STR1 = “codingninjas” and STR2 = “sing”. We can form the second string using the characters of the first string. This is because “s”, “i”, “n”, “g” are present in the string STR1.
Problem approach

1) I solved this problem in O(n) time and O(n) space.
2) The idea is based on the fact that inorder traversal and preorder traversal of the tree.
3) Tree X is a subtree of Y if both inorder and preorder traversals of X are substrings of inorder and preorder traversals of Y respectively.

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

1) I solved this problem in O(n+m) time and O(1) space.
2) I solved it using divide and conquer approach.
3) I was lucky because i had already solved this problem before in leetcode.

Try solving now
02
Round
Medium
Video Call
Duration75 minutes
Interview date8 Oct 2020
Coding problem3

It was a technical round. The interviewer mainly focused on Data Structures and Algorithms and asked me a few questions on operating systems.

1. Count Distinct Element in Every K Size Window

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

You are given an array ‘ARR’ of size ‘N’ and an integer ‘K’. Your task is to find the total number of distinct elements present in every ‘K’ sized window of the array. A ‘K’ sized window can also be viewed as a series of continuous ‘K’ elements present in the sequence.

Note:
1. The size of ‘ARR’ will always be greater than or equal to the ‘K’.
2. Here window refers to a subarray of ‘ARR’. Hence ‘K’ sized window means a subarray of size ‘K’.
3. You are not required to print the output explicitly. It has already been taken care of. Just implement the function and return an array of the count of all distinct elements in the ‘K’ size window.

Example

Consider ARR = [ 1, 2, 1, 3, 4, 2, 3 ] and K = 3.

subsequence

As per the given input, we have a sequence of numbers of length 7, and we need to find the number of distinct elements present in all the windows of size 3.

Window-1 has three elements { 1, 2, 1 } and only two elements { 1, 2 } are distinct because 1 is repeating two times.
Window-2 has three elements { 2, 1, 3 } and all three elements are distinct { 2, 1, 3 }.
Window-3 has three elements { 1, 3, 4 } and all three elements are distinct { 1, 3, 4 }.
Window-4 has three elements { 3, 4, 2 } and all three elements are distinct { 3, 4, 2 }.
Window-5 has three elements { 4, 2, 3 } and all three elements are distinct { 4, 2, 3 }.

Hence, the count of distinct elements in all K sized windows is { 2, 3, 3, 3, 3 }.
Problem approach

1) First I did in a brute force approach O(n^2).
2) Interviewer asked me to optimize my approach.
2) Finally I optimized it to O(n) by using a HashMap.

Try solving now

2. Merge Two Sorted Linked Lists

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

You are given two sorted linked lists. You have to merge them to produce a combined sorted linked list. You need to return the head of the final linked list.

Note:

The given linked lists may or may not be null.

For example:

If the first list is: 1 -> 4 -> 5 -> NULL and the second list is: 2 -> 3 -> 5 -> NULL

The final list would be: 1 -> 2 -> 3 -> 4 -> 5 -> 5 -> NULL
Problem approach

1) First solved it iteratively using a while loop.
2) Then the interviewer asked me to solve it using recursion.
3) I then modified my approach.
4) We discussed all the edge cases and finally the interviewer got satisfied.

Try solving now

3. Operating Systems

Two questions of operating systems were asked: -

1. What is thrashing?
2. Explain the Round Robin Scheduling algorithm?

Problem approach

Tip 1 : Prepare Operating System Questions from Geeks for Geeks.
Tip 2 : If you have sufficient time then go through Galvin textbook.

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 - Intern
3 rounds | 3 problems
Interviewed by Amazon
2163 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 7 problems
Interviewed by Amazon
1068 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 3 problems
Interviewed by Amazon
1043 views
0 comments
0 upvotes
company logo
SDE - Intern
1 rounds | 3 problems
Interviewed by Amazon
3502 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15500 views
1 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Microsoft
8187 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Microsoft
4915 views
2 comments
0 upvotes