Monday, April 14, 2008

Tough Interview Questions: #50: The Price of Fruit

There are four groups of Mangoes, Apples and Bananas as follows:
Group I : 1 Mango, 1 Apples and 1 Banana
Group II : 1 Mango, 5 Apples and 7 Bananas
Group III : 1 Mango, 7 Apples and 10 Bananas
Group IV : 9 Mango, 23 Apples and 30 Bananas
Group II costs Rs 300 and Group III costs Rs 390.
Can you tell how much does Group I and Group IV cost?

Group I costs Rs 120 and Group IV costs Rs 1710
Assume that the values of one mango, one apple and one banana are M, A and B respectively.
From Group II : M + 5A + 7B = 300
From Group III : M + 7A + 10B = 390
Subtracting above to equations : 2A + 3B = 90
For Group I :
= M + A + B
= (M + 5A + 7B) - (4A + 6B)
= (M + 5A + 7B) - 2(2A + 3B)
= 300 - 2(90)
= 300 - 180
= 120
Similarly, for Group IV :
= 9M + 23A + 30B
= 9(M + 5A + 7B) - (22A + 33B)
= 9(M + 5A + 7B) - 11(2A + 3B)
= 9(300) - 11(90)
= 2700 - 990
= 1710
Thus, Group I costs Rs 120 and Group IV costs Rs 1710.


Jeff Altman 
The Big Game Hunter
www.TheBigGameHunter.us
JeffAltman@TheBigGameHunter.us

© 2008 all rights reserved.

No comments: