分享

google and microsoft interview questions and solutions (2)...

 weicat 2007-08-31
1.Four people need to cross a rickety rope bridge to get back to their camp at night. Unfortunately, they only have one flashlight and it only has enough light left for seventeen minutes. The bridge is too dangerous to cross without a flashlight, and it’s only strong enough to support two people at any given time. Each of the campers walks at a different speed. One can cross the bridge in 1 minute, another in 2 minutes, the third in 5 minutes, and the slow poke takes 10 minutes to cross. How do the campers make it across in 17 minutes?

Lets call the guys 1,2,5,10 for convenience based on time required to go. First, 1 and 2 go, 1 comes back , Total Time: 2+1 = 3 Second, 5 & 10 go, 2 comes back (remember 2 is on other side from prev round) , Total Time = 10+ 2+ 3(prev round) = 15. Third, 1 and 2 remain ,they go, Total time = 2 + 15(from prev round) = 17.

2. If the probability of observing a car in 30 minutes on a highway is 0.95, what is the probability of observing a car in 10 minutes (assuming constant default probability)?

solution 1:
You have to look at your probability of NOT seeing a car, which is .05 in 30 minutes. In order to break this down into 10 minute chunks, you need to figure out how you arrived at that probability, which would be x * x * x = .05, so x ^ 3 = .05.

I don‘t have a calculator, but the then you would have the third root of .05. Then you would subtract that from 1 and arrive at your 10 minute probability.

solution 2:
Let p is a probability to see a car in 10 minutes.
Then (1-p) is probability NOT to see a car in 10 minutes.
Then probability NOT to see a car in 30 minutes is (1-p)*(1-p)*(1-p).
(1-p)^3 == 0.05
So p = 1-0.05^(1/3)~ 0.63


3.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?

4.
You have an empty room, and a group of people waiting outside the room. At each step, you may either get one person into the room, or get one out. Can you make subsequent steps, so that every possible combination of people is achieved exactly once?

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多