Amazon Interview Experience (AmazonWow)

Online Test: There were 28 MCQs mostly based on stacks, queues, predict the output, Sorting, and Binary Trees and 2 coding questions.

1) Given a string convert it into a valid address by inserting a ‘.’ after www then insert a ‘.’ before com and if there are more characters after com then put a ‘/’ after com and then the rest of the characters.

Eg:

 Input:  wwwgooglecomr
 Output: www.google.com/r

Print the length of the longest decreasing subsequence.

Round 1 (Interview 1): The interviewer introduced himself and asked me to introduce myself.



Coding Questions

  1.  Print all the pairs whose sum is equal to 0.
  2. He extended the question to find all the triplets with sum 0.

Round 2 (Interview 2): Coding Question

  1. Given n strings in ‘a/b=0.5′,’b/c=0.9’ format. Find the answer of q queries in ‘a/c’ format. 

Hint: (Make a directed graph with a, b and other alphabets as vertices)

Round 3 (Interview 3): 

  1. Tree-Based: Given a binary tree and one node is set on fire so find the time required to burn all the nodes.
  2. Stack Based: Given a string with ‘U’ and ‘D’. Find the number of mountains and valleys 

Eg: 

Input: UUDDDDUDUU
Output: Mountain 1 is formed by UUDD and 1 Valley by DDUDUU

The interviewer expected me to code all the questions completely and helped in between if stuck to find the optimized approach.

Tips: 

  • Start coding after the interviewer is satisfied with your approach.
  • First, clarify all the doubts and then give your solution.
  • Dry run your code for multiple edge cases
  • Try to write a clean code.


Write your Interview Experience or mail it to contribute@geeksforgeeks.org

My Personal Notes arrow_drop_up

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


7


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.