

Google Interview Questions - dogma
http://www.mytechinterviews.com/10-google-interview-questions

======
Patient0
The "Is my husband a cheat" riddle is actually very well known. It's just the
Blue Eyed Islander puzzle in disguise: (<http://xkcd.com/blue_eyes.html>) also
known as the Muddy Children puzzle. Discussed here too:
<http://en.wikipedia.org/wiki/Common_knowledge_(logic)>

and here: [http://terrytao.wordpress.com/2008/02/05/the-blue-eyed-
islan...](http://terrytao.wordpress.com/2008/02/05/the-blue-eyed-islanders-
puzzle/)

In fact, a whole book has been written about it and related issues:

[http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&...](http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=8240)

It's a fascinating riddle because it introduces the subtle concept of "what
somebody knows about what someone else knows about what someone else knows
about X".

But such a well discussed and complicated puzzle therefore also makes a bad,
or at least "unfair", interview question. If you've heard it before, read that
book, read Terence Tao's post on it... etc.. you'll easily ace this riddle.

If you haven't heard of it before, it's going to take you way longer than just
a few minutes to get your head around it.

So as an interview question, it's testing what you "know", not how well you
think.

------
derwiki
If these are the type of questions that they feel qualify you, maybe it's a
good thing that I don't work for Google. I, for one, am sick of programming
interviews where they test aptitude by giving you riddles that end up getting
posted online, so that interviews become more of "have I heard this question
before or not" than a true measure of intelligence and motivation.

A better interview question: what's your Github username?

~~~
babycakes
Google doesn't ask questions like these. In fact, they train interviewers to
_not_ ask questions like these.

~~~
derwiki
I was skeptical reading these questions, because when I did phone screen at
Google, I got very practical questions about map reduce and skip lists. I do
know that many companies still use riddles like these, however.

~~~
emily37
What companies? In internship interviews at MS, Google, Fog Creek, others,
I've never been asked a question anything like these. (thank god)

~~~
derwiki
I was asked a "crossing a river with a box and two locks" question when I
interviewed for a full time database development position (database engine,
that is). The question was related to public key encryption... which was
something the position never even came close to requiring.

~~~
barrkel
And creating your own encryption protocols from encryption primitives is easy
to get wrong, even after you figure out something that seems to follow the
rules, because of all sorts of gotchas.

------
aschobel
Hi5 SDE used to get asked the "How Strong is an Egg?"/"Drop Two Bowling Balls
from a building" question.

Not sure how this proves anything.

~~~
xhuang
just wondering for this question("how strong is an egg"), i think binary
search will be the minimum tries, so its quite useful.

~~~
RiderOfGiraffes
That turns out not to be the case. Binary search doesn't help, binary doubling
doesn't help, even though these are often thought to be the best. Indeed, the
solution given on this site used binary doubling and claimed it to be optimal.
It was wrong. It was posted here some time ago.

The solution, once found, is simple to prove optimal, but most people don't
seem to know how to do that.

Most people don't find it.

~~~
OmniLarry
For N balls, the other balls can/should be binary searched. It's just a little
tricky when it comes to the last two..

~~~
RiderOfGiraffes

      > For N balls, the other balls can/should be binary searched.
    

Interesting assertion. Can you prove that? Can you give a provably minimal
search pattern?

    
    
      > It's just a little tricky when it comes to the last two.
    

Another interesting assertion. It seems to me that the case of exactly two
balls is trivial, once the solution is found.

~~~
OmniLarry
Sorry, can't find the link, but it was a Topcoder problem at least 5 years
ago.

Well, it is trivial with two balls, once you get it, but it's tricky with
respect to "just binary search".

------
dangrossman
I interviewed with Google for a C/C++ job in the team that runs Google
Translate and wasn't asked any puzzles or riddles. They asked me to solve some
programming questions -- how would you approach sorting a data set too large
to fit in memory, using 4 computers -- describe an algorithm for doing this or
that -- etc.

------
philk
I'm having difficulty seeing how these questions would help find people who
can build great software or solve problems creatively:

a) I'm not sure there's a strong causal link between "being good at brain
teasers" and "writing awesome code".

b) I suppose they could be viewed as measuring creativity, but it's in a
stressful situation. When you're trying to solve actual problems at work you
aren't going to be trying to do it in ten minutes in front of an interviewer.
Also they're clearly problems with only one correct answer which seems
unrealistic in comparison with reality.

