Open In App

Amazon Interview Experience (AmazonWow)

Improve
Improve
Like Article
Like
Save
Share
Report

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.

Last Updated : 04 Mar, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads