r/programming • • Sep 22 '20

Google engineer breaks down the problems he uses when doing technical interviews. Lots of advice on algorithms and programming.

https://alexgolec.dev/google-interview-questions-deconstructed-the-knights-dialer/
6.4k Upvotes

1.1k comments sorted by

View all comments

Show parent comments

874

u/hparadiz Sep 22 '20

Imagine spending years gaining experience in Android Studio. Learning the ins and outs of development on the platform: debugging, deployment, and best practices. Eventually you work your way to building roms by learning on XDA. Finally you code your own thing and see your code actually get merged into upstream and now it's on every Android device ever. You're so proud and you apply for a job at Google. You get the interview but fail in the first round cause you couldn't figure out something you saw for the first time ever in under one hour.

418

u/well___duh Sep 22 '20 edited Sep 22 '20

Or b/c the "problem" you were asked to solve is not realistic at all pertaining to the job at question, and if it were, it is easily googleable because someone most likely already solved that problem, saving future devs much time in preventing them from reinventing the wheel.

To me, a true experienced dev isn't one who knows the answers to most questions, but the one who knows how to find the answers to most questions. Even if the solution isn't easily googled, an experienced dev has other ways of finding their solution, either through code debugging or asking other devs/coworkers or going through the code source, etc etc. 99% of devs in any job aren't going to spend most of their days solving code riddles, and it's very out of touch to interview with that in mind.

Note that this is all pertaining to most dev jobs out there, which are CRUD jobs, even at Google. Obviously this doesn't pertain to jobs involving brand new technologies where you're creating something completely from scratch, and thus you will be forced to find your own solutions.

131

u/Fairwhetherfriend Sep 22 '20

and if it were, it is easily googleable because someone most likely already solved that problem,

This is why, when I wrote a technical test for potential candidates for my job, they had 24 hours to do it on their own. They were allowed to use Google and whatever else they felt appropriate. Except, for one of the questions, the top answer on Google was wrong.

IMO, it's extremely useful to see who can make effective use of Google and, in particular, who is capable of recognizing the problem with the top result so that they know to either fix it or use another one. Now that shit is a useful skill for a technical candidate.

→ More replies (36)

144

u/AJackson3 Sep 22 '20

Totally agree, finding answers is a real skill and sorely lacking in my experience. On Friday I got added to a conference call with 3 others, 2 more senior than me, that was already over 2 hours in. They were trying to fix an error one was having. I'd never seen the error before but searched it, ignored a couple clearly unrelated results, and found a relevant potential solution and suggested it. Worked straight away. I have no idea what the spent 2 hours doing

165

u/[deleted] Sep 22 '20

Obviously they were calculating the time and space complexity of the solutions. Something a noob like you wouldn’t understand the importance of.

35

u/fried_green_baloney Sep 22 '20

Those knapsacks don't fill themselves.

20

u/holangii Sep 22 '20

Yeah those engineers suck, but like, do you think those guys could pass an algos interview lmao

39

u/vidarc Sep 22 '20

i work with so many people that don't understand that you can just google the error message. i've responded to so many slack messages asking for help with the first github issue that popped up when i searched the message they posted. i just take the first line of their stack trace, plop into my search bar, and browse through those links. typically you find a solution on the first page or at least something that points you in the right direction. i'm getting so close to just responding with this site: https://lmgtfy.app/

22

u/mimetic_emetic Sep 22 '20

What does that site do?

0

u/[deleted] Sep 22 '20

[deleted]

→ More replies (2)
→ More replies (6)
→ More replies (6)

53

u/Caffeine_Monster Sep 22 '20 edited Sep 22 '20

other ways of finding their solution, either through code debugging

This is the main thing that separates a good dev from mediocre time and time again. Sometimes hacking together toy examples from reading auto generated class docs or using custom implementations is the only way to get things done.

By definition, the internet typically only solves "easy" problems. i.e. problems that crop up a lot, or problems with trivial or well accepted solutions.

42

u/StabbyPants Sep 22 '20

This is the main thing that separates a good dev from mediocre time and time again.

yeah, you use the toy examples to tell you what you missed, then take some time to make sure it's sensible.

By definition, the internet typically only solves "easy" problems.

no, it also solves obscure ones related to the 3rd party lib you just saw today that people have been working on for two years. "oh, that's a known issue and here are two work arounds"

4

u/AttackOfTheThumbs Sep 24 '20

I work with ERP systems, many of which have bad, incomplete, or sparse documentation. Many of which simply don't have many online resources for code. You sometimes have to spend a few hours figuring out how something works, because the documentation doesn't really say much. You browse and debug the source code to figure out the effects, or side effects. Why does this client config break? Oh, the base ERP system changes a funky behaviour and now there's an undocumented end result. Amazing.

