Thursday, August 03, 2006

Tough Questions From Google Job Interviews

There are many stories about job interviews at Google. But the most interesting part of any story is the list of questions:

Zach had a phone interview in October 2005 and he was asked things like:

"Google gets queries from around the world. Write a function that will return a two character string representing a country code given an IP address as its input."

Here is the answer:

"Essentially, you have to create a tree structure with the country codes as the leaves at the very bottom. I chose to split the IP addresses by octets. So the top level would contain all of the starting and ending numbers corresponding to the first octet on the IP address. So this tree structure would be very wide but only 4 levels deep."




Pete Abilla was a little luckier and knew how to answer this question:
"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?"

"The answer has to do with the number of days in the year and the probability the person’s birthday falls on the same day as mine (without replacement). I eventually solved it, but it took time learning how to apply probability with no replacement."




An interesting problem from Google's aptitude test:
Given a triangle ABC, how would you use only a compass and straight edge to find a point P such that triangles ABP, ACP, and BCP have equal perimeters? (Assume that ABC is constructed so that a solution does exist.)




The moderator of gamedev.net had a phone interview with rather odd questions:

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

How many gas stations would you say there are in the United States?

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?





Niniane Wang, who works at Google, has some tips for a job interview:

# Practice using the same medium (e.g. paper and pencil) and time limits (e.g. 30 minutes) as the real interview.
# During the interview, don't obsess over little mistakes that happen.
# Don't be rude to your interviewer.
# Don't hijack the interview (if you really want to talk about a project, ask your interviewer).
# When answering questions expecting a specific answer, give a high-level summary first.

So if you want to work at Google, get ready and good luck!
  13 comments ( Post a comment )
what's the answer to the glass blender question?

it kept me busy for a while.
Pull on the end of one of the blades. The weight of a normal person should be enough to tip the blender over.

Mo
Nonsense. It says the mass is proportionately reduced so that the density remains the same. That means you'll weigh about as much as a large housefly.

Is that the official answer, provided by Google?
probab you could go and try sit at the centre of the blades as I guess it's a safe place.
The blades of a blender don't touch the bottom of the jar. So, craw beneath the blades and site tight. Since it's empty, nothing but a lot of air will come under. And since blenders are designed to draw food towards the blades, the air passes thru the blades and under, hence you won't be sucked back up.
Yeah but you'll be stuck there! I say climb out, it should be sloped and scratched up which will make it grippy.
I think you say your prayers and meet death like a man. You are a now a gnat does it really matter if you survive?
jump out
grab one of the blade, and have a twist of life!

or maybe pee to short xirxuit the connection.

yikes, if you are fast enough :P


ngtitao@yahoo.com
i will start doing toilet.if luck permits I start floating in it and hence save my life.a better option than just dying.
First look at the question again:

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?

This question is like a traditional software problem - the problem isn't that the answer isn't complex, but rather the question should be answered by another question based on a possible assumption: what is the orientation of the blender? The original question does not state whether the blender is in an upright position or on its side; of one thing we are certain: the blender is NOT upside down, the person is "...thrown..." into the blender, which implies the blender has open access. Ergo, one could say the blender is either in an upright position, or on its side. However, the word "...thrown..." also implies that the blender is in fact on its side, since one does not *throw* an object down, but rather *drops* an object down.

Assuming this blender is in fact on its side, the final response to this question is simple: just run straight out of it!
"Google gets queries from around the world. Write a function that will return a two character string representing a country code given an IP address as its input."

Here is the answer:

"Essentially, you have to create a tree structure with the country codes as the leaves at the very bottom. I chose to split the IP addresses by octets. So the top level would contain all of the starting and ending numbers corresponding to the first octet on the IP address. So this tree structure would be very wide but only 4 levels deep."



This answer doesn't seem very logical to me.... if the tree isn't very deep.. than at each level you have many more comparisons to make...

a binary search tree is extremely efficient, because at each node you are cutting your possibilities in half..
ok so i am shrunked to a size of a nickel and what do i do?I would climb on the blade,and when the blade starts to spin the wind from the blade would shoot me out...of course counting on my reduced mass that is proportionally reduced so as i maintain my original density.