Amazon | SDE Intern | Sep 2020 [Reject]

Hi All,

I qualified the 1st round of OA, but rejected in second round which was 1-on-1 interview

For OA there were 2 questions:-

  1. 2Sum
  2. Check if binary tree is subtree of another binary tree (similar to this one-> https://leetcode.com/problems/subtree-of-another-tree/)

For 1-on-1 interview:-

In starting of interview interviewer asked for self-introduction, and the moment i stopped my intro he jumped to the questions, i think they have no interest in projects or anything else, the only ask intro for the sake of it.

  1. We are given an array which only contains 0's and 1's. We have to find a range, such that if we flip all the elements within the range, we will get largest subarray of contiguous 1's
Example:- 
Given -> arr = [0, 1, 1, 0, 0, 0, 1]
Answer -> [3, 5]
Explanation -> Currently max contigous 1's are 2, if we flip all elements between index 3 and 5
the array becomes [0, 1, 1, 1, 1, 1, 1], and now max contigous 1's are 6.
  1. We are given a tree, assume every now is a house. At 0th minute one house is on fire. At every minute the fire spread 1 level, towards both children and parent. We have to find how many houses are burnt after x minute.
Example:
Given -> 
       1
	  . .
	 2   3
	. .   
   4   5   
  . .
 6   7

Explanation:- Lets say at 0th minute House 4 is burning
At 1st minute:- 6, 7 and 2 will be burning
At 2nd minute:- 1 and 5 will be burning
At 3rd minute:- 3 will be burning

I hope this helps someone.

Comments (6)