Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding
Ninjas X Naukri.com

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

Amazon

2 rounds | 4 Coding
problems

Preparation

Duration: 8 months

Topics: Data Structures, Dynamic Programming , Trees, LinkedList, OOPS, Stack, Queue

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

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

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.

```
The order in which the groups and members of the groups are printed does not matter.
```

```
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)

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. 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
```

Problem approach

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

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

```
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.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Suppose list1 is [2, 133, 12, 12], what is max(list1) in Python?

Choose another skill to practice

Start a Discussion

Similar interview experiences

SDE - 1

3 rounds | 5 problems

Interviewed by Amazon

1049 views

0 comments

0 upvotes

SDE - 1

4 rounds | 8 problems

Interviewed by Amazon

1260 views

1 comments

0 upvotes

SDE - 1

3 rounds | 6 problems

Interviewed by Amazon

526 views

0 comments

0 upvotes

SDE - 1

4 rounds | 8 problems

Interviewed by Amazon

1945 views

0 comments

0 upvotes

Companies with similar interview experiences

SDE - 1

4 rounds | 5 problems

Interviewed by Microsoft

50292 views

5 comments

0 upvotes

SDE - 1

4 rounds | 8 problems

Interviewed by Samsung

11190 views

2 comments

0 upvotes

SDE - 1

2 rounds | 4 problems

Interviewed by Google

9820 views

0 comments

0 upvotes