Live data from Hacker News

I cheated on my Microsoft interview (2019)

facet.net

501–503 of 503 posts

Re: I cheated on my Microsoft interview (2019)

#501

IMHO, this was not cheating. This is a phenomenon called success. If you are fortunate (?) to be around in the entrepreneurial world long enough, you will realize that intelligence, hard work, good time management etc are not adequate. They just qualify as deserving. There are serendipities that separate those who succeed from everybody else who was deserving. Survivor bias [1]. Calling Eli was your serendipity. The…

The serendipitous knowledge of the question isn’t the cheating. The cheating is the deception in the interview that this is a question being encountered for the first time. It’s cheating because it’s the type of unethical behavior you wouldn’t want in a colleague: pretending that they are brilliantly generating insights on the spot that they have actually researched previously. I don’t think it’s an unforgivable sin,…

> it’s the type of unethical behavior you wouldn’t want in a colleague

we're talking about Microsoft here, embrace, extend, extinguish, and all manner of other perfidy.I'd say he fit right, apart from his conscience.

Re: I cheated on my Microsoft interview (2019)

#502
post #360

Earlier quoted context omitted.

That's just the first question. The follow-on is, if you add 6 feet and put your finger under the rope and pull up until it's tight again, how far have you raised your finger? 1ft? 10ft? 100ft? 1000 miles? The answer to that is very difficult. There are several approaches.

I solved a very similar problem (in the context of a pathfinding and obstacle avoidance sim) 25 years ago, and I can probably describe the thought process and geometry in very digestible terms, but if I had to code it in a whiteboard I'd likely fail.

Same here. I don't code with somebody looking over my shoulder. Can't perform that way. :)

Re: I cheated on my Microsoft interview (2019)

#503
post #422

Earlier quoted context omitted.

Is that a puzzle? Isn't it just 2πr + d = 2π(r + d/2π)?

When stretched, the length of the rope will be two straight lines plus part of the circle. The length of the segment can be calculated using a formula for horizon. Then we can create an equation: (s arc distance to horizon for h)*2 + delta = (d straight Distance to horizon for h)*2, or d-s-delta/2=0. d=sqrt(h(2R+h)) km/m (see https://en.wikipedia.org/wiki/Horizon#Approximation ) s=R*arccos(R/(R+h)) (see https://en.wi…

I think I found a small typo, where you have delta (instead of delta/2) in the third line. I believe it should be

sqrt(h(2R+h))-R * arccos(R/(R+h))-delta/2 = 0

This can be solved for h given delta numerically, such as with a spreadsheet. Use caution here because this formula leads to a loss of significant digits from cancellation of nearly identical terms.

For example, given R = 6378000 meters and trying h = 193 meters: the first (d) term is 49618.0 meters and the second (s) term is 49617.0 meters. The difference is 1.0 meter, which is the half delta we wanted. But there's been a loss of 4 significant digits (because the first 4 digits in each value are the same: 4961). The smaller the arc distance, the smaller the angle, the worse the relative error becomes.

It's possible to analytically factor out sqrt(2hR) from both the d and s terms. In the first case,

d = sqrt(2Rh+h^2) = sqrt(2Rh) * (1+h/4R) using Taylor series for (1+h^2/2Rh)^0.5

In the second case, I can derive one formula, but the coefficients aren't the same as my numerical best fit, which is

s = sqrt(2Rh) * (1-5h/12R)

Combining the two series versions for d and s, gives us this for delta,

delta = 4h/3 * sqrt(2h/R)

Finally, solving for h given delta, take the cube root of h^3:

h^3 = (9R/32) * delta^2

Thus for a delta of 2 meters, I get height h = 192.88 meters.

Post reply on HN