January 20, 2006

Excruciating science

I have just had a first-round technical interview with Google. Actually, it was Google Switzerland but it hurt no less :) Generally speaking, I avoid situations where my competence is glaringly inadequate but I could not confine my curiosity by merely listening to others’ accounts of interviewing with the next Microsoft.

Curiously enough, the interviewer himself was a Russian although we obviously were speaking English (answering my questions at the end of the interview the interviewer mentioned that he had offers from both Google and Microsoft three years ago).

Throughout the questions were not overly hard. Having read enough about puzzle-riddled style of torturing at Microsoft and Google I was almost surprised by the lack of real insanity. Nevertheless, I managed to miserably fail all the way.

As a warm-up I was asked to express my view on differences between C++ and Java. Well, I mumbled a lot (somehow I find it baffling to discuss concisely such omni-encompassing topics) but I figure my next blunder eclipsed this minor nuisance.

The meaty part started from discussion of vector implementations. Certainly I was able to cite the two classical approaches (i.e. an array and list) and even named correctly a decent strategy for array accretion (TCP-like doubling of the previous size on every allocation of a new array) but then my lack of formal CS education caught up with me. I could not compare the big-O complexity estimations for doubling the size and just constant increments. I know it is stupid but half way down the road I just found myself incapable of reaching a definite answer.

The next brainteaser was more life-related. Imagine there is a set of, say, 1M pairs of coordinates (e.g. of gas stations). The task is to find 1K of those of them which are the nearest to a particular point. Huh, Apart from coming up with a straightforward idea of breaking the map into chunks with a manageable number of points I did not come across anything dramatic.

The last problem to be solved was inspired by those elusive gas stations. The suggestion was to estimate the number of them in the European part of Russia. As this was a fairly typical ballpark figure assessment exercise I made a few assumptions and even reached a number (something like “Let’s say there 60 million people, one in four possesses a car, it takes 5 minutes to fill a tank, a car must be filled in every 3 days, a gas station effectively works 10 hours daily … and that would be 40 thousand stations”).