Google Interview Questions

Started by
79 comments, last by way2lazy2care 12 years, 11 months ago
[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]
- k2"Choose a job you love, and you'll never have to work a day in your life." — Confucius"Logic will get you from A to B. Imagination will get you everywhere." — Albert Einstein"Money is the most egalitarian force in society. It confers power on whoever holds it." — Roger Starr{General Programming Forum FAQ} | {Blog/Journal} | {[email=kkaitan at gmail dot com]e-mail me[/email]} | {excellent webhosting}
Advertisement
Dear God, I suck hard enough at regular interviews, let alone one of those ones...
www.aidanwalsh(.net)(.info)
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.
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
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!
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.
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." ;)
- k2"Choose a job you love, and you'll never have to work a day in your life." — Confucius"Logic will get you from A to B. Imagination will get you everywhere." — Albert Einstein"Money is the most egalitarian force in society. It confers power on whoever holds it." — Roger Starr{General Programming Forum FAQ} | {Blog/Journal} | {[email=kkaitan at gmail dot com]e-mail me[/email]} | {excellent webhosting}
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.

Chris 'coldacid' Charabaruk – Programmer, game designer, writer | twitter

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?
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.
I like the DARK layout!

This topic is closed to new replies.

Advertisement