PDA

View Full Version : Computers Google Interview Questions


Ari Chi3fs
08-09-2008, 01:33 AM
The Google Interview has some strange questions on it, apparently. What are your answers? And the answer key is no where to be found.


1. How many golf balls can fit in a school bus?

2. You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty glass blender. The blades will start moving in 60 seconds. What do you do?


3. How much should you charge to wash all the windows in Seattle?


4. How would you find out if a machineís stack grows up or down in memory?


5. Explain a database in three sentences to your eight-year-old nephew.


6. How many times a day does a clockís hands overlap?


7. You have to get from point A to point B. You donít know if you can get there. What would you do?


8. Imagine you have a closet full of shirts. Itís very hard to find a shirt. So what can you do to organize your shirts for easy retrieval?


9. Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens?


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


11. 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)?

12. If you look at a clock and the time is 3:15, what is the angle between the hour and the minute hands? (The answer to this is not zero!)


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

14. You are at a party with a friend and 10 people are present including you and the friend. your friend makes you a wager that for every person you find that has the same birthday as you, you get $1; for every person he finds that does not have the same birthday as you, he gets $2. would you accept the wager?

15. How many piano tuners are there in the entire world?


16. You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier by using a balance and only two weighings?


17. You have five pirates, ranked from 5 to 1 in descending order. The top pirate has the right to propose how 100 gold coins should be divided among them. But the others get to vote on his plan, and if fewer than half agree with him, he gets killed. How should he allocate the gold in order to maximize his share but live to enjoy it? (Hint: One pirate ends up with 98 percent of the gold.)

Guru
08-09-2008, 02:34 AM
The Google Interview has some strange questions on it, apparently. What are your answers? And the answer key is no where to be found.


1. How many golf balls can fit in a school bus?

Depends, are the windows and doors open or closed?

2. You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty glass blender. The blades will start moving in 60 seconds. What do you do?

Stand clear.

3. How much should you charge to wash all the windows in Seattle?

Nothing. The rain takes care of that.

4. How would you find out if a machineís stack grows up or down in memory?

It doesn't grow.

5. Explain a database in three sentences to your eight-year-old nephew.

Who cares? I don't. Do you?

6. How many times a day does a clockís hands overlap?

Does that include the second hand?

7. You have to get from point A to point B. You donít know if you can get there. What would you do?

I hate B's anyway.

8. Imagine you have a closet full of shirts. Itís very hard to find a shirt. So what can you do to organize your shirts for easy retrieval?

hang them all in a closet

9. Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens?

Anarchy. It is the queen.

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

1:1

11. 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)?

2.85

12. If you look at a clock and the time is 3:15, what is the angle between the hour and the minute hands? (The answer to this is not zero!)

They are perpendicular

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

Why do four people only have one flashlight?

14. You are at a party with a friend and 10 people are present including you and the friend. your friend makes you a wager that for every person you find that has the same birthday as you, you get $1; for every person he finds that does not have the same birthday as you, he gets $2. would you accept the wager?

Sure, it doesn't say I am the one paying him.

15. How many piano tuners are there in the entire world?

what? can they tuna fish?

16. You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier by using a balance and only two weighings?

Guess

17. You have five pirates, ranked from 5 to 1 in descending order. The top pirate has the right to propose how 100 gold coins should be divided among them. But the others get to vote on his plan, and if fewer than half agree with him, he gets killed. How should he allocate the gold in order to maximize his share but live to enjoy it? (Hint: One pirate ends up with 98 percent of the gold.)

meh, my brain hurts now


:doh!:

cdcox
08-09-2008, 09:08 AM
The Google Interview has some strange questions on it, apparently. What are your answers? And the answer key is no where to be found.


1. How many golf balls can fit in a school bus?

This is an estimation problem. You have to estimate the volume of the bus, and the diameter of the golf ball, and then assume some kind of packing configuration for the balls. Should be able to get within a factor of 2.


2. You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty glass blender. The blades will start moving in 60 seconds. What do you do?

Not sure on this one. You'd probably be thin enough to pin yourself against the walls of the blender, thus avoiding the blades.

