Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How to Ace that Google Dev Interview (technologywoman.com)
25 points by Gayle on Feb 2, 2012 | hide | past | favorite | 8 comments


Some advice from someone who sat on Google's Hiring Committee for about 20 months: https://plus.google.com/101174951617223562800/posts/2UE1Y815...

Having said that, Cracking the Coding Interview is a fantastic book for technical interviews. I've always been skeptical of this kind of book, but after having interviewed at Google, MS and Amazon, I can say that most of the questions were similar to ones from the book, if not directly from it. So thanks for writing it Gayle :)


Thanks :)

And as an ex-hiring committee member myself, I agree with everything Collin there said too. And it pains me that people write blogs / books promoting this brain teaser stuff. Such a disservice to candidates...


Ignoring the issue of whether or not Google has or has not ever asked the blender question, is there a reasonable answer to it?

All I can come up with are:

A. Get down as flat as possible, so that the blades will be above you. Probably near the shaft. Exact orientation and positioning depends on the blender.

B. Sit down and wait. It's not really going to kill you. It's just a version of the Kobayashi Maru test, to see what you do in an un-winnable situation.


Here is what I have come up with.

Using conservation of energy:

When you jump your legs do work that gets converted in to kinetic energy and then potential energy.

Assume that when you are shrunk down you maintain density. The potential energy that you have at the top of a jump is mgh. (mass * gravitational-constant * jump-height). When you scale your body down your mass goes down with the cube of the scaling, which I'll call k. So after scaling your energy would be mgh/(k^3) (m is your original mass).

So how does the initial work change as you scale. The force (F) you can apply is roughly proportional to the cross section of your muscles. This changes with k^2. You integrate this over the path that your center of mass takes, which is going to change linearly with your scale k (d). That means that the work going in should be proportional to 1/k^3 as well!

So we can make two equations: one before scaling:

F * d = mgh (Leg force * leg movement = mass * gravity * jump height)

and

F * d / k^3 = m * g * h' / k^3

Which means that, to first order approximations jump height is independent of scale (h - h') and you should easily be able to jump out of the blender.


Your conclusion is right but your argument appears to be lacking.

> You integrate this over the path that your center of mass takes, which is going to change linearly with your scale k (d).

But if that's how you define d, then it is the height h! Here you are assuming that d scales linearly with k. Later you are saying that h is invariant with respect to k. Which is it?

Jumping is impulsive, not sustained, so your force times distance formulation doesn't seem appropriate.

Thompson has a nice analysis in his classic treatise On Growth and Form, which is all about dimensional analysis applied to biology. Here is the relevant excerpt:

http://books.google.com/books?id=8FrORfyp7bsC&pg=PA36#v=...


I think I wasn't quite clear in what I meant. d is the distance that your center of mass changes while your feet are in contact with the ground (While you are doing work) and h is the height that your center of mass changes while you are in the air.

Saying a force is impulsive means that you making certain assumptions to make your calculation easier. It doesn't change the fact that W = integral of force dotted with displacement. It is true that I am making a big approximation where I say that the force is constant over the jump, making the integral evaluate to f * x.

Thanks for the link. I think this kind of stuff is very interesting.


+1: I really like the fact that you took the seemingly marginal detail of the mass constant and run with it.


If I were to theorize that this were a real interview question (which, again, it's not), then I think the first step is to ask a bunch of questions. Almost any solution to this problem will be making a bunch of assumptions, and you probably need to know what those are.

* Okay, your density is the same as it was before being shrunk. What else has changed about your body? Muscular strength? Brain capacity?

* Can you assume that this is an ideal world? For example, if the blades were perfectly balanced and there was no wind / air movement, you could stand in the middle.

* What are the dimensions?

* Is there anything in the blender?

... etc ...

The best solution would depend on which assumptions you make. Any of these could be reasonable answers with different assumptions:

* Jump (an ant or spider could... I think)

* Climb out / above the blades (it's possible the walls have grooves where you can fit your tiny little hands)

* Stand on top of the blades, at the immediate center

* Lay down

* Swim out (if there's something in the blender)

* Lay on top of a blade, clutching onto it

It's all about your assumptions.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: