Open In App

Amazon Interview Experience

Improve
Improve
Like Article
Like
Save
Share
Report

Round 1(Coding on Hacker Rank platform):

  1. Given an array of Strings, Each string has an id and version associated with it. string with alphabetic versions are the older versions and the string with numerical versions are the new version. We need to line up the strings for renovation such that older version strings (strings with alphabetic version) need to be put first in lexicographical order. If any clashes in arrange, then arrange them as per the lexicographical order of the id. The renovated strings need to be kept as in the input order.

    Example: 
    Input:{a a , c  b , b b, a 1, b 2}
    Output:{a a , b  b , c b, a 1, b 2}

    Expected time complexity O(N* log(N)). I was able to solve it with Heap (priority queue in c++).

  2. Given a 2 D array with each cell having values 1, 0, 9 where 1-> land , 0-> sea , 9->obstacle, we can only traverse in land (1).

    Need to find the Minimum number of steps required to reach the obstacle (9).we are allowed to traverse only to right, left, down and up.

    Expected Time Complexity: O(M * N) . I was able to solve it with BFS (Breadth-First Search)

Round 2(Amazon chime paired Coding F2F):

  1. Given a list of contacts containing name and phone number , we need to group the contacts which either have the same name or same phone number together.
    Example:
    Input :{{abc ,9987},{xyz,9986},{dfg,9987}}
    Output:{{{abc ,9987},{dfg ,9987}},{{xyz,9986}}}

    Union Find Algorithm or Depth First search Algorithm was applicable

  2. Given a Sorted array, such that each number repeats exactly twice except one number, we need to find that number

    https://www.geeksforgeeks.org/problems/find-the-element-that-appears-once-in-sorted-array0624/1#

    Example:
    Input:{1,1,2,2,3,4,4,5,5} 
    Output: 3

    Expected Time Complexity :O(log(N)) Binary search was applicable

  3. Difference between thread and Process
  4. DNS Server mechanism

Round 3(Amazon chime paired Coding F2F):

  1. Given the Process ids in array and the parent of these Process ids in separate array, and the process id we need to kill. Find the List of the process which would get killed on killing the given process.

    Example:

    pid{1,2,3,4,5,6,7,8,9} 
    parentpid{2,0,2,3,3,3,3,4,5} 
    Killing Process: 3
    Output :{4,5,6,7,8,9} 

    Create a Directed Graph between the parent and Child process and perform BFS (Breadth First search)

  2. Given a Linked Link, Alter the Linked list as the below
    Input:l1->l2->.. ln-2->ln-1->ln
    Output: l1->ln->l3->ln-2...

    Separate out the Linked List by alternate nodes, we get two linked lists, reverse the second list and then join them.
    https://www.geeksforgeeks.org/problems/reorder-list/1

  3. Discussion on LRU Cache Implementation. (Double Linked List and HashMap)
  4. Amazon Leadership Principles Questions. https://www.amazon.jobs/en/principles

Round 4(Bar Raiser Round F2F-Amazon chime):

  1. Few Questions on Amazon leadership principles
  2. Given a string that represents covid patients we need to isolate(remove) each character in string in lexicographical order

    Cost of each isolation is equal to the index value of the character

    Example 1: 
    Input : aacb  
    Output : 1+1+2+1=5

    Use Double linked list for altering and the hashmap for character frequency.

Round 5(Hiring Manager-Amazon Chime):

  1. Few Questions on Amazon leadership principles
  2. Given an array of Integers find the pair whose sum is farthest from zero.
  3. some variations on the above question

Finally, After 5 Rounds I got a Mail from HR stating my Selection.


Last Updated : 20 Aug, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads