Google interview questions

This is a list of interview puzzles used at Google.


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

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?

What method would you use to look up a word in a dictionary?

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 announce that at least one husband has been unfaithful. What happens?

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 fine the ball that is heavier by using a balance and only two weighings?

How do you cut a rectangular cake into two equal pieces when someone has already taken a rectangular piece from it? The removed piece an be any size or at any place in the cake. You are only allowed one straight cut.

How many piano tuners are there in the entire world?

What gives you joy?

Mike has $20 more than Todd. How much does each have given that combined they have $21 between them. You can’t use fractions in the answer. Hint: This is a trick question, pay close attention to the condition)

How many times a day a clock’s hands overlap?

Two MIT math graduates bump into each other. They hadn’t seen each other in over 20 years.
The first grad says to the second: “how have you been?”
Second: “Great! I got married and I have three daughters now”
First: “Really? how old are they?”
Second: “Well, the product of their ages is 72, and the sum of their ages is the same as the number on that building over there..”
First: “Right, ok.. oh wait.. I still don’t know”
second: “Oh sorry, the oldest one just started to play the piano”
First: “Wonderful! my oldest is the same age!” Problem: How old are the daughters?

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!)

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?

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

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?

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?


You can read some notes about selection process and interviews at Google here.

This entry was posted in General. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

