Live data from Hacker News

A Google Interviewing Story

paultyma.blogspot.com

81–90 of 122 posts

Re: A Google Interviewing Story

#81
I've had something similar happen to me at a Microsoft interview. The interviewer asked me a question I explicitly knew the answer to, and it too wasn't "my" answer to the problem but the one I've heard in another interview. So I just told him: "I know this one. Can you ask me something else?" He told me he appreciated my honesty, and didn't have any other questions.

I got the job.

Re: A Google Interviewing Story

#83

Earlier quoted context omitted.

I doubt that the interviewer mentioned the prime number solution due to insufficient cleverness in the original solution. The answered O(n+m) solution actually contains flaws beyond its lack of cleverness. 1) there's no good reason to use a hash map, hashing is useful in maps for mapping an unevenly distributed set from a large an arbitrarily large space to an evenly distributed set from an arbitrarily small space. T…

With your solution, I might have not accepted you to do job because it is obvious you don't have experience with Unicode and localization.

[deleted]

Re: A Google Interviewing Story

#84
Hum, Guy's solution is really terrible, division, multiplication and modulo are very expensive operations, and completely unnecessary here. This is basically a case of "I'm clever and you must think like me to be in my team". Uh no thanks.

Re: A Google Interviewing Story

#85

Earlier quoted context omitted.

The dinging people for not-clever-enough solutions feels like hazing. It's less about competence than about ego. The most important thing in an interview is to make sure the person's level of skill is at least as big as their conception of their skill.

The most important thing in an interview is to make sure the person's level of skill is enough to be your coworker. Their conception of their skill doesn't matter. Programmers who know they're bad programmers are still bad programmers.

Yeah, but a good programmer who thinks he's a great programmer will likely be a pain in the ass to work with.

Re: A Google Interviewing Story

#86
post #33

I enjoy clever ways of approaching problems as much as the next guy, but I would never ding someone in an interview for not coming up with a clever-enough solution. Good software engineering is maybe 99.7% failure-avoidance and 0.3% cleverness. On very rare occasions you need a clever solution, but most of the time you need to solve the problem in a way that you're 100% sure will work, has no nasty failure conditions…

I doubt that the interviewer mentioned the prime number solution due to insufficient cleverness in the original solution. The answered O(n+m) solution actually contains flaws beyond its lack of cleverness. 1) there's no good reason to use a hash map, hashing is useful in maps for mapping an unevenly distributed set from a large an arbitrarily large space to an evenly distributed set from an arbitrarily small space. T…

> 15 seen &= mask(haystack);

Shouldn't it be

seen ^= mask(haystack);

And a personal change would be to define all as:

int all = ~(~0 EDIT: For some reasons, asterisk doesn't appear before haystack.

Re: A Google Interviewing Story

#88
post #32

Earlier quoted context omitted.

Can you explain what representation you use to get multiplication by a constant in O(log n)? Wouldn't it be at least O(n) for the standard bignum representations, making the algorithm O(n^2). Multiplying n primes together creates an O(n) digit number. Multiplying an O(n) digit number by a constant is an O(n) operation. So essentially we're doing an O(n) operation n times, hence O(n^2). The smartest representation tha…

It's O(n) in the number of bits. The number of bits is O(log n) in the value of the number. Multiplying n primes together, where the primes are taken from a restricted set of numbers, creates a number whose value is O(n) (it has n factors, but each factor is bounded by a constant). BTW, I would've used a bitvector. For lowercase letters only, you could fit it into a 32-bit value (add mixed-case and numbers and you ca…

So, the resulting algorithm would be O(n^2) not O(n) where n is the length of the string. The table based solution is exactly like keeping the exponents in an array.

Re: A Google Interviewing Story

#89

Earlier quoted context omitted.

Probably none of the above. I've heard the interviewer makes up their mind to hire you in the first few seconds of meeting you. Psychology is a strange, strange thing ... but reality is better than fiction.

Never underestimate the influence of narcissism in hiring, manifested as the kind of blink decision you describe. Teams in a large company develop a personality and culture that more often than not extends to attributes that have less to do with skill and competence and more to do with similarity of physical characteristics and outside interests. (The degenerate case is flat out nepotism, but the more typical case is…

Yes. I've heard of multiple studies concluding employers hire those candidates that are the most "like" them.

I read a book called "Money Ball" last year. One of the lessons I took away is that a successful baseball team can be created from undervalued stats (i.e. irrational beliefs in value cause inefficiencies). This trend you described forms teams of walkers xor home-runners, for example. I don't know why I believe this (I'm subject to my own criticism), but I strongly believe teams with multiple talents outperform teams with one talent (generalists vs niche).

Re: A Google Interviewing Story

#90
The point of the story is not the actual problem that author had to solve, which we have been discussing (but again, its _hacker_ news, after all :-)), but basically to tell how interviewing experience, even at which you fail, prepare you for better.
Post reply on HN