Amazon Interview | Set 84
Last Updated :
06 Aug, 2024
I attended a hiring event for Amazon in world trade center in bangalore.
First round was coding test (Written round) :
1.
Given a string of parenthesis, write a function if it is balanced.
2.
Convert BST to a Doubly linked list.
3. Find the number of occurrences of words in a paragraph.
First Round :
1. Asked Why Amazon?
2. Asked some questions on resume.
After some friendly talk, jumped on technical but easy questions :
1.
Implement BFS.
2. Difference between Dijkstra and BFS.
3.
Given a linked list, find out if the list is circular, also find the point from where the cycle start.
4.
Given an array, find the max sum over a sub array.
5. If you have two eggs, how many max steps you need to find the floor, from which the eggs break.
And some more easy questions.
It was already 5, so they decided to have further rounds later.
10 days later I had attended interviews :
First Round :
1. Asked about heaps, given an array, tell if it is min heap, if not, apply operation min-heapify.
2. Is a heap a complete binary tree?
3. Asked What is hashmap.
a. What happens when two numbers map to same key?
b. how does chaining work?
c. What to do when you have a bad hashing function, and only we can modify the structure of hashmap not hashing function?
d. What do to when you your hashmap is filled completely (as in all the linked list are filled up to their capacity)
4. What is
quicksort? Implement for a linked list and tell complexity.
Second Round :
1. What is
quicksort?
a. What is complexity when all elements are sorted and how can you improve it? (Randomization)
b. Will randomization work when elements are same?
c. What algorithms sort equal elements in O(n) time ?
d. using the information, how can you improve quick-sort? Think about it, its good. Don't want to spoil it for you by writing answer here.
e. implement this modification.
2. Given two river banks (visualization : two parallel lines), one bank has numbers written (1....n) in sorted order. On the other bank the numbers (1...n) are arranged randomly. A bridge can be formed from the ith point from bank 1 to ith point in bank 2. Find the max number of non-intersecting bridges you can form?
3. Given 1...n , and given some statements like i hates j, then find some arrangement of n numbers such that if i hates j then in the arrangement i comes before j. Say 1 hates 2, then 123456789 is acceptable but 213456789 is not.
4. Asked about internet. What happens when you type a URL on your browser?
Third Round (Hiring Manager):
1. Why do you want to leave current company?
2. Why do you think amazon is the right place for you?
3. Implement a calculator which takes a maths expression and evaluates it and prints the result.
4. Given statements like A is connected to B. D is connected to E. And transitive connections are allowed. Write a code which takes input such connected statements and and two numbers i and j and returns true if i and j are connected (can be transitively), and false if not connected.
Similar Reads
Amazon Interview | Set 74 Phone Interview: 1) Given a 2D matrix where every row is sorted, give the index of row which has maximum number of oneâs 2) Given a Binary tree, print its every level in a new line. Face to Face Interview (Round 1): 1) you have an array which has a set of positive and negative numbers, print all the
1 min read
Amazon Interview | Set 93 I have just completed a full interview with Amazon and wanted to give back to GeeksForGeeks my experience because it has helped me so so much to go through it. 1st phone interview Why Amazon? How do you find out the cause of a slow UI request? Write function to convert a stream of incoming character
1 min read
Amazon Interview | Set 13 Round 1 (Telephonic) Q1. For a given number, find the next greatest number which is just greater than previous one and made up of same digits. Q2. Find immediate ancestor of a given Node Q3. Clone the linked list having an extra random pointer in nodes which is pointing random node in the list. Roun
2 min read
Amazon Interview | Set 9 (Answers) This post is about answers to the questions asked in Amazon Interview | Set 9. It contains links to some of the solutions available on the geeksforgeeks. I have also written my answers which I replied in the interview. I hope it would help the readers. Online Programming Round: (5 methods, 2 hours)
3 min read
Amazon Interview Question Round 1: There is an unsorted array of size n. Given a key k find m nearest elements to k. Example Array :Â Â -10, -50, 20, 17, 80. key k :20 m : 2 Answer 17, -10. Solution : Find k closest numbers in an unsorted array
1 min read