«

»

Dec 06 2005

MS Riddles

Cool riddles that supposedly come from Microsoft's interview process:

  1. You're outside the door to a room with 3 light bulbs. The door to it is closed. On the wall next to the door are 3 light switches, each corresponding to one of the light bulbs inside. You need to identify which switch goes to which bulb, but once you open the door to look you are not allowed to touch the switches again. How do you do it?
    Solution (highlight):
    If we call the switches A, B, and C, flip on A, wait a minute, then flip off A and flip on B. The warm bulb that is off is A, the one that's on is B, and the one that's off is C.
  2. Before you are 2 jars. You have 100 marbles: 50 blue and 50 red. A jar will be picked at random, and then a marble picked at random from that jar. Assuming that every marble is used, how would you distribute the marbles to maximize the chance of getting a red marble? What is that probability?
    Solution (highlight):
    Short version: Put one red marble in the first jar and all the rest in the second jar. Long version: If there are x reds and y blues in jar 1, then the probability of getting a red marble is x/2(x+y) + (50-x)/2(100-x-y). Since y appears in the denominators only, clearly we want y=0. The resulting expression is minimized for x=1 (we can't have both x and y equal to 0 in this formula). The probability in this case is 0.7474 (repeating).

6 comments

Skip to comment form

  1. Julianna

    I love the lightbulb one but the other one just pissed me off because I would have NEVER guessed that!

    I have a couple but I don't know how to do your highlight trick....

    If a snail is in a well that is 100 feet deep and he crawls up 2 feet each day and then slides back 1 foot each day, how many days does it take him to get out of the well?

    If a pond is an acre in circumference and there are lily pads in that pond that double in size every day, how full will that pond be the day before it is completely covered with lily pads?

    i will give the answers tomorrow after work....not that y'all will need them!

  2. Jessica

    Those are MATH. Bleagh!

    Incidentally, the key to the highlight trick is, as with so many things, html--if you wrap the text in color tags and match that color to the site background color (see here), the text is "invisible" until it's highlighted. The code can be found in the stylesheet (which WordPress displays if you go to the admin area, then click Manage, then click Files).

    Blue text!

  3. Reuben

    1. Neglecting boundary issues, should be 100 days. His average speed is just 1 ft/day.

    2. Half acre or more.

    Unless I'm missing some tricks.

  4. Julianna

    Reuben is BRILLIANT!!! I must say, that I was laying in bed last and night and was cursing myself because I worded the last riddle wrong.

    It should have read:

    If a pond is an acre in circumference and the lily pads in the pond double in size each day, if the pond is full on the 30th day, on what day will that pond be half full?

    The answer is the 29th day....because the next day it would double and be full. I screwed that one up but Reuben got the jist.

    Now, for the snail......

    If the snail is at 98 feet, he goes up 2 feet and then back 1......He is out at day 99 because he is out after the first foot...he wouldn't be sliding anymore.

    I told people at work about the light riddle, they all sighed because at first, it seems impossible.

  5. Julianna

    Hey Jessica, I can't find your email, so please forgive me for hogging your comment section.

    I have a troll who has been writing emails which I have ignored and now she is posting comments on my blog.

    Is there a way with WP to block users??

    She has a made up ISP:

    Domain Name (Unknown)
    IP Address 72.140.84.# (Unknown Organization)
    72.140.84.103
    ISP Unknown ISP
    Location Continent : Unknown
    Country : Unknown Country
    Lat/Long : unknown

    Language English (United States)
    en-us
    Operating System Microsoft WinXP
    Browser Internet Explorer 6.0
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; YPC 3.2.0; (R1 1.3); .NET CLR 1.1.4322)
    Javascript version 1.3
    Monitor Resolution : 1024 x 768
    Color Depth : 32 bits

    Time of Visit Dec 17 2005 10:33:44 am
    Last Page View Dec 17 2005 10:57:13 am
    Visit Length 23 minutes 29 seconds
    Page Views 8
    Referring URL
    Visit Entry Page http://myeggsarecooked.wired-hub.com/
    Visit Exit Page http://myeggsarecook...wired-hub.com/?p=131
    Time Zone UTC-5:00
    EST - Eastern Standard
    EDT - Eastern Daylight Saving Time
    Visitor's Time Dec 17 2005 1:33:44 pm

  6. Julianna

    Ohhhh goodness gracious! I am laughing so hard.....you are absolutely brilliant!!!!

Comments have been disabled.