Interview Question
Applications Developer Interview

Thoughtworks10 people can share a bucket of coins equally. A monkey steals one coin. The no of coins are one less than equal share. one person after the other tries to take the coin but monkey kills them(killing spree?? :)). each time a person dies the no of coins are always one short of equal share. what were the no of coins originally?.
AnswerAdd Tags
Interview Answers
11 Answers
▲
5
▼
I wont give the answer. Hint : know who divides you ;)
Anonymous on
▲
2
▼
I think 2520 is perfect
Anonymous on
▲
1
▼
Answer is pretty simple: m%10=0 case 1 Lets assume n=m1 Since the remainder is always same , when n is divider by any number from 10 to 1.. n%10 = n%9=.........=1 That means n+1 is completely divisible by all numbers from 10 to 1.. (Since it gives common remainder).. n + 1= Lcm of (1 to 10) = 2520 But we assumed n = m1, so m 1+1 =m = 2520
Shadman on
▲
0
▼
Yes any Common multiple of the factors is a solution.
Anonymous on
▲
0
▼
sweet:) nice ans. also think of 10! since the numbers in factorial are the remaining people after each iteration(2x3x4x5x6x7x8x9x10) and they form factors of the factorial number. and the factorial  1 will always be one less than equal share. this fits the solution:)
Anonymous on
▲
0
▼
if monkey steal one coin then as per your ans coins==9. then one person dies so 9%9 is==0. which is not possible. it is not 20 also just to give a bigger hint.:)
No :) on
▲
1
▼
Exact answer is 30 coins. Since each time monkey kills one person.
Anonymous on
▲
0
▼
This is correct for 10 coins as well
Anonymous on
▲
0
▼
suppose initial coins were 30 then money steals one coin so #coins = 29. now 10 people are there and the no of coins are 1 less than equal share i.e if 30 coins were there 3 per person but only 29 coins are there. so this case is ok. lets look for 9 people, since monkey kills one guy. now for 9, 29 is not one short of equal share because 9*3 ==27 , 9*4 == 36 neither of which satisfy the condition. so 30 cannot be the original coins. same thing for 8,7,6,.. 10 coins cannot be the original. Please read the question carefully.. this hint will be the closest to the answer, keep this part of the question in mind : "each time a person dies the no of coins are always one short of equal share".
not 30. the question has to be read very carefully. on
▲
0
▼
I think it is 2520 i.e.LCM of 210
Krunal on
▲
0
▼
Multiples of 2520 will be the answer
Anonymous on
Add Answers or Comments
To comment on this, Sign In or Sign Up.