Monday 17 November 2014

Amazon Interview

Amazon

Date: 15 November 2014
Venue : Nehru Place

Questions:

  1. Create a balanced Binary Search Tree from a sorted array.
  2. A 2-D matrix is filled with only zero and one. Each row is sorted i.e. each row has zero's on the left side and one's on the right side.Find the row with maximum number of one's.
  3. Create a NGE array for an array. NGE : Next Greater Element. For each element find the next larger element to the right. If there is no larger element to the right then show -1.
    Eg:
    An array : {5,1,23,4,7,5,88,2} will have a NGE : {23,23,88,7,88,-1,-1}.
    5    1    23  4  7    5    88   2
    23  23  88  7  88  88  -1  -1

No comments:

Post a Comment