Log Date

Welcome to techInterview, a site for technical interview questions, brain teasers, puzzles, quizzles (whatever the heck those are) and other things that make you think!





  1. Text post

    Salaries

    Three coworkers would like to know their average salary. how can they do it, without disclosing their own salaries?

    Read More

    Notes: 2 notes

  2. Text post

    World Series

    You have $10,000 dollars to place a double-or-nothing bet on the Yankees in the World Series (max 7 games, series is over once a team wins 4 games).

    Unfortunately, you can only bet on each individual game, not the series as a whole. how much should you bet on each game, so that, if the yanks win the whole series, you expect to get 20k, and if they lose, you expect 0?

    Basically, you know that there may be between 4 and 7 games, and you need to decide on a strategy so that whenever the series is over, your final outcome is the same as an overall double-or-nothing bet on the series.

    Read More

  3. Text post

    100 Factorial

    how many trailing zeroes are there in 100! (100 factorial)?

    Read More

  4. Text post

    Oil Mogul

    You are an oil mogul considering the purchase of drilling rights to an as yet unexplored tract of land.

    The well’s expected value to its current owners is uniformly distributed over [$1..$100]. (i.e., a 1% chance it’s worth each value b/w $1..$100, inclusive).

    Because you have greater economies of scale than the current owners, the well will actually be worth 50% more to you than to them (but they don’t know this).

    The catch: although you must bid on the well before drilling starts (and hence, before the actual yield of the well is known), the current owner can wait until *after* the well’s actual value is ascertained before accepting your bid or not.

    What should you bid?

    Read More

  5. Text post

    Vienna

    It’s the middle ages, you’re travelling across europe and you want to find the way to vienna. you come to a crossroads, now there are two ways to go. at the crossroads stand a knight and a knave. the knight answers every question truthfully. the knave answers every question falsely. you don’t know which guy is which. how can you figure out which road leads to Vienna by only asking one question?

    Read More

    Notes: 1 note

  6. Text post

    Duel

    You find yourself in a duel with two other gunmen. you shoot with 33% accuracy, and the other two shoot with 100% and 50% accuracy, respectively. the rules of the duel are one shot per-person per-round. the shooting order is from worst shooter to best shooter, so you go first, the 50% guy goes second, and the 100% guy goes third.

    where or who should you shoot at in round 1?

    Read More

    Notes: 2 notes

  7. Text post

    Hen

    If a hen and a half lay an egg and a half in a day and a half, how many hens does it take to lay six eggs in six days?

    Read More

  8. Text post

    Box ‘o Numbers

    Arrange the numbers 1 to 8 in the grid below such that adjacent numbers are not in adjacent boxes (horizontally, vertically, or diagonally):

           ___
    | 1 |
    =============
    | 6 | 4 | 3 |
    =============
    | 2 | 7 | 5 |
    =============
    | 8 |
    =====

    The arrangement above, for example, is wrong because 3 & 4, 4 & 5, 6 & 7, and 7 & 8 are adjacent.

    Read More

  9. Text post

    Coin Problem

    some of you may have easily solved the pill weighing problem posed here. If so, you are going to love this problem. It is similar but much more difficult.

    from my buddy Tom:

    Ok, here’s a tough one (i thought). There are no “aha!” tricks - it requires straightforward deductive-reasoning.
    You have 12 coins. one of them is counterfeit. All the good coins weigh the same, while the counterfeit one weights either more or less than a good coin. Your task is to find the counterfeit coin using a balance-scale in 3 weighs. Moreover, you want to say whether the coin weighs more or less than is should and, and this is the real kicker, your weighs must be non-adaptive, that is, your choice of what to put on the balance for your second weigh cannot depend on the outcome of the first weigh and your decision about what to weigh for round 3 cannot depend on what happened either your first or second weigh. For example, you can’t say something like “take coin #1 and coin #2 and weigh them. If they balance, then take coins 3,4,5 and weight them against 6,7,8…if 1 and 2 don’t balance, then weigh #1 vs #12…” you have to say something like:
    round #1: do this
    round #2: do this
    round #3: do this
    if the results are left tilt, balanced, and left tilt, respectively, then coin #11 is heavier than it should be.

    This problem is solvable…it took me about 1-2 hours of working on it to get it. I think even finding the counterfeit using an adaptive solution is tough. Then non-adaptive constraint makes it quite hard and having to find whether it’s heavier and lighter is cruel and unusual riddling ;-)

     

  10. Text post

    Parallel Lines

Tumblr Theme 'Nautical' by PixelUnion