Hacker News new | ask | show | jobs
by kafkaesq 3538 days ago
Not long ago I screwed up a tech interview because I couldn't remember/figure-out-on-the-spot the iteration condition for estimating square roots by the Newton-Raphson method

(1) Better to say you were unable to "remember", rather than a "figure out". No one ever "figures out" things like the Newton-Raphson method over the phone -- not even people like Isaac Newton or Joseph Raphson (substituting whatever comparable level of distraction on had to contend with in those days, absent telephones -- "while ordering a beer at the pub", I guess).

(2) The use of this question as a binary hiring filter (mindlessly copy-and-pasted from their rough impression of what ever other company is doing in 2016) was a failure on their side, not yours.

3 comments

Actually, under non-brain-wedgie conditions, I can re-derive Newton-Raphson because I do have a good conceptual grasp of it. (In fact, after I got off the phone, I did it just to convince myself that I could. It took me about five minutes, which is nothing under realistic conditions, but a long time when you're on the phone.) But at the time I had a brain wedgie, and the interviewer just kept pushing and prodding and wouldn't let it go. It was damned annoying. I was sitting there thinking, why are you so fixated on this?

It was definitely their loss because the technical problems they were facing were very similar to ones that I had faced (and solved!) in a previous startup (network optimization problems). But I never even got to talk about that.

Because of that experience, I now make it point whenever I interview someone to always ask, particularly if they're floundering, "What should I ask you about that will let you show off your strengths?" I don't have any qualms rejecting someone who can't answer that question (and a surprising number of candidates can't).

Not to sound too snobby (I would have notrecognized the Newton-Raphson method is by its name either), but I think it is at least plausible to figure out the method on the spot.

If you either know how the first order of a Taylor series looks like or just brainstorm a bit about how the derivative could help you in finding a root, you will figure out the Newton-Raphson method rather quickly. But then, it really depends on the job whether this is actually knowledge the interviewer would want to test.

That said, I completely understand that even if you would have the required knowledge, it is really easy to fumble during a high-stress situation.

figure out in the sense of discover? sure

Figure out in the sense of work out the updates, particularly for f:R -> R, if you already understand NR? That's totally doable in 5 minutes with paper; it's just figuring out an x intercept. And remembering/finding f such that f(sqrt(2)) = 0

I've also been asked, in person, the derivative of x^x. Hope you remember logarithmic differentiation! It's not like, had you happened to not have used this trick for a derivative in the last 10+ years, you could look up and recall in 5 minutes given you understand chain rule. I remembered it, but what kind of filter is this?

"Discover" in the sense of "derive ab initio, truly never having seen an iterative root-finding method, or anything analogous to it" -- like Newton and Raphson both did, separately -- I highly doubt it.

Re-derive your (or my) perhaps-more-than-a-bit-stale-by-this-point derivation, from way back when, under non-interview conditions? Yeah sure -- assuming we were actual math majors, or among the 10% or of CS majors who are burned-in math types.

But under interview conditions? Unless the role explicitly requires an actual math background (or a CS background with emphasis in numerical algorithms), really quite a silly thing to expect of someone.

oops -- when I said "figure out in the sense of discover? Sure" I was unclear, but I agree -- that request would be ludicrous.

That said, I have full faith that Gauss would pass that interview. Probably Euler, Tao, Dantzig, and Turing too =P

But it's not entirely unreasonable for optimization/OR/ML people. Mostly they have to remember how to construct the right function to find the zero of. Most applications of NR just want to find the zeroes of gradients of loss functions.

I certainly am not disputing the silliness... I personally am not good at math at a whiteboard while someone is staring at me. And full disclosure: I remember NR from the picture -- the x intercept of the tangent is (hopefully) closer to the zero than the initial guess.

If these companies would just say, in their job descriptions, that that's the calibre of people they need to debug their glorified hotel booking website (or whatever), then that would make things much simpler for everyone:

"When we say we're looking for the next Norvig or Knuth for this role, we mean it -- and you'll be tested accordingly!"

How could you debug a crud app if you're not Knuth?

Makes no sense.