Advertisement

Google Interview Questions

Started by February 08, 2005 05:19 PM
79 comments, last by way2lazy2care 13 years, 5 months ago
Quote: Original post by Raduprv
The water pump is different: the motor needs the water to cool itself. For a blender, it doesn't matter, because the motor cools itself with air.
I wonder for how long though. I suspect an average would tend to overheat at some point given the high RPM.
______________________________"Man is born free, and everywhere he is in chains" - J.J. Rousseau
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?"


Clearly they mentioned nickels for a reason. Simply use a now proportionately huge piece of pocket change to jam the blades in some way. :D
-~-The Cow of Darkness-~-
Advertisement
Quote: Original post by Cold_Steel
Quote: Original post by Raduprv
The water pump is different: the motor needs the water to cool itself. For a blender, it doesn't matter, because the motor cools itself with air.
I wonder for how long though. I suspect an average would tend to overheat at some point given the high RPM.


Many motors (big motors) have some sort of fan/propeler inside, so they draw air to cool themselves. Besides, if a motor is idle it will heat slower. But it depends on the motor, of course. Some are designed to run non stop, while others are designed to run for a limited time. A cheap blender will probably die if used too much, but a well build one will most likely run for quite a while.
Quote: Original post by Raduprv
Many motors (big motors) have some sort of fan/propeler inside, so they draw air to cool themselves. Besides, if a motor is idle it will heat slower. But it depends on the motor, of course. Some are designed to run non stop, while others are designed to run for a limited time. A cheap blender will probably die if used too much, but a well build one will most likely run for quite a while.
Yeah, Google should at least tell you what brand they're using. There's a big difference between a high quality restaurant blender and a Wal-Mart POS.
Heh, you know what, I think I know how to answer all of Google's interview questions:
[google]
______________________________"Man is born free, and everywhere he is in chains" - J.J. Rousseau
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?"

Ehh. Well I make alot of smoothies and stuff with blenders.. hehe.. ok.. watch if you drop a granola (or rice or something) on the blade just as you turn it on. It will shoot itself out of the blender (hopefully, sometimes it richochetes all over the place before flying out).

My guess is if you are that small, get on the blade and just as the blade turns on jump and you will ping pong right out of the blender and land about 20 feet somewhere arbritraily in your kitchen. Of course you will probably be dead anyways from slamming into the blender walls and flying all that distance...

Why do they ask questions like this anyways?

Oh, oops, I forgot it is usually because it is hitting the blades :-) My bad. I'd just google for the answer.

They didn't mention if it has a top on it though.
Quote: Original post by Witchcraven
Why such a complex stack growth solution. In a function, declare 2 local variables. Compare addresses.


Agreed. Of course, you will have to watch out for the optimizer reordering things. So you'll want to do it in assembly. (Of course, if you knew how to program in assembly on that platform, you'd probably already know the stack direction... :s )
Advertisement
Why not ask Google ... err... yeah

Funny Google Response
LOL. You don't need to do any of that. Make a function. If the function has the C calling convention then parameters on the right of the prototype will be pushed on first. Compare the address of two parameters. If the lefter parameter has a smaller address then the stack grows from high to low memory. Adjust according to calling convention. Newbies.
Quote: Original post by golopart
LOL. You don't need to do any of that. Make a function. If the function has the C calling convention then parameters on the right of the prototype will be pushed on first. Compare the address of two parameters. If the lefter parameter has a smaller address then the stack grows from high to low memory. Adjust according to calling convention. Newbies.


What if the parameters are passed in registers?
Then it's a fastcall calling convention. Is there a language where you can't choose to pass data on the stack? (don't say Java)

My point was to reduce the number of steps to find a solution. kSquared said call a function and another function in it. Someone else said declare two local vars. It seems to me that in any language that has those capabilities also has the capability of just doing:

void __cdecl lol(int a, int b)
{
print(&a);
print(&b);
}

But really I was just being a smart ass.

This topic is closed to new replies.

Advertisement