Tech Interview

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

    • 13 Apr 2010

      Noodles

      Posted at 11:07 am by Admin, on April 13, 2010

      There is a pot of N noodles. (so there are 2N ends). A person randomly grabs two ends and merges them. The person keeps doing it, until there are no more noodles, (and only loops), left in the pot. what’s the average number of loops in the pot?

      Continue reading →

      0 Comments
      Posted in regular
    • 13 Apr 2010

      Heaven

      Posted at 11:05 am by Admin, on April 13, 2010

      A person dies, and arrives at the gate to heaven. there are three doors. one of them leads to heaven. another one leads to a 1-day stay at hell, and then back to the gate, and the other leads to a 2-day stay at hell, and then back to the gate. every time the person is back at the gate, the three doors are reshuffled. How long will it take the person to reach heaven?

      Continue reading →

      0 Comments
      Posted in regular
    • 13 Apr 2010

      Flipping Coins

      Posted at 11:03 am by Admin, on April 13, 2010

      Someone walks into your room and dumps a huge bag of quarters all over the floor. They spread them out so no quarters are on top of any other quarters. a robot then comes into the room and is programmed such that if it sees a head, it flips it to tails. If it sees a tail, it throws it in the air. the robot moves around randomly forever. Will there be a convergence in distribution of heads vs. tails?

      Continue reading →

      0 Comments
      Posted in regular
    • 13 Apr 2010

      Pennies

      Posted at 11:00 am by Admin, on April 13, 2010

      I challenge you to a game. we each get one penny and we flip them at the same time. (so on turn 1, we each flip our respective pennies – turn 2, we flip them again, and so on until someone wins). I am looking to get heads then tails. You are looking to get heads then heads. So if you flip heads on any flip and then heads on the next flip, you win. If I flip heads on any flip and then tails on the next flip, I win. (its not a speed race, we both flip at the same time, except i’m only concerned with what appears on my coin, and you are only concerned with whats on your coin). Are the odds fair? (obviously not, otherwise this wouldn’t be a question). who has the advantage and why?

      Continue reading →

      0 Comments
      Posted in regular
    • 9 Apr 2010

      Linked List

      Posted at 12:37 pm by Admin, on April 9, 2010

      How does one find a loop in a singly linked list in O(n) time using constant memory? You cannot modify the list in any way (and constant memory means the amount of memory required for the solution cannot be a function of n.).

      Continue reading →

      0 Comments
      Posted in regular
    • 9 Apr 2010

      Last Ball

      Posted at 12:35 pm by Admin, on April 9, 2010

      You have 20 blue balls and 14 red balls in a bag. you put your hand in and remove 2 at a time. If they’re of the same color, you add a blue ball to the bag. If they’re of different colors, you add a red ball to the bag. (assume you have a big supply of blue & red balls for this purpose. note: when you take the two balls out, you don’t put them back in, so the number of balls in the bag keeps decreasing). What will be the color of the last ball left in the bag?

      Continue reading →

      0 Comments
      Posted in regular
    • 9 Apr 2010

      Coin Rolls

      Posted at 12:31 pm by Admin, on April 9, 2010

      Every night, I dump all the change in my pocket into a big bucket.

      When I buy things, I never hand over coins. always bills. So I accumulate a lot of coins. Even if the purchase price is $1.01, and I have lots of coins in my pocket, I pay $2 and take the 99 cents in change. All the more coins to dump in my change bucket!

      Continue reading →

      0 Comments
      Posted in regular
    • 9 Apr 2010

      Calendar Cubes

      Posted at 12:24 pm by Admin, on April 9, 2010

      A man has two cubes on his desk. every day he arranges both cubes so that the front faces show the current day of the month. what numbers are on the faces of the cubes to allow this?

      Solution

      First, to show all possible days, we’d need one of each of the ten digits. We’d also need two 1s and two 2s to show 11 and 22. That’s twelve numbers right there. Two cubes, twelve faces, so every face is used. Quite elegant.

      Continue reading →

      0 Comments
      Posted in regular
    • 9 Apr 2010

      Boys and Girls

      Posted at 12:19 pm by Admin, on April 9, 2010

      In a country in which people only want boys, every family continues to have children until they have a boy. if they have a girl, they have another child. if they have a boy, they stop. what is the proportion of boys to girls in the country?

      Continue reading →

      0 Comments
      Posted in regular
    • 2 Apr 2010

      Painfully Easy

      Posted at 12:23 pm by Admin, on April 2, 2010

      I flip a penny and a dime and hide the result from you. “one of the coins came up heads”, i announce. what is the chance that the other coin also came up heads?

      Solution

      Assuming complete honesty on the part of the flipper, wouldn’t the solution be 33%?

      Continue reading →

      0 Comments
      Posted in regular
    ← Older posts
    Newer posts →

Proudly powered by WordPress.

Theme: Minipress by Obox Themes.