Google/Microsoft Software Engineer Salary

<p>SPICEy1988 - I think you’re wrong. So I guess on average, your method will take 25 tries with a maximum of like 50? But if you drop the first egg starting on the 10th floor and then every 10th floor above that, then you know the interval of 10, and you can do a linear search with that second egg. So this takes like 10 tries on average, and 20 maximum.</p>

<p>And I think this is the right solution? If it is, then it didn’t seem too bad to me. Though proving it (if my proof is correct) could be tricky.</p>

<p>First of all, this isn’t one of those questions with a trick answer–it’s essentially an algorithm problem. To find the “least number of drops”, you have to assume to worst case scenario for each sorting method. Everyone starts with the binary search, but the worst case is 50 tries, i.e. drop from floor 50, it breaks, then linear search from 1-49.</p>

<p>Shravas got a better solution by using intervals. The worst case here is if it breaks on floor 99: you drop on 10, 20, 30, 40, 50, 60, 70, 80, 90, 100(break), 91, 92, 93, 94, 95, 96, 97, 98, 99 (break). The worst case is 19 or 20 drops. It’s a clever solution, but if I were an interviewer I would now ask, “Can you do better?”</p>

<p>The truth is that there is an even better solution out there. Not many people are able to get it, but those that can are the type Google et al. will want to hire. Of course, since this problem is known to the public now, they’re probably asking something else now.</p>

<p>

</p>

<p>Not really. The types of problems Google (and MS, Facebook, etc…) use on these interviews are already public. It’s not as if these companies have entire departments working on creating tricky problems for interviews.</p>

<p>If someone is willing to put in serious time preparing for the interview in this way (researching and working on tons of problems), the interview can be “gamed.” It’s not such a big deal though - if a person is willing to go to such lengths, it at least proves they’re dedicated, hard-working, and at minimum pretty smart. So it’s win-win.</p>

<p>If I was a LAC graduate,
I’d hire an engineer to give me the answer</p>

<p>If I was an Business Person,
I’d hire an engineer on the ground floor to buy me a dozen eggs. He puts eggs on the ground, and brings the rest up to my floor. I would then eat 2 eggs and throw the remaining eggs at this idiot as his compensation.</p>

<p>Yeah, the 10 solution is better. I thought about it some more. For n floors, you want to do root n intervals up then at most root n linear. I have actually solved this before, I don’t know how I ****ed that up. Anyways, what is the better solution? I can’t think of it. Maybe that’s why Google didn’t get back to me.</p>

<p>But I am taking MS.</p>

<p>There is an intelligent way to respond to this post. Yes, the practical implementation of the theoretical solution makes the implementer a complete idiot - he is being ignorant to the physics. And if an engineer were hired and did carry out the experiment, he would be an idiot and should have eggs thrown at him.</p>

<p>A better version of the problem is to put a probability distribution function on the unknowns.</p>

<p>The best solution is to adapt the interval method to make it variable, starting with an interval size of 14. The drop order would go 14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99. In each drop, the interval size shrinks by one. This way, the worst case scenario is 14. If it breaks on 100 you got the answer in 12 drops, but if it breaks on 13, 26, 38, 49, 68, 76, 83, 89, 94, or 98 it will take fourteen drops to get it.
To illustrate:
14 (break), 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 (break) --answer is floor 13, found in fourteen drops.
OR
14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99 (break), 96, 97, 98 (break) --answer is floor 98, still found in fourteen drops.</p>

<p>Note that starting with an interval of 13 isn’t enough to make it up to floor 100, so 14 is the best possible answer.</p>

<p>what’s the right answer? I mean the answer google wanted.</p>

<p>I just posted it. It’s not a trick question. What is this, consulting?</p>

<p>Figured this was relevant:</p>

<p>[The</a> Programmer Salary Taboo](<a href=“http://www.thurn.ca/the_programmer_salary_taboo]The”>http://www.thurn.ca/the_programmer_salary_taboo)</p>

<p>From:</p>

<p>[The</a> Programmer Salary Taboo : programming](<a href=“http://www.reddit.com/r/programming/comments/gohbi/the_programmer_salary_taboo/]The”>http://www.reddit.com/r/programming/comments/gohbi/the_programmer_salary_taboo/)</p>

<p>There is no right or wrong answer. This is a thought question in order to find out how you react and process information.</p>

<p>For the most part, the replies did not read/heard the question: You have ONLY 2 eggs; Unless you pose more questions to the interviewer, you will not find out if you can obtain more eggs or other conditions of the experiment.

</p>

<p>@LongPrime
Just curious. If you are only given two eggs, and you hve to drop them from the the windows, the max number of drops is 2. Isn’t it? I mean two eggs means two eggs. No more or fewer than two. Exactly two.</p>

<p>But if they are fertilized eggs, I can wait till the chickens grow. If they are not, I guess I can trade them and hopefully get a chick.</p>

<p>Anyhow. I will lay a sheet outside the windows of each floor. As the egg drops it will either fall through the sheet or breaks.</p>

<p>The previous answer of 14 is correct but the solution posted is not completely rigorous (it just says what to do but gives no idea of why you would try that strategy). A very quick sketch: drop from floor N. If it breaks, it will take at most N drops to find the desired floor. If not, go up to floor N+M. Show that M=N-1. If it breaks on floor N+M, go up to floor N+M+L. Show that L=N-2. Continue inductively. N=14 because that’s the smallest integer such that N+N-1+…+1>100.</p>

<p>What about some dude who gets paid 65K at a company that no one has ever heard about?</p>

<p>sakky - The suspect problem with the MIT information is that it lumps EE and CS. EE generally make less than CS, bringing the average down.</p>

<p>Does anyone know if Silicon Valley offers are negotiable? Any anecdotal evidence?</p>

<p>Don’t forget to include taxes - that will shave off about 20% to 30% of your salary.</p>

<p>

</p>

<p>It depends on the company, but from my experience they are.</p>

<p>If unlimited eggs then its simple. Drop egg at 50
then further cut the difference in half until you find your floor.
then cut halfway in btwn 50 and 100 to 75
then from there cut it again btwn 75 and 100 to 87
then from there you have btwn 87 and 100 which would be 93
then from there we can say btwn 93 and 100 which would be 96
then 98 if it stays unbroken yet again then onto 99 and maybe even 100
either way your looking at like what 7 drops or so at worst case scenario8 drops</p>

<p>you just half it then pick one half and half it and so forth not that hard of a concept. kinda surprised no one came up with this…</p>

<p>Now I have been out of math for far too long to turn this into an equation… or to explain it well in math terms.</p>