Searching will still help you get ideas, but you still need to hack together pieces and find your own solutions, and then hopefully document those internally.

→ More replies (1)

5

u/bjmckenz Sep 22 '20

Longtime SDM here (hired many SDE at amazing company).

I never down-voted anyone for not knowing. Yes, we all know that Google and stack overflow are the modern RTFM.

Its about solving problems. That means asking enough questions, explaining your thoughts, checking assumptions.

Importantly, making sure that it works (testing) and that or is what i asked for.

The more senior the more I expect high level systems thinking. Entry level, not so much.

Atthe end of the day, you'd better write some pseudocode. If its that type of problem.

Oh, and you wrote some stuff using XDA? Prepare to explain it detail so I understand the complexity of what you did. You need to convince me that you really did it.

And communication skills. Comments in code, checking in with what I ask.

Did you care enough to understand our company's culture? Because im going to check out if you're a good fit based on what you've done in the past.

→ More replies (55)

0

u/[deleted] Sep 22 '20

[deleted]

23

u/badtux99 Sep 22 '20

Better ways exist, especially for hiring experienced engineers who have a track record. Asking them to explain work they claim they've done that is relevent to the problem set you're trying to solve is simply common sense. If they can show they actually understand what they claim they did, then you can believe their track record. This isn't rocket science, there's actual studies and research papers that have been done on this shit. Google's process is oriented around new college hires, and IMHO that's deliberate -- they don't want to pollute their googleness with olds who have actual experience solving real-world problems and can point them to already-existing algorithms and software, because that's no fun. Re-inventing everything from scratch is what's fun.

66

u/elcapitaine Sep 22 '20

To be fair I've talked to google interviewers and they understand that their process is heavily, heavily flawed. They just dont have a better way.

Maybe they should try actually conducting an interview. Not a quiz. Ask about past experiences like every other industry maybe? Sigh...

71

u/ProcyonHabilis Sep 22 '20

Having tried that, I can assure you that you will get lots of people who are adept at sounding like a good candidate, but can't seem to code to save their lives. Interviewing is hard.

31

u/hardolaf Sep 23 '20

I worked in defense right out of college. We learned through decades of collective experiences that you can learn a lot by having a relaxed interview environment, require the candidate to present and explain a previous project that they worked on, and by making the candidate believe that the engineer hanging out with them at lunch and giving them a tour was on their side. We very rarely couldn't figure out someone's skill level and capabilities in the process.

No need for complex trivia questions or algorithm questions that in reality you'd look up. The only real trivia we'd ask is to have people explain fundamental concepts in their field to us as if we were new grad engineers. From what we could tell, we had a much lower false positive and false negative race than the major tech companies.

8

u/ProcyonHabilis Sep 23 '20

Yeah I agree with all of that, that approximately the same as my best answer for how to go about doing an onsite. The problem with that is it is difficult to do efficiently. The earlier screening stages are the part I don't have a great solution for.

→ More replies (7)
→ More replies (3)

50

u/munificent Sep 23 '20

Google interviewers do ask some questions about the candidate's work history and resume, but that ends up being of limited use as a hiring signal. When you focus too much on that stuff, what you end up hiring is:

  • People who are really skilled bullshitters.

  • Extroverts on the bad end of the Dunning-Kruger scale.

  • People who are culturally similar to the interviewer.

Those are all anti-goals for Google's hiring process. Asking abstract algorithm questions is definitely weird and not entirely related to what the job actually entails, but it less subject to those pernicious biases.

9

u/HettySwollocks Sep 23 '20

People who are culturally similar to the interviewer.

/\ This is so true, and I'll be honest I did exactly this early on in my career. I'd build a mental picture of what I thought they'd be like when in actual fact I was just trying to hire myself.

It dawned on me one day when I was interviewing this guy who I just thought was a arrogant prick, he demonstrated his coding ability well but something about him just rubbed me up the wrong way.

As we were in a bit of a bind to find a new developer I begrudgingly gave him the green light. He turned out to be shit hot, a genuinely nice guy who I became personal friends with.

It turns out that's just how he converses, once you get past the brashness and just accepted "Yeah that's just Dave" it no longer mattered.

Once I discovered this fact I felt really disappointed in myself, how many people did I turn down because I couldn't see through my own inadequacies? Now I make damn sure not to make the same mistake, I'll throw it to fellow interviews to cross check any negative feedback.

→ More replies (1)

4

u/ggtsu_00 Sep 23 '20

Then you end up only hiring people who maxed out all their stat points on interviewing skills, but 0 points on actual technical skills. They will then go on to fast talk their way out of every work assignment, pass off their work on to others while taking credit for their work, are constantly always blocked by something trivial, suck up everyone else's time and eventually you have to fire them after you find out they putting all their tasks up on Koder and Bountify.

→ More replies (29)
→ More replies (3)
→ More replies (31)