rahul's Profile
Guru
153
points

Questions
0

Answers
26

rahul loves solving puzzles at PuzzleFry.com. I am proud PuzzleFry member and like my time invested in solving brain teasers.
  • Since this is the only way they will EVER get out of that prison, they decide to work together and make a plan. They select one prisoner (Bob, easier to refer) as the counter.

    Every time any prisoner is selected other than Bob, they follow these steps. If they have never turned on the light bulb before and the light bulb is off, they turn it on. If not, they don’t do anything (simple as that). Now if Bob is selected and the light bulb is already on, he adds one to his count and turns off the bulb. If the bulb is off, he just sits there meditates or whatever he wants to. The day his count reaches 99, he calls the warden and tells him “Every prisoner has been in the special room at least once”.

    So how does this solution work? Every time a prisoner enters the room first, he turns on the bulb if it is off. This way every prisoner turns on the bulb only once. When Bob enters and sees the bulb on, he knows that one new prisoner has entered  the room so he adds one to his count. So when his counter reaches 99, he knows the rest of them have all been in the special room and obviously, he has been in the special room.

    Do they really as these questions in a software interview? They do so better be prepared. Oh wait how can you prepare for such questions? The only thing you can do is practice.

    If you have any questions, please feel free to send me an email at [email protected]. If you have any interview questions which you feel would benefit others, I would love to hear about it.

    • 6663 views
    • 1 answers
    • 0 votes
  • Stumped? Let’s solve this methodically. Say there was only 1 cheating husband in the town. There will be 99 women who know exactly who the cheater is. The 1 remaining woman, who is being cheated on, would have assumed there are no cheaters. But now that the mayor has confirmed that there is at least one cheater, she realizes that her own husband must be cheating on her. So her husband gets executed on the day of the announcement.

    Now let’s assume there are 2 cheaters in the town. There will be 98 women in the town who know who the 2 cheaters are. The 2 wives, who are being cheated on, would think that there is only 1 cheater in the town.  Since neither of these 2 women know that their husbands are cheaters, they both do not report their husbands in on the day of the announcement. The next day, when the 2 women see that no husband was executed, they realize that there could only be one explanation – both their husbands are cheaters. Thus, on the second day, 2 husbands are executed.

    Through induction, it can be proved that when this logic is applied to n cheating husbands, they all die on the n th day after the mayor’s announcement.

    • 13826 views
    • 1 answers
    • 2 votes
  • Say we put all the red marbles into JAR A and all the blue ones into JAR B. then our chances for picking a red one are:

    1/2 chance we pick JAR A * 50/50 chance we pick a red marble
    1/2 chance we pick JAR B * 0/50 chance we pick a red marble

    You would try different combinations, such as 25 of each colored marble in a jar or putting all red marbles in one jar and all the blue in the other. You would still end up with a chance of 50%.

    What if you put a single red marble in one jar and the rest of the marbles in the other jar? This way, you are guaranteed at least a 50% chance of getting a red marble (since one marble picked at random, doesn’t leave any room for choice). Now that you have 49 red marbles left in the other jar, you have a nearly even chance of picking a red marble (49 out of 99).

    So the maximum probability will be :
    jar A : (1/2)*1 = 1/2 (selecting the jar A = 1/2, red marble from jar A = 1/1)
    jar B : (1/2)*(49/99) = 0 (selecting the jar B = 1/2, red marble from jar B = 49/99)
    Total probability = 74/99 (~3/4)

    • 5312 views
    • 1 answers
    • 0 votes
  • Answer:
    We have to be careful what we are adding together.

    Originally, they paid £30, they each received back £1, they now have only paid £27.
    Of this £27, £25 went to the manager for the room and £2 went to the bellboy.

    • 7543 views
    • 1 answers
    • 0 votes
  • Guru Asked on 12th July 2015 in Puzzles.

    Answer: There are 110 squares without a rook.

    There are 60 squares of size 1×1.
    There are 35 squares of size 2×2.
    There are 12 squares of size 3×3.
    There are 3 squares of size 4×4.

    A total of 60 + 35 + 12 + 3 = 110.

    • 6084 views
    • 2 answers
    • 0 votes
  • Guru Asked on 12th July 2015 in Puzzles.

    Peter Piper
    Alan Ardman
    Zach Zebra
    Frank Flintbone
    Matthew Merryman
    Jimmy James
    Graham Goodfellow
    Tom Trent
    Brian Brick
    Kevin Kingfisher

    • 6084 views
    • 2 answers
    • 0 votes