Sign in to follow this  
kSquared

Google Interview Questions

Recommended Posts

kSquared    1356
[edit]: If you're coming here from digg, I've posted a comment in the comments section to clarify a few points. Also, note that this thread is over a year old! I had a phone interview with Google today. I took notes; some of the questions they asked were interesting. We were allowed to ask questions. The interviewer didn't ask many questions in response to my answers, except to occasionally say "interesting". There's almost certainly more than one answer to each of these, and a few are probably wrong answers or could be improved in some way; I only include my answers for comparison. Any intermediate questions that I asked for clarification or otherwise have been omitted. Without further ado, a few of the more interesting ones: Q: "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?" (my answer): Take off all my clothes, wedge them between the blades and the floor to prevent it from turning. Back up against the edge of the blender until the electric motor overheats and burns out. Using the notches etched in the side for measuring, climb out. If there are no such notches or they're too far apart, retrieve clothes and make a rope to hurl myself out. Q: "How would you find out if a machine's stack grows up or down in memory?" (my answer): Instantiate a local variable. Call another function with a local. Look at the address of that function and then compare. If the function's local is higher, the stack grows away from address location 0; if the function's local is lower, the stack grows towards address location 0. (If they're the same, you did something wrong!) Q: "Explain a database in three sentences to your eight-year-old nephew." (my answer): A database is a way of organizing information. It's like a genie who knows where every toy in your room is. Instead of hunting for certain toys yourself and searching the whole room, you can ask the genie to find all your toy soldiers, or only X-Men action figures, or only race cars -- anything you want. Q: "How many gas stations would you say there are in the United States?" (my answer): A business doesn't stick around for long unless it makes a profit. Let's assume that all gas stations in the US are making at least some profit over the long run. Assume that the number of people who own more than one car is negligibly small relative to the total American population. Figure that 20% of people are too young to drive a car, another 10% can't drive because of disability or old age, 5% of people use public transportation or carpool, another 5% choose not to drive, and another 5% of the cars are inventory sitting in lots or warehouses that a dealership owns but which no one drives. There's about 280 million people in the US; subtracting 50%, that means there's about 140 million automobiles and 140 million drivers for them. The busiest city or interstate gas stations probably get a customer pulling in about twice a minute, or about 120 customers per hour; a slower gas station out in an agrarian area probably sees a customer once every 10 or 15 minutes, or about 4 customers per hour. Let's take a weighted average and suppose there's about one customer every 90 seconds, or about 40 customers an hour. Figuring a fourteen-hour business day (staying open from 7 AM to 9 PM), that's about 560 customers a day. If the average gas station services 560 customers a day, then there are 250,000 gas stations in the US. This number slightly overstates the true number of gas stations because some people are serviced by more than one gas station. [Actual number in 2003, according to the Journal of Petroleum Marketing: 237,284, an error of about 5%.] P.S. Apparently, if you make it to the next stage, you can't even tell people you're interviewing, because you sign a 6-page NDA. I haven't had to sign anything yet, though.
edit: Obvious spelling mistake. tall --> tell. [Edited by - kSquared on March 5, 2006 11:48:43 PM]

Share this post


Link to post
Share on other sites
Stonicus    157
Quote:

Q: "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?"

I quickly realize that even if I get out, I am only the size of a nickel, and will probably never get laid again, so I place my neck on the blade and close my eyes till my 60 seconds are up.

Share this post


Link to post
Share on other sites
Conner McCloud    1135
Quote:
Original post by kSquared
Q: "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?"

You're the height of a nickel, the blades won't touch you on any blender I've ever seen. So sit back and ponder a solution at your leisure, there's really no rush.
Quote:
Original post by kSquared
Q: "Explain a database in three sentences to your eight-year-old nephew."

I'm much to busy explaining to the lad why my brother doesn't realize he exists to be worried about silly things like databases.
Quote:
Original post by kSquared
Q: "How many gas stations would you say there are in the United States?"

Enough.

Boy did you get them wrong.

CM

Share this post


Link to post
Share on other sites
C-Junkie    1099
Quote:
Original post by Conner McCloud
Quote:
Original post by kSquared
Q: "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?"
You're the height of a nickel, the blades won't touch you on any blender I've ever seen. So sit back and ponder a solution at your leisure, there's really no rush.
Darn, you beat me to it!

