I got the job.
A Google Interviewing Story
81–90 of 122 posts
Re: A Google Interviewing Story
#82Maybe we'll get there someday...
Re: A Google Interviewing Story
#83Earlier 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.
Re: A Google Interviewing Story
#84Re: A Google Interviewing Story
#85Earlier 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.
Re: A Google Interviewing Story
#86I 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…
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
#87Re: A Google Interviewing Story
#88Earlier 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…
Re: A Google Interviewing Story
#89Earlier 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…
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).