Amazon Interview | Set 4

Feed: GeeksforGeeks
Posted on: Thursday, September 06, 2012 2:50 AM
Author: GeeksforGeeks
Subject: Amazon Interview | Set 4

Please find the details of my Amazon interviews below. Date of Interviews: 1 Sept 2012 No of Rounds: 4 Type of Interviews: Walk-in for 1 yr experienced Round 1: Question 1:- Given a 2D array containing only 0/1′s and each row is in sorted order. Find the row which contains maximum number of 1s. I […]

The post Amazon Interview | Set 4 appeared first on GeeksforGeeks.

rL82RiDt-Pg

View article…

GeeksforGeeks

A computer science portal for geeks

Subscribe

Amazon Interview | Set 4

September 6, 2012

Please find the details of my Amazon interviews below.

Date of Interviews: 1 Sept 2012

No of Rounds: 4

Type of Interviews: Walk-in for 1 yr experienced

Round 1:

Question 1:- Given a 2D array containing only 0/1′s and each row is in sorted order. Find the row which contains maximum number of 1s.
I was asked to code. Algo which I told was I will search position of first 1 in 1st row using binary search. And mark it. Now note that position check in 2nd row. If there is 1 for that position already found in 1st row, then binary search from 0 to that position else move to row number 3. Similarly continue further.

Round 2:-

Question 1:- Given a Binary tree and two nodes. Need to find the minimum ancestor, no parent nodes given.
Each time when I told answer, they modified question little bit or removed some extra storage which I was taking.

Question 2:- Given a Binary tree and two nodes. Need to find smallest path between them

Round 3:-

Question 1:- Given an array of infinite size containing 0/1 only and in sorted order, find position of first one.

My answer: first check whether 1 is present at 100th position or not if there, do binary search between 0 and 100 else check 1 is there at 200th position, and similarly continue further.

Question 2:- Given life time of different elephants find period when maximum number of elephants lived. ex [5, 10], [6, 15], [2, 7] etc. year in which max no elephants exists.

Other questions were regarding Operating system like virtual memory etc.

Round 4:-
It was HR round. Questions related to project. Questions like why I should Hire you etc were asked.

Result is still on wait.

This article is compiled by Naveen Kumar Singh. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

14 comments so far

  1. kalyan says:
    September 9, 2012 at 2:38 AM
    wat do u mean by minimum ancestor ? least common ancestor ???

    Reply

  2. Shivam says:
    September 6, 2012 at 11:26 PM
    In round 2 Ques 1: The given tree is a binary tree or binary search tree??

     /* Paste your code here (You may delete these lines if not writing code) */ 

    Reply

  3. Guest says:
    September 6, 2012 at 4:00 PM
    Also can you give insight on what solutions you had given and what expectations he had put for question1) round2, this will help us to know in what direction to prepare on answering any algo question

    Reply

  4. shinavi says:
    September 6, 2012 at 3:40 PM
    in round 3 question 1, shouldnt be do binary search on whole array for 1st position of one instead of doing it in steps of 100 ?

    Reply

  5. Priyank says:
    September 6, 2012 at 3:35 PM
    Can you please elaborate question 2 in round 3:

    ” Given life time of different elephants find period when maximum number of elephants lived. ex [5, 10], [6, 15], [2, 7] etc. year in which max no elephants exists. ”

    Reply

Comment

Click here to cancel reply.
Name (Required) Email (Required) Website URI Your Comment (Writing code? please paste your code between sourcecode tags)

 /* Paste your code here (You may delete these lines if not writing code) */ 
  • Loading
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s