Share this post


Link to post
Share on other sites
Jesper T    322
If your height was halved you'd only need one fourth the muscle power (take a look at small animals, they all have relatively much smaller limbs than larger ones). If you were reduced to the height of a nickel you would not only be able to lift many times your own weight, your body would quite possibly tear itself apart.

Share this post


Link to post
Share on other sites
kSquared    1356
Quote:
Original post by Jesper T
If your height was halved you'd only need one fourth the muscle power (take a look at small animals, they all have relatively much smaller limbs than larger ones). If you were reduced to the height of a nickel you would not only be able to lift many times your own weight, your body would quite possibly tear itself apart.

I guess I should have answered, "I do nothing, because I will shortly implode and die from unbearable tensile forces." ;)

Share this post


Link to post
Share on other sites
coldacid    755
Since your density is the same, you weigh much, much less. Being that small means that the wind pressures created in the blender will toss you into the blades, so just sitting and pondering will get you nowhere except dead.

Share this post


Link to post
Share on other sites
MagicScript    290
Quote:
Original post by kSquared
"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?"


I'm confused, if you're the height of a nickel and you're thrown into a blender, wouldn't the fall kill or seriously injure you?

Share this post


Link to post
Share on other sites
BradDaBug    913
Quote:
Original post by coldacid
Since your density is the same, you weigh much, much less. Being that small means that the wind pressures created in the blender will toss you into the blades, so just sitting and pondering will get you nowhere except dead.

But if it is truly an empty blender then there is no air to suck you up into the blades.

Your only real task is trying to figure out how to breath.

Share this post


Link to post
Share on other sites
OBeH    194
Quote:
Original post by kSquared
Q: "How many gas stations would you say there are in the United States?"


No no no
The right answer is "Hang on, lemme check google." :)

Share this post


Link to post
Share on other sites
Hedos    674
Quote:
Original post by OBeH
Quote:
Original post by kSquared
Q: "How many gas stations would you say there are in the United States?"


No no no
The right answer is "Hang on, lemme check google." :)


[lol][lol]

Interesting interview though, what job are you applying for exactly?

Share this post


Link to post
Share on other sites
Oluseyi    2116
Q: "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?"

Move (swim) to the middle. The blades of the blender will generate a vortex/whirlpool, of which the calmest portion is the center - where there are also no blades.


Q: "How would you find out if a machine's stack grows up or down in memory?"

Data segment magic/voodoo. You want to declare two data segments and assign them to the same address, then instantiate local variables in each of them and compare their addresses.

msn12b posted something similar in General Programming that had been used at Bungie to test if a pointer was of a specific sort, or something like that.


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

I would probably have estimated geographically rather than by population. For instance, your estimate doesn't factor in multiple-car individuals. I believe there are more cars in the US than drivers, though, of course, not all of them need to be fueled at the same time.

Good job, though.

Share this post


Link to post
Share on other sites
Salsa    1146
Quote:
Original post by Oluseyi
Q: "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?"

Move (swim) to the middle. The blades of the blender will generate a vortex/whirlpool, of which the calmest portion is the center - where there are also no blades.


The blender was empty. =X

Share this post


Link to post
Share on other sites
aidan_walsh    739
Quote:
Original post by Salsa
Quote:
Original post by Oluseyi
Q: "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?"

Move (swim) to the middle. The blades of the blender will generate a vortex/whirlpool, of which the calmest portion is the center - where there are also no blades.


The blender was empty. =X


Wouldn't there still be a "tornado-tunnel effect" (for the lack of a better description) from the air, though? That would be lessened in the "eye".

Share this post


Link to post
Share on other sites
Salsa    1146
Looking at my blender, I don't see any feasible way of scaling the blade mechanism and getting into the axis. I think I would just hang from one of the blades for dear life and enjoy the ride before splatting into the glass.

Share this post


Link to post
Share on other sites
Stonicus    157
Being technical, you'd instantly die. How you die depends on how your mass is reduced.

