Followers 0

# Google Interview Questions

## 80 posts in this topic

Since you are still alive, I assume somehow your biology was preserved. So that means your muscle mass is still in proportion to your total mass. Thus, my solution would be to jump out. Should I fail to make the jump, I would probably punch a hole in the blender upon my landing. Or if the blender was on its side, I would walk out. Or jump against the side, knocking it over. Considering my density/size ratio, I wonder if I could chew through the blades.

Hell, if you shot me at 2000 feet per seoond I could probably be used as an anti tank bullet.

Why such a complex stack growth solution. In a function, declare 2 local variables. Compare addresses.
0

##### Share on other sites
Quote:
 Original post by WitchcravenSince you are still alive, I assume somehow your biology was preserved. So that means your muscle mass is still in proportion to your total mass. Thus, my solution would be to jump out. Should I fail to make the jump, I would probably punch a hole in the blender upon my landing. Or if the blender was on its side, I would walk out. Or jump against the side, knocking it over. Considering my density/size ratio, I wonder if I could chew through the blades.Hell, if you shot me at 2000 feet per seoond I could probably be used as an anti tank bullet.Why such a complex stack growth solution. In a function, declare 2 local variables. Compare addresses.

Only that it was stated that your mass is also reduced accordingly.
0

##### Share on other sites
ah. I thought it said you retained your mass. guess I should read it more carefully.
0

##### Share on other sites
Quote:
 Original post by RaduprvWhy would it kill the motor? Placing too much load might kill it, but too little wouldn't.
I assume they are designed to be run with some resistance. Sort of like if you run a water pump motor dry, it will burn out. Also, I just read somewhere that they may be designed for short use time spans, and not continuous use, so they could burn out that way too after 10 or so minutes.

[disclaimer]I don't even own a blender! What do I know!?[wink]
0

##### Share on other sites
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.
0

##### Share on other sites
Quote:
 Original post by RaduprvThe 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.
0

##### Share on other sites
Quote:
 Original post by kSquaredQ: "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
0

##### Share on other sites
Quote:
Original post by Cold_Steel
Quote:
 Original post by RaduprvThe 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.
0

##### Share on other sites
Quote:
 Original post by RaduprvMany 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:
0

##### Share on other sites
[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?"

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.
0

##### Share on other sites
Quote:
 Original post by WitchcravenWhy 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 )
0

##### Share on other sites
Why not ask Google ... err... yeah

0

##### Share on other sites
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.
0

##### Share on other sites
Quote:
 Original post by golopartLOL. 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?
0

##### Share on other sites
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.
0

##### Share on other sites
Push a value into a stack, and subtract the stack pointers current value from the stack pointers value before you pushed the value.

If it is positive then the stack is going up, otherwise it is going down.

You then pop it back again (to return the stack to its origional state)

Also, for the blener one, i would go something like:
Resonate the glass until it shatters, then run away real fast.

For "how many gas stations in the us"? I would say, "Google it".

From,
Nice coder
0

##### Share on other sites
Ironically, google doesn't know the answer to "how many gas stations in the us" (I just tried).
0

##### Share on other sites
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?"

Panic, because the rest of the ingredients are probably coming in a few seconds.

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

Give it appropriate amounts of sunlight and water, and record observations over time.

Quote:
 Q: "Explain a database in three sentences to your eight-year-old nephew."

Well, basically it's a.... Wait a minute, who are you? I don't have an eight year old nephew.

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

I don't know, but when I see him next, I'll ask.
0

##### Share on other sites
Quote:
 Original post by Coaster KevWhy not ask Google ... err... yeahFunny Google Response

Why do Google want to shrink my donkey?
0

##### Share on other sites
Quote:
Original post by benryves
Quote:
 Original post by Coaster KevWhy not ask Google ... err... yeahFunny Google Response

Why do Google want to shrink my donkey?

Yeah, your donkey, right....

They just want you to get in shape, that's all.

shmoove
0

##### Share on other sites
Quote:
 Original post by golopartLOL. 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.

I would fire you just for using the word "lefter" alone. =P
0

##### Share on other sites
Quote:
 Q: "How would you find out if a machine's stack grows up or down in memory?"

The correct answer is "Check the documentation."

Who's more valuable: The guy who can come up with some hack to calculate the value, or the guy who knows where to look up the value?

CM
0

##### Share on other sites
Quote:
Original post by Conner McCloud
Quote:
 Q: "How would you find out if a machine's stack grows up or down in memory?"

The correct answer is "Check the documentation."

From earlier:

Quote:
 Any intermediate questions that I asked for clarification or otherwise have been omitted.

I asked about that ("Is there a handy reference manual available somewhere?", and the response was "Your co-worker has a wobbly desk and is using it to prop it up right now." Heh, heh. At least Google has a sense of humor.
0

##### Share on other sites
My Comp Sci teacher once passed around this little application for google. It had some wierd stuff, though it makes it all the more interesting to work there:

1) Calculate the Resistance in ohm's that a knights move would require on an infinite plane of resistors(forgot the resistance of each resistor, or whatever).

2) What is the most beautiful equation you have ever seen? Explain.

3) You have 10,000 Apache servers, and 1 day to generate $1,000,000. What do you do? And some other stuff. 0 #### Share this post ##### Link to post ##### Share on other sites Quote:  Original post by Sagar_Indurkhya3) You have 10,000 Apache servers, and 1 day to generate$1,000,000. What do you do?

Sell them for \$100 each?
0

## 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

Followers 0

• 17
• 12
• 11
• 27
• 20