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

SDE - 1

Amazon
upvote
share-icon
2 rounds | 4 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 8 months
Topics: Data Structures, Dynamic Programming , Trees, LinkedList, OOPS, Stack, Queue
Tip
Tip

Tip 1 : Build strong fundamentals in Data Structures and Algorithms. Practise basic data structures like Arrays, Linked List, Tree, Stack, Queues. For Graphs practise - BFS, DFS, Kruskal, Prims.
Tip 2 : Practice coding questions (medium-hard level) on online platforms like CodeZen, Codeforces, CodeChef.
Tip 3 : Practice mock interviews before the real interview.

Application process
Where: Campus
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1 : Briefly write you skills in which you are comfortable. Don't try to add anything vague as you will be questioned about everything which is written on resume.
Tip 2 : Have at least two projects on your resume which reflects application of your acquired skills

Interview rounds

01
Round
Medium
Video Call
Duration60 minutes
Interview date3 Jul 2020
Coding problem2

In this round i was tested for Data Structure competency. Two questions were asked.

1. Group Anagrams

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

You have been given an array/list of strings 'inputStr'. You are supposed to return the strings as groups of anagrams such that strings belonging to a particular group are anagrams of one another.

An anagram is a word or phrase formed by rearranging the letters of a different word or phrase. We can generalize this in string processing by saying that an anagram of a string is another string with the same quantity of each character in it, in any order.

Note:
The order in which the groups and members of the groups are printed does not matter.
For example:
inputStr = {"eat","tea","tan","ate","nat","bat"}
Here {“tea”, “ate”,” eat”} and {“nat”, “tan”} are grouped as anagrams. Since there is no such string in “inputStr” which can be an anagram of “bat”, thus, “bat” will be the only member in its group.
Problem approach

I first gave a brute force stored string solution . After explaining my solution I was asked to optimise it so I followed up with using a map and unique key to represent the strings(storing counts)

Try solving now

2. Peer to peer network dicussion

Given a peer to peer network, how will you design an algorithm to transfer data from one to node to the other receiver nodes? In its simplest form, a peer-to-peer (P2P) network is created when two or more PCs are connected and share resources without going through a separate server computer.

Problem approach

I discussed the problem with the interviewer and clarified my doubts regarding if there is weight assigned to network link between the nodes. I first proposed dijkstra algorithm but he told me that in large network it would be difficult to implement it. Then I gave BFS approach to him as in BFS we traverse level wise and then we can reach to closest receiver node.

02
Round
Medium
Video Call
Duration90 minutes
Interview date8 Jul 2020
Coding problem2

Two questions were asked in this round on data structures and algorithms.

1. BST iterator

Moderate
20m average time
65% success
0/80
Asked in companies
AmazonSalesforceFacebook

You are given a class named as BSTIterator that represents an iterator over inorder traversal of a binary search tree. You need to implement the following things as follows:

1. BSTIterator(Node root) - It is a parameterized constructor in which you are given the root of the Binary search tree. It will be called whenever an object of BSTIterator is created.

2. next() - This member function will return the next smallest element in the in-order traversal of the binary search tree. You need to implement this function.

3. hasNext() - This function will return true if there exists the next smallest element in the traversal else it will return false. You need to implement this function

The binary search tree has ‘N’ nodes you need to print the inorder traversal of the tree using the iterator.

Problem approach

I solved it by using stack and then performing an in order traversal of the BST.

Try solving now

2. K Most Frequent Words

Moderate
36m average time
65% success
0/80
Asked in companies
SalesforceDunzoOla

You have been given an array/list 'WORDS' of 'N' non-empty words, and an integer 'K'. Your task is to return the 'K' most frequent words sorted by their frequency from highest to lowest.

Note:

If two words have the same frequency then the lexicographically smallest word should come first in your answer.

Follow up:

Can you solve it in O(N * logK) time and O(N) extra space? 
Problem approach

I calculated the frequency of each word in the list and then stored it in a map. Then I sorted it with the help of priority queue.

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