Puzzles Problem Solving

Card Set Information

Author:
fgharo
ID:
280021
Filename:
Puzzles Problem Solving
Updated:
2014-08-13 16:53:02
Tags:
eliminating impossible openmind
Folders:
Interview
Description:
Problems that could be encountered in a technical interview.
Show Answers:

Home > Flashcards > Print Preview

The flashcards below were created by user fgharo on FreezingBlue Flashcards. What would you like to do?


  1. You are given a two sided scale and you are given 8 basketballs that all weigh equal except for one ball that weighs a little more than any of the other balls. What would you do in order to find the heavier ball in only 2 weighings?
    Group the balls into one with 2 balls and one with 6 balls.

    1. Divide the group of 6 into 2 halves and put each half on the scale.

    a. If one of the sides sinks lower, then that group has the heavier ball otherwise go to step b. Split the group of 3 balls into one with 1 ball and one with 2 balls. Place the 2 balls on the scale, if one side sinks lower that is the side that has the heavier ball.

    b. Since the group of 6 did not have the ball we move to the group of 2 balls. Place both balls on different sides of scales the side that sinks lower is the side with the heavier ball.
  2. You are given two ropes of equal length with each rope having  burning different densities throughout. You are also given a lighter that can ignite any of the ropes. It takes about 1 hour for a rope to burn. How could you measure a 45 minute passing?
    Ignite both ends of the first rope and ignite one end of the second rope at the same time. When the two flames meet on the first rope 30 minutes have passed, the first rope is all burned and the second rope has 30 minutes left of burning. Finally light the non ignited end of the second rope. Since both ends are burning the time will be divided in half once again. 30 minutes from first ignition + 15 minutes from the second ignition sums to 45 minutes of burning.
  3. There are 3 highly intelligent men named a, b, and c standing in front of a white wall like so:
    a   b   c   whitewall
    All men are looking at what is in front of them so c can only see the white wall, b can see the back of c's head and the white wall, and a can see the back of both b and c's heads and the white wall in front of him.
    There are 3 black hats and 2 white hats in a bag.
    We randomly draw 3 hats and place them on each of the men's heads. They can't see what hat is on their own head.
    We ask a what hat he is wearing. a says IDK.
    We ask b what hat he is wearing. b says IDK.
    We ask c what hat he is wearing. c says IK.
    What hat is c is wearing? and how does c know?
    • a can either be wearing white or black yielding 2 possibilities.
    • a combined with b yields 4 possible scenarios.
    • a combined with b combined with c yields 8 scenarios.
    • 2*2*2 = 8
    • Here is a truth table expressing all possibilities.
    • a        b         c
    • black black black
    • white black black
    • black white black
    • white white black

    • black black white
    • white black white
    • black white white
    • white white white

    • Let us only consider cases when c is wearing a white hat. It is given that they're 3 black hats and 2 white hats so last choice is impossible.
    • black black white
    • white black white
    • black white white

    • For the case when c is wearing a white hat and b is wearing a white hat, a should have known he was wearing black. But a said IDK. So this cannot be the case either.
    • black black white
    • white black white

    For the remaining cases b should have known he was wearing a black hat but he said IDK. C could not be wearing a white hat thus C must be wearing a black hat.
  4. There are two towns, one called lie town and one called truth town. All people from lie town lie and all people from truth two are honest. You come to a fork in the road where one path leads to lie town and one path leads to truth town. There is one person at the fork in the road that is either from lie town or from truth town. What on question do you ask to get to truth town?
    Where is the road to lie town? Both the liar and the honest person will point to the path which is truth town.

    OR

    Where is your home?
  5. You are given a two sided scale and you are given 16 basketballs that all weigh equal except for one ball that weighs a little more than any of the other balls. What would you do in order to find the heavier ball in only 3 weighings?
    Put 8 balls on each side. The side that lowers is the group with the heavier ball.

    • Divide the ball into a group of 2 and a group of 6.
    • case 1:
    • Assume the group of 6 has the heavier ball so test this group with below method which would yield at most 2 weighs. We would have used 1 weigh from group of 16, and 2 weighs from group of 6 = 3 weighs.

    • case 2:
    • Assume the group of 6 didn't have the heavier ball so test the group of 2 with below method which would yield at most 1 weighs. We would have used 1 weigh from group of 16, 1 weigh for the group of 6 and 1 weigh from group of 2 = 3 weighs.

    • For group of 6:
    • place 3 balls on each side. The group that lowers has the heavier ball. That group of 3 can be divided using method below. max # of weighs: 1 + number of weighs for group of 3 = 1 + 1 = 2

    • For group of 3:
    • place two of the balls on the sides of the scale. The ball that lowers is the heavier ball, else if none of the sides lower we know the left out ball is the heavier one. max # of weighs: 1.

    • For group of 2:
    • Place each ball on one side the ball that lowers is the heavier ball. max # of weighs: 1.

What would you like to do?

Home > Flashcards > Print Preview