c) More precisely, I suspect that this would test for people who enjoy brain
teasers and have done lots of them before.

~~~
andrew1
I think there are two ways to look at (b). I'd agree that generally the
problems we all solve are not particularly time critical, when you're working
on something over a week or month, there's not going to be anything which
needs doing in ten minutes. On the other hand, when you're supporting live
systems, there can be times when being able to diagnose and fix a problem in a
few minutes, under pressure, can be a valuable skill. It's at times like that
that you need people who can solve problems quickly in stressful situations.
I'm not particularly saying that these types of questions will help you find
those people, but if it's something you want to test for then they may be
useful.

------
sonofjanoh
These are all interesting but don't prove you're a good software guy. I don't
like the way how some companies try to look "cool" and do the opposite of
corporates where you have to get your certifications and grades right opposed
to your Brain Academy or the like highscore.

It's an interesting exercise but I think the questions should be focused
around what the company's needs are for that role in particular not to test
your "genius". f you're a genius and have the good attitude you already
created something great that speaks for you.

Maybe it was the case, don't know.

------
lssndrdn
There is a book that has some of the same questions, and a lot more. It's "How
would you move Mount Fuji" by William Poundstone
([http://www.amazon.com/Would-Move-Mount-Microsofts-
Puzzle/dp/...](http://www.amazon.com/Would-Move-Mount-Microsofts-
Puzzle/dp/0316919160)). As stated in some of the comments already posted,
asking this kind of questions in interviews is by now "deprecated" (or even
"considered harmful"), because they are in the public domain.

------
adharmad
For the question “How old are my children”, arent a lot of possibilities
neglected? eg – Why arent there any children with age 1? 9, 8, 1 24, 3, 1 18,
4, 1 36, 2, 1 12, 6, 1

In this case, in addition to the two cases which add up to 14 (as pointed out
in the solution), there is another case wherein the ages add up to 13: 12, 6,
1 (sum=13) 6, 4, 3 (sum=13)

Why is this case ignored? Isnt more data required to “break the tie” and get a
unique solution?

------
jcmhn
I'm not sure that the riddle questions were ever "real" interview questions.

I got the "12 balls, find the fake" question at an interview once. It seemed
to be more a tension killer than anything anyone in the room really cared
about. The actual interview was a series of questions along the lines of: "how
would you go about doing X, sketch code or pseudo-code on the whiteboard and
then explain it".

------
joshu
I got the 5 pirates one when I interviewed at Trilogy.

~~~
sailormoon
I hate that one. It seems to rely on these "pirates" being hardcore
mathematical logicians and rule-followers. Can you imagine a pirate, one out
of five, "suggesting" that a good distribution was him 98, two of the others 1
each, and the other two zero? WTF? I'd cut off his head on pure principle!

A better "real world" solution would be 40 + 30 + 15 + 10 + 5 or something.

~~~
tedunangst
Not that I ask it, but it's a question about induction, not psychology. They
are "pirates", not pirates.

Imagine if the interviewer instead asked "Convince me you know induction." as
that's what they are really after. Without a framework to hang the answer on,
it becomes a lot harder.

It's a bad question because it has fallen into the "riddles with memorized
answers" category, but not because the skills necessary to solve it are
useless.

~~~
sailormoon
_They are "pirates", not pirates._

I dig where you're coming from but this is kind of my whole point. Humans are
humans, you cannot just ignore psychology. You are being asked to predict
human behaviour. The "correct" answer is ridiculously unrealistic. Who is
better - the guy who is competent at induction, or the guy who realises that
human interaction is rarely, if ever, guided by such black and white rules?

------
leelin
I love the "Boys and Girls" question, because most people get it wrong first
pass, most computer science folks would get it after a few minutes of work,
and a Bayesian would immediately nail it.

Plus, it's seems so simple we could pose it to our (non-Dilbert) moms.

Now if only getting this was correlated with good programming...

------
seaintcoach
If you're looking for 140 Google interview questions, check this out:
[http://blog.seattleinterviewcoach.com/2009/02/140-google-
int...](http://blog.seattleinterviewcoach.com/2009/02/140-google-interview-
questions.html)

------
synnik
I thought it was fairly well established that questions like these may have
been in vogue 10 years ago, but are not really used anymore?

