Hacker News new | ask | show | jobs
by craigyk 4023 days ago
One of my interviewers at Google asked me to implement a balanced tree insert on the whiteboard in C. After doing so he immediately told me it wouldn't work. I searched futilely for a minute or two to find the problem before he condescendingly pointed out I had left out a semicolon on one of my statements...

Another in the same interview got in my face (this should be easy) when he thought it was taking me too long too multiply two numbers like 637 and 41 during an estimating problem. I understand the point of most of these questions is quick and dirty estimation (600 x 40), but seriously...

2 comments

RE your second paragraph, it's easier than it sounds.

637 is an awkward number, we'll start by rounding up to 640: 640 * 2 = 1280, anyone in tech knows 2x that is 2560.

Make up the missing 3: 3 * 4 = 12, 2560 - 12 = 2548.

2548 * 10 = 25,480.

25,480 + 7 = 25,487

25,487 + 30 = 25,517

25,517 + 600 = 26,117.

That said, I did make a screw up when calculating it, and added the 637 before multiplying by 10 (which may have been the differentiating part of that question, combined with the intentional stress, to see how you cope with pressure? Although I didn't sleep last night, which might be the cause :D). I dunno if they wanted you to do it as quickly as 600/640 x 40 though, which obviously makes it much more difficult.

Afterthought, due to sleep deprived state, quicker way to solve:

600 x 40 = 24,000 40^2 = 1600 25,600 quick and dirty, for accuracy: 3 * 40 = 120 25,600 - 120 = 25,480 25,480 + 600 = 26,080 26,080 + 37 = 26,117.

Sorry, this comment turned into a bit of a ramble.

Of course multiplying two numbers is easy: primary school children learn how to do it. Doing it in your head under pressure in an interview is entirely different.
What primary school did you go to, where you had to multiply those kinds of numbers in your head?
Perhaps it is an ego trip for the interviewers?