If they simply remove actual molecules and atoms from your body, then you would be the height of a Jefferson nickel, 2.1cm. A person 6 feet in height is 1.8288m, or 182.88cm. Your size and mass would be reduced by a factor of 87.0857, let's just say 87. So the amount of blood that pumps through your veins is based on the surface area of your veins, or the hollow part of your veins to be exact. So the amount of blood being pumped is reduced by a factor of 87, but the surface area of the veins is reduced by a factor of 7569, so I am predicting your circulatory system would just cease to function properly. Every system in the body would have to be linearly scalable. Not to mention the fact that you just lost most of the neurons in your brain.

If your mass was simply minaturized somehow, as in you are made of smaller electrons than we are now, you would probably disappear and enter a parallel universe. You wouldn't interact with the rest of the universe in the same way. Your eletro-magnetic forces that keep you fram falling from the floor might not be strong enough and you could be sucked by gravity into the center of the earth. You would probabaly not be able to breath because your smaller lungs couldn't react with the big oxygen molecules. You may go blind if your eyes no longer reacted or detected light the same. A host of things could go wrong in this scenario when looked at from the chemical/atomic level.


Also, how would you make a rope from your clothes to hurl yourself out? What would you attach the rope to? And I don't think you could get a rop long enough to reach the top of the blender.

Share this post


Link to post
Share on other sites
kSquared    1356
Quote:
Original post by Oluseyi
Q: "How many gas stations would you say there are in the United States?"

I would probably have estimated geographically rather than by population. For instance, your estimate doesn't factor in multiple-car individuals. I believe there are more cars in the US than drivers, though, of course, not all of them need to be fueled at the same time.


Interesting responses -- I really wish I could have given the "there is no escape -- I die" answer to the blender one, but I'm not sure that would have gone over well. I did mention this sentence though:

Quote:
that the number of people who own more than one car is negligibly small relative to the total American population.

Share this post


Link to post
Share on other sites
pinacolada    834
Bah, I don't think merely staying alive in the blender is the way to go. You have no idea when or if the blender will ever be turned off. In fact, the fact that you've been placed in a blender in the first place implies that there is a malicious entity involved, someone who wants to see you minced.

So you definitely have to try to escape. Since the blades create a lot of windflow, there must be some drafts that could pull you up- I think the way they would work is that the air comes down the center of the blender area, and up the sides. So you could try to hug one of the side walls and see if the wind will push you to the top?

Either that or you could do a funny dance, in the hopes that your malicious captor will find you entertaining and choose to spare you.

Share this post


Link to post
Share on other sites
owl    376
Quote:
Original post by Stonicus
Quote:

Q: "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?"

I quickly realize that even if I get out, I am only the size of a nickel, and will probably never get laid again, so I place my neck on the blade and close my eyes till my 60 seconds are up.


ROFLMAO! Best answer! :):):)

I would place myself laid down in the center of the wheel.

Share this post


Link to post
Share on other sites
nuvem    326
One might assume that since the blender is about to be turned on, that food will soon be entering, so I'd probably just put my neck to the blade rather than be suffocated by some raunchy health drink.

Share this post


Link to post
Share on other sites
Nietsnie    270
Well, I would assume you would have some change on you (being Canadian with our loonies and toonies), and so I would chuck change up into the motor in hopes that it will somehow stall it. Then, I would take off all my clothes, tie them around the closest to center part of the blade, and then strap myself in between the clothes and blade under the blade. When it turns on (if it does), I would hopefully be swung round and round, probaly faint, but not die, and when it turns off I would then think of a way to get out.

Share this post


Link to post
Share on other sites
Cold_Steel    835

It looks like you could just stand off to the side. It doesn't look like the blades would cause too much of a vacuum in air. They just look like flat blades. Eventually, I supposed running an empty blender would kill the motor.

Share this post


Link to post
Share on other sites
Raduprv    997
Quote:
Original post by Cold_Steel
They just look like flat blades. Eventually, I supposed running an empty blender would kill the motor.

Why would it kill the motor? Placing too much load might kill it, but too little wouldn't.

Anyway, to the blender question, I don't think there is any way to survive. The clothes would be so small they are unlikely to stop the motor. And even if the motor is stoped, what can you do? Your clothes are not a rope, and you can't throw them over the edge. Even if you could, you'd need some sort of anchor at the other end so they won't fall back.
The correct answer would be: "Coming at peace with yourself and with the Universe" :D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this