Amazon Interview Question
Software Engineer / Developers@Satish: Generalizing from above, if the first jumper knows if he's gonna get heaven of hell, he can convey this in the piece of paper and not open the parachute. Now based on what is written in the paper, the second jumper can either kill the diving instructor to reach hell or he can bequeath all his property to charity in order to reach heaven! -----> Learning: Give super troll solutions or don't try to go that side.
Two people travelling through flight and not knowing where to meet must be elite commando .. and the amazon interviewer is the Man Vs Wild fan ..
else they write coordinate ... use some pre-historic pole star angle mechnism.. but best answer is to slap the interviewer..three life's can not depend on an insane mind (2 jumper and 1 interviewee)
Now after landing assuming all you have is your parachute and that the other person will be alive, and no sandstorms, no unexpected and disastrous events.
A feasible algorithm:
1. after landing leave your parachute and mark your name on it.
2. keep looking around your landing location in circles increasing radius. i.e. cover a circle area of 100 meters and go back to parachute location, then cover a circle area of 200 meters and go back to parachute location. cover a circle of 300 meters and go back to parachute location.
3. If found a different parachute while searching person1 stops at that location and person2 will always come back to his parachute.
uhhhhh....a classic deadlock eh? I could not stop laughing as soon as i read your comment....bravo...it was so elegent that it would get merit in any TV sitcom
Add additional condition, if they find the other persons parachute, they travel back and forth between the parachutes and during this process both can meet up sometime within that distance! :)
Deadlock resolved.... :)
the strategy should be..one walks in the direction of the flight and the other opposite of the flight's direction. and they should write their strategy and direction before jumping... :)
'A' writes on paper "Move east and wait at the first city police station you will get into"
Now, if 'A' has jumped at any location (whether it is far or near from the first city in the East direction), he need to walk till he gets the city place and whenever 'B' will jump he also needs to travel for the city located in east direction.
damn!!!!
when they jump,they are not blind,they can see what direction the other one went,atleast for a while.When they land they keep moving in that direction .
Q:how did Surveyors draw maps of earth when there was no airplanes/satelites in the days of vasco da gama and Columbus.
hey, what will happen if the desert is vry large nd plane is gets very far as now other person cannot see it and at that time it changes the direction nd then other person jumps...ur solution will not work here!
Suppose the desert is a bounded contiguous set in the plane, with a continuous boundary. (A pretty reasonable assumption).
Now the algorithm becomes - have both men walk to the edge of the desert (i.e. the boundary of the set), and then have them follow the edge in opposite directions - one goes clockwise, the other counterclockwise. Eventually they'll meet.
They will write their mobile numbers on it
- Ayush June 23, 2012