Earlier quoted context omitted.
learn with the intent to become a better engineer, even if you don't hit the google mark (which is arbitrary anyway), you will become a better engineer. That is the philosophy most people should use when trying to aim for these companies. Don't cram, learn.
I disagree. Doing competitive-style programming and learning all sorts of weird algorithms has not made me a better engineer. I can count on one hand the number of times in my career that I have had to design or use an "interesting" algorithm - and no, not in the "not knowing what you don't know" sense where I could have used one if only I'd known about it.
How to Ace the Google Interview: Ultimate Guide
81–90 of 239 posts
Re: How to Ace the Google Interview: Ultimate Guide
#82Earlier quoted context omitted.
I don't work at Google (and I don't agree with some of the things the company's decided to do) but have many friends who enjoy working there. From what I hear, Google has an organizational structure that is very favorable for regular engineers. Once you're hired and you put in around a year of work in a team, it's almost trivial to find another team. Engineers also directly evaluate managers and I've heard stories of…
> I've heard stories of mid to high level managers crying in bathrooms because of poor reviews from their reports. Is this your idea of an engineering nirvana? Does engineering happiness have to come at the expense of manager happiness?
Re: How to Ace the Google Interview: Ultimate Guide
#83They lost me when they got into showing how to make the 'dups' function faster. The author definitely either doesn't understand big-O notation or doesn't understand the complexity. Their O(1) implementation is anything but. Likely O(n×log(n)) at best. Also, their brute force implementation is unnecessarily verbose. Want dups? from collections import defaultdict def dups(seq): d = defaultdict(int) for x in seq: d[x] +…
Of course, once we start optimizing how the original array is stored, we may have exceeded the limits of this problem as a teaching exercise :)
As for time, it does seem to be O(n) to me; can you clarify why you think it's nlogn? It may not be particularly fast in practice when compared to other O(n) approaches like the bitmap, but I don't think the complexity is wrong.
Your solution is nice - it actually gives you more information (how many appearances, not just T/F >1 appearance), but it does require more additional space and isn't necessarily faster. I think the bitmap approach would be nicer if you're ok with using more space; the bitmap is essentially a very easy to find perfect hash function due to the unique input constraints.
Re: How to Ace the Google Interview: Ultimate Guide
#84Earlier quoted context omitted.
Elite schools do that in undergrad; e.g. as an initial scored lab exercise, write this recursive fractal shape using Logo, parallel Delaunay triangulation with prefix sums , dynamic programming solving oligopoly problem or single-value Paxos pseudocode on a piece of paper in 10 minutes (I am being serious). If you can cope with it, it immediately shows up in the interview and you are considered a member of the club,…
Which elite schools? I went to MIT and didn’t have to do any of this.
Re: How to Ace the Google Interview: Ultimate Guide
#85Earlier quoted context omitted.
> But I've had candidates that try to make up language features, and that doesn't fly with me. This piqued my curiosity. Can you give an example?
I once passed a whiteboard interview just calling random made-up operations on generic java arrays, like Array.flatten(). I was relatively new to programming and had been practicing in Java but didn't know how to execute a lot of map/filter/reduce operations off the top of my head like that. I did, however, know that my interviewer was a Python programmer that probably didn't know much about Java language features.
Re: How to Ace the Google Interview: Ultimate Guide
#86Re: How to Ace the Google Interview: Ultimate Guide
#87Earlier quoted context omitted.
I once passed a whiteboard interview just calling random made-up operations on generic java arrays, like Array.flatten(). I was relatively new to programming and had been practicing in Java but didn't know how to execute a lot of map/filter/reduce operations off the top of my head like that. I did, however, know that my interviewer was a Python programmer that probably didn't know much about Java language features.
I thought you were allowed to assume functions you needed in the interest of a modular solution. Array.flatten is an obvious “assume I have this, I would write it anyways.” I think most decent interviews will give you a pass on an enhanced standard library.
Re: How to Ace the Google Interview: Ultimate Guide
#88It would be nice if an article on how to ace a coding interview did not have incorrect code in it. AFAICT the set-based algorithm for finding duplicates is wrong; the resulting set will contain items in the list that are not duplicated.
Re: How to Ace the Google Interview: Ultimate Guide
#89Earlier quoted context omitted.
> But I've had candidates that try to make up language features, and that doesn't fly with me. This piqued my curiosity. Can you give an example?
I've had people interview for a Java job who didn't realise strings were immutable. The question asked was a very short multiple choice; only two of the answers were possible under immutability.
When I interviewed for my current job using Java, I had been programming in Ruby and JS for the better part of a decade and had to refresh my Java syntax fairly quickly. I know I made some dumb syntax mistakes in my phone interview, like instantiating collections totally incorrectly. I distinctly remember one of my in-person interviewers saying "well, in Java it's boolean, not bool, but sure...". More semantically, I may very well have messed up mutability of collections and primitive conversions and boxing and such.
Enough of my interviewers saw through all of this that I got the job. Now people on my team come to me and say, "hey you're a java guy right?" and ask me questions about this stuff. I wasn't a java expert when I interviewed, but now I am, because that's what my job required, so I learned it. That's what my interviewers were looking for, to the company's benefit.
Re: How to Ace the Google Interview: Ultimate Guide
#90This is getting ridiculous. These guides to interviewing at specific companies are starting to sound like the video game cheat code books of old. If the process is so nuanced that there's an entire industry around these types of guides (and Google even highly recommends you buy them!), then the process is fundamentally flawed. But we already knew that, and as long as others are still playing the game, we are forced t…