63 Comments on Google interview questions

  1. Ottoline Lyme
    Posted 1/24/2008 at 6:27 am | Permalink

    The cake: It’s not possible, in practical terms, to cut any cake equally. Cutting it horizontally ignores the roundness at the top of the cake, to say nothing of the extra frosting on top, or who gets the rose decoration. Even if one rules those things out, there will always be something to quarrel about, no matter how the cake is divided. That’s why in a case like this, you ask one recipient to cut it, and the other recipient to have first choice re which piece he wants. Trust me, I have twin boys.

  2. Binarycow
    Posted 1/28/2008 at 10:50 am | Permalink

    Two MIT math graduates bump into each other. They hadn’t seen each other in over 20 years.
    The first grad says to the second: “how have you been?”
    Second: “Great! I got married and I have three daughters now”
    First: “Really? how old are they?”
    Second: “Well, the product of their ages is 72, and the sum of their ages is the same as the number on that building over there..”
    First: “Right, ok.. oh wait.. I still don’t know”
    second: “Oh sorry, the oldest one just started to play the piano”
    First: “Wonderful! my oldest is the same age!” Problem: How old are the daughters?

    – The answer: Unknown.
    The solution makes false assumptions:
    1.) The guy knew that two possible combinations had the sum 14
    2.) The guy could see the building number
    3.) Two children cannot be the same age.

    Key #3 is the most important. It is possible to have two six year olds and a two year old. Twins. With twins, there is ALWAYS an older child. So, it is perfectly legit to say that you have two six year olds, one two year old, and the oldest began playing piano.

  3. Posted 2/26/2008 at 11:55 am | Permalink

    Jay Jay… What about 11:55 and 23:55?

    Cake… Horizontal cut answers assume the rectangle removed is the same height as the cake.

    As pointed out by Jay Jay, if I asked you any questions like these it is your thinking process that I care about. Are you easily discouraged by a tough situation? Do you find negatives or solutions? Can you venture a solution even if it might be wrong?

  4. JayJay
    Posted 2/28/2008 at 11:35 pm | Permalink

    Hey, Clocks are Round. I believe 11:55 and 23:55 will never occur. In fact, 10:50/22:50 are rough approximations. They are probably more like 10:53/22:53 or something. After that, hands will meet at 12:00/00:00.

    By the way, I got a job at Google last week. Seriously! :)

  5. deepak
    Posted 5/16/2008 at 1:33 am | Permalink

    the logic

    Clock hands will
    overlap 22 times (All times approximate):
    00:00, 01:05, 02:10, 03:15, 04:20, 05:25, 06:30, 07:35, 08:40, 09:45, 10:50,
    12:00, 13:05, 14:10, 15:15, 16:20, 17:25, 18:30, 19:35, 20:40, 21:45, 22:50

    posted by:jay jay
    is wrong b’coz there are some error near the time 10:50 or some other combination..

  6. maneo
    Posted 6/27/2008 at 12:47 pm | Permalink

    3. unfaithful husband - every man has cheated his wife (there are 100), as it is mentioned in the problem. the wife of the unfaithful husband kills him on the same day she knows abt it.
    So, if there is only one unfaithful husband, and his wife does not come to know that any other man has cheated, she will kill him on the same day.
    But if she already knows that another man has cheated, she waits for the second day to see him dead! (remember, the queen never revealed the exact number).
    But on the second day, if she sees the suspected man alive, she gets to know that there is some confusion exists for his (the suspect’s)wife. [ie; she was also waiting to see someone else dead!]. So both the ladies realize that their husbands are unfaithful. So they kill their husbands on the second day!

    This is the case of two unfaithful husbands. It took two days to solve the confusion if there were 2 unfaithfuls.

    So, if there are 100 unfaithfuls, it takes 100 odd days to solve the confusion. And on the 100th day, each woman kills her husband!!!

  7. Posted 8/1/2008 at 5:01 pm | Permalink

    On the probability question, Let’s suppose we have a coin. What’s the probability that after 3 throws we get one tail?? Obviously it’s not 1.5 ( 3 * 0.5). In order to figure this out, we shall know that the probability of seeing a car in 30min is exactaly 1 - Probability of ( not seeing a car each ten minutes). And that means that 0.05 = P(~car|10min)^3 –> P(car|10min) = 1 - cubicroot(0.05) = 0.632

    Thus, the answer to the problem is 0.632

  8. Avinash polepally
    Posted 9/30/2008 at 4:27 pm | Permalink

    Mike has $20 more than Todd. How much does each have given that combined they have $21 between them. You can’t use fractions in the answer. Hint: This is a trick question, pay close attention to the condition)

    ans: Mike = 20$ + todd
    trick is “given” mike could have any amount of cash and todd will have 20 less than him. They could have given any share to make it 20.

  9. Billyboy
    Posted 10/16/2008 at 12:30 pm | Permalink

    answer to boy and country question:

    say there are 100 families, that means there will be exactly 100 boys. Lets figure out how many girls.

    50 families will have a girl on their first try,
    25 will have a girl on their second try
    12.5 on third and so on.

    so 1/2 of the population has at least 1 girl, 1/4 has at least 2 and so on.

    this reduces to avg # of girls per family = 1/2 + 1/4 + 1/8… = 1

    so the proportion is 1 to 1

    WRONG!!!!!

    The number of girls is equal to the % of families having girls times the number of girls each family has.

    Thus 50% of families have 1 girl = 50 girls
    25 % of families have 2 girls = 50 girls
    12.5% of families have 3 girls = 37.5girls

    etc. etc….equals 200 girls and 100 boys

  10. K Kim
    Posted 10/28/2008 at 11:11 am | Permalink

    Billyboy,

    You repeatedly counted families having more than one girls. 50% of families have 1 “or more” girls, not exactly 1 girl. Similarly, 25% of families have 2 or more girls, and so on.

    Here is a correct answer, i think:

    Initially, there are 100 families with no child.

    1st try: 50 boys and 50 girls are born in 100 families. Since 50 families got their boys, they will not try to have their children.

    2nd try (50 families participated): 25 boys and 25 girls are born in 50 families. Now there are 75 boys and 75 girls.

    In this way, the expected number of boys and that of girls are “equal for all trials”, until every family finally has a boy.

  11. Krystyle
    Posted 11/20/2008 at 7:38 pm | Permalink

    Mike has $20 more than Todd. How much does each have given that combined they have $21 between them. You can’t use fractions in the answer. Hint: This is a trick question, pay close attention to the condition)

    Mike simply has $20 more than Todd. The condition is that there is $21 physically between them.

  12. ABZB
    Posted 12/17/2009 at 4:55 pm | Permalink

    assuming that the hour hands angle is a function of the minute hands angle, then for a 12 hour clock, the difference between the two angles is:

    2*pi*|(h*60)-(11)*m/720|

    where m=minutes, m=[0,60)
    h=hours time as one would read it (for 10:11, ht=10 for example) h=[1,12]
    so we look for 60*h=11*m, then double the number of intersections, as a 12 hour clock hits the same spot twice a day.

    note that it does not mention the second hand, if it does involve it, then it hits both other hands twice a minute, once each

    01:05:33 (note: approximate are these)
    02:10:55
    03:16:22
    04:21:49
    05:27:16
    06:32:44
    07:38:11
    08:43:37
    09:49:05
    10:54:32
    11:60:00- note that this means that 11’s crossing is 12:00
    1:05:27-result from 12, after subtracting 60 from end minute output

    so 12 per 12 hours, 24 in 24 hours. if you add every second hand crossing (counting a triplet as 3 pairs) 2*60*12*2=2880
    so a total of 2904 crossings per day, with 24 of them being minute-hour crossings

  13. gaurav khatwani
    Posted 7/26/2010 at 9:01 pm | Permalink

    Qbaler your math is wrong.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*