Tuesday, September 15, 2015

10 Google Interview Questions; Can You Figure Them Out?

1. Bus full of golf balls

How many golf balls can fit into a bus?


2. You're in a blender, what do you do?

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 blender. The blades will start moving in 60 seconds. What do you do?

3. How many drops?

You are given two identical eggs and you have access to a 100-story building. The eggs may be very hard or very fragile (they may break if dropped from the first floor or may not even break if dropped from the 100th floor). You need to figure out the highest floor an egg can be dropped from without breaking. The question is how many drops would you need to make? You are allowed to break the eggs in the process.

4. A country that only wants boys

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?

5. Databases

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


6. Car problems

A man pushed his car to a hotel and lost his fortune. What happened?


7. Logical Pirates

There are five pirates on a ship, with 100 gold pieces to divide between themselves. The pirates are logical, self-preserving, greedy, and bloodthirsty in that order of priority. They agree that they will each in turn propose a way to divide up the gold, starting with the captain. If the majority of the pirates agree with the proposal, that is how the gold will be divided. Otherwise the pirate making the proposal will be tossed over, and the next in terms of seniority will make a new proposal. What proposal should the captain make?

8. Ball weight

You have eight balls, all of the same size. Seven 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?


9. Clock hands

How many times in a day do clock hands overlap?


10. Correct phone number

You need to check that your friend, Bob, has your correct phone number but you cannot ask him directly. You must write the question on a card and give it to Eve who will take the card to Bob and return the answer to you. What must you write on the card, besides the question, to ensure Bob can encode the message so that Eve cannot read your phone number?

Answers - How many did you get right?

1. Bus full of golf balls:
Part of the idea behind the question is just to see if you know what you would need to find the solution, but the answer is approximately 250,000.

2. You're in a blender, what do you do?:
If you maintain density and proportions, your strength decreases as the square of the change, but your mass decreases as the cube of the change. So you would simply jump out of the blender.

3. How many drops?:
The answer is that you need to plan for 14 times to cover all the possibilities. Of course, depending on how resilient the egg is, you might find out sooner, but you can't know for sure without planning ahead for at least 14 drops:

You start on the 14th floor; if the first egg breaks there you start at the first floor with the second egg and work your way up each floor, potentially to the 13th floor.

If the first egg survives the 14th floor, you go to the 27th: thirteen (not fourteen) floors higher because you burned a drop on the 14th floor. If the first egg breaks there you start at 15 and try each floor from there potentially up to 26.

This pattern continues. If the first egg survives, you go up twelve floors to the 39th, eleven to the 50th, and on to the 60th, 69th, 77th, 84th, 90th, 95th, 99th, and finally the 100th.

Note that 13 drops is not possible; if you start on the 13th floor (and the first egg survives) you will reach the 88th floor, then the 90th, then the 91st, and be out of luck.

4. A country that only wants boys:
50/50 (the probability doesn't change based on parental decisions).

5. Databases:
This one is designed to show your ability to communicate complex ideas simply. For instance, you could say "a database is something that stores a lot of information. People use them to help them remember and organize that information."

6. Car problems:
He was playing Monopoly and landed on Boardwalk.

7. Logical Pirates:
To find the answer, number the pirates and work backwards.

If it comes down to pirates 4 and 5, then 4 is out of luck; even if he proposes giving all the gold to 5, 5's bloodthirsty nature will result in him saying no, killing 4, and taking all the gold.

If it comes down to 3, 4, and 5, 4 will vote yes to 3's proposal no matter what, in order to save his own life. Therefore 3 can propose that he (3) gets 100 pieces of gold and 4 will vote yes, and the proposal passes.

If it comes down to 2, 3, 4, and 5, since 4 and 5 get nothing under 3's proposal, 2 can propose 98 pieces of gold for himself and 1 each for 4 and 5, and they will vote yes, giving a three-to-one majority.

Therefore the captain, pirate 1, should propose 97 pieces of gold for himself, 1 piece for 3, and 2 pieces for either 4 or 5, and have a three-to-two majority.

(Of course, you could say self-preserving beats out greedy and give them more. You still get the most, and they have less reason to kill you in your sleep.)

8. Ball weight:
Take six of the eight balls and put three on each side of the scale. If the heavy ball isn't in the group of six, you know it's one of the remaining two and so you put those two in the scale and determine which one. If the heavy ball is in the six, you have narrowed it down to three. Of those three, pick any two and put them on the scale. If the heavy ball is in that group of two, you know which one it is. If both balls are of equal weight, then the heavy ball is the one you set to the side.

9. Clock hands:
Clock hands overlap 22 times each day at approximately the following times (twice a day each, am and pm):

12:00
1:05
2:11
3:16
4:22
5:27
6:33
7:38
8:44
9:49
10:55

10. Correct phone number:
Tell the person to call you at a certain time.

No comments:

Post a Comment