I want to share one puzzle which was asked to me in one technical interview.
Puzzle- One camel owner want to transport 3000 Bananas to market, which is 1000 Km from his house. Maximum 1000 Bananas camel can carry one time. It (camel) eats one banana for every Km it travels.
What is the largest number of bananas that can be delivered to the market ?
Solution -
First find distance, where camel can carry 2000 bananas(Multiple of max. carrying capacity) i.e. Point C .
So 3 times camel need to travel Distance AC, also 2 times need to comeback from C to A.
Total distance traveled between AC = 3 x Distance AC + 2 x Distance CA = 3X+2X = 5X ①
Also 1 Km = 1 bananas. So 1000 bananas completed = 1000km traveled ②
From ① and ②
1000 Kms = 5X means X= 200 Kms. ③
Now Same steps for Distance CD. 2 times camel need to travel Distance CD, also once need to comeback from D to C.
Total Distance traveled between CD = 2 x Distance CD + 1 x Distance DC = 2Y+Y= 3Y ④
From ② and ④
1000 Kms = 3Y means Y= 1000/3 = 333 Kms ⑤
Here 1000 not divisible
by 3, So distance traveled 333 x 3 =999 Kms between CD.
So total Bananas remaining 2000 -999 = 1001 bananas ⑥
Now total distance between AD = Distance AC
+ Distance CD = X + Y = 200 +333 = 533.
Remaining distance = 1000 -533 = 467 Kms
Max. carrying capacity 1000 bananas and 467 bananas for remaining 467 Kms. So Bananas delivered to at Point B is 1000 – 467= 533 bananas ⑦
Maximum
possible bananas delivered to market are 533.
No comments:
Post a Comment