3. How much should you charge to wash all the windows in Seattle?

I think this is another estimation problem. Or you are supposed to anwer that there is not enough money in the world.
6. How many times a day does a clockís hands overlap?

23

7. You have to get from point A to point B. You donít know if you can get there. What would you do?

Make a new plan that does not require me to get from point A to point B.



9. Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens?

I keep coming up with nothing happens. Anyone got a different expanation?

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

1:1


11. 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)?

about 63%

12. If you look at a clock and the time is 3:15, what is the angle between the hour and the minute hands? (The answer to this is not zero!)

7.5 degrees


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

Send over the 2 min and 1 min guys. 1 min guy comes back with light Time elapsed = 3 min

Send over the 10 and 5 min guys. 2 min guy comes back with light Time elapsed =12 min

1 and 2 min guys cross. Time elapsed = 2 min

total time =17 min

14. You are at a party with a friend and 10 people are present including you and the friend. your friend makes you a wager that for every person you find that has the same birthday as you, you get $1; for every person he finds that does not have the same birthday as you, he gets $2. would you accept the wager?

No. I don't get this one at all

15. How many piano tuners are there in the entire world?


estimation problem ?

16. You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier by using a balance and only two weighings?

put 3 balls on each side of the balance.

if one group is heavier, you know the heavy one is in that group. Then select two balls from that group. If the two weigh the same, you know it is the ball you didn't put on the balance.

if neither group is heavier, the heaviest ball must be in the two you didn't weigh. Use your second measurement to figure out which one.




The others either didn't know or didn't want to spend the time thinking about.

Bearcat
08-09-2008, 10:07 AM
9. Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens?[/I]



Say there are 2 couples on the island, and ONE husband has cheated....
The one who does not see a woman who has been cheated on logically knows she has been cheated on, and kills her husband. The other one, having seen someone who had been cheated on, logically knows she hasn't been cheated on, because it's the only way the other one would have known.

Say there are 3 couples, and ONE has cheated.
Again, the one who does not see a woman who has been cheated on logically knows she has been cheated on, and kills her husband. The other two, having seen one cheated and one not-cheated, know they're not-cheated for the same reason as above.

Say there are 4 couples, and TWO have cheated.
No one kills the first day because everyone can see at least one cheated. When no one kills, each cheated (who can see only one other cheated) knows there has to be at least two cheated because the other one didn't kill the first day (like above). Since they only see one other cheated, each knows they are the other cheated, so they both kill the second day.

Say there are 6 couples, and THREE have cheated (Cheated1, Cheated2, Cheated3).
No one kills the first day because everyone can see at least two cheated. When no one kills, Cheated1 knows Cheated2 didn't kill because she saw at least one other Cheated (Cheated1 and/or Cheated3). No one kills the second day. So, had Cheated2 only seen one other cheated, she could have killed the second night (as the previous example states). Since she did not, there has to be at least 2 cheated (Cheated1 and Cheated3). Each cheated knows this, so they can all kill on the 3rd day.

The logic holds because each day, what changes is whether or not wives kill... so, for 100, the cheateds would all kill on the 100th day.

cdcox
08-09-2008, 12:18 PM
Say there are 2 couples on the island, and ONE husband has cheated....
The one who does not see a woman who has been cheated on logically knows she has been cheated on, and kills her husband. The other one, having seen someone who had been cheated on, logically knows she hasn't been cheated on, because it's the only way the other one would have known.

Say there are 3 couples, and ONE has cheated.
Again, the one who does not see a woman who has been cheated on logically knows she has been cheated on, and kills her husband. The other two, having seen one cheated and one not-cheated, know they're not-cheated for the same reason as above.

Say there are 4 couples, and TWO have cheated.
No one kills the first day because everyone can see at least one cheated. When no one kills, each cheated (who can see only one other cheated) knows there has to be at least two cheated because the other one didn't kill the first day (like above). Since they only see one other cheated, each knows they are the other cheated, so they both kill the second day.

Say there are 6 couples, and THREE have cheated (Cheated1, Cheated2, Cheated3).
No one kills the first day because everyone can see at least two cheated. When no one kills, Cheated1 knows Cheated2 didn't kill because she saw at least one other Cheated (Cheated1 and/or Cheated3). No one kills the second day. So, had Cheated2 only seen one other cheated, she could have killed the second night (as the previous example states). Since she did not, there has to be at least 2 cheated (Cheated1 and Cheated3). Each cheated knows this, so they can all kill on the 3rd day.

The logic holds because each day, what changes is whether or not wives kill... so, for 100, the cheateds would all kill on the 100th day.


Got it. I read "must kill her husband that very day" as "must kill her husband immediately" in which case it wouldn't work. Thanks.

Bearcat
08-09-2008, 12:25 PM
Got it. I read "must kill her husband that very day" as "must kill her husband immediately" in which case it wouldn't work. Thanks.

If you Google 'blue eye puzzle', you'll get the 'hardest logic riddle in the world'... it's the same thing, but you have people on the island with brown and blue eyes, and once someone can logically figure out they have blue eyes, they can leave.

A coworker gave it to me about a year ago, and it took some time to wrap my mind around it, before I finally broke it down like my previous post. I know a few pretty intelligent people that are convinced the logic is wrong.

Otter
08-09-2008, 12:59 PM
There's no answer key to be found to these questions? There's a shocker.

Ari Chi3fs
08-09-2008, 01:03 PM
10. 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?

I would seem to me that if they have a boy the first time, then the stop. so say 50% of the people stop having any more kids.

so on the second round of having kids... 50% will have a girl / 50% will have a boy. so 25% overall will stop having kids.

now 1/4 of the people are trying to have kids again... and 1/2 of them will have boys and stop...

so, it can't be 1:1

cdcox
08-09-2008, 10:15 PM
Ari:

Half the people will have no girls.
1/4 will have 1 girl.
1/8 will have 2 girls.
1/16 will have 3 girls.
1/32 will have 4 girls.
etc

0*1/2 + 1*1/4 + 2*1/8 +3*/16 + 4/32 + .... = 1 girl on average.

J Diddy
08-09-2008, 10:52 PM
The Google Interview has some strange questions on it, apparently. What are your answers? And the answer key is no where to be found.


1. How many golf balls can fit in a school bus?

1 really large 1

2. You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty glass blender. The blades will start moving in 60 seconds. What do you do?

get out of the ****ing blender

3. How much should you charge to wash all the windows in Seattle?

80 million then run, they'll never figure out you're not working Seattles big and for 80 million you could hire the a team

4. How would you find out if a machineís stack grows up or down in memory?

ask a nerd

5. Explain a database in three sentences to your eight-year-old nephew.

It's something nerds use.


6. How many times a day does a clockís hands overlap?

none, I've got all digital clocks

7. You have to get from point A to point B. You donít know if you can get there. What would you do?

expedia.com


8. Imagine you have a closet full of shirts. Itís very hard to find a shirt. So what can you do to organize your shirts for easy retrieval?

ask my wife to pick me out a shirt


9. Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens?

She kills her husband, the cheating pricks

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

depends if the chicks are hot or not

11. 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)?

100% as I look into my garage

12. If you look at a clock and the time is 3:15, what is the angle between the hour and the minute hands? (The answer to this is not zero!)

yet again, where are these people from
it's a digital world

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

turn the flash light off til you get to the bridge

14. You are at a party with a friend and 10 people are present including you and the friend. your friend makes you a wager that for every person you find that has the same birthday as you, you get $1; for every person he finds that does not have the same birthday as you, he gets $2. would you accept the wager?

if you will please come to my next birthday party

15. How many piano tuners are there in the entire world?

1 and his name is earl


16. You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you find the ball that is heavier by using a balance and only two weighings?

by picking it up

17. You have five pirates, ranked from 5 to 1 in descending order. The top pirate has the right to propose how 100 gold coins should be divided among them. But the others get to vote on his plan, and if fewer than half agree with him, he gets killed. How should he allocate the gold in order to maximize his share but live to enjoy it? (Hint: One pirate ends up with 98 percent of the gold.)

be johnny depp