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

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.

6

u/serviscope_minor Sep 23 '20

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.

The problem is, you will lose/exclude a lot of candidates with take home tests.

→ More replies (20)

3

u/NeuhausNeuhaus Sep 23 '20

That's fooking genius

3

u/Carighan Sep 23 '20

Ah this reminds me of back in school when we had TI-92 graphical calculators and the teachers sometimes threw in questions where they know the calculator gave confusing answers that led you in the wrong direction.

The idea was not to be able to manually calculate things, but to know when the results you are given don't fit the problem you're trying to solve and you must have taken a wrong turn somewhere.

→ More replies (13)

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 (1)
→ 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.

3

u/Belgand Sep 22 '20

And 90% of the time these aren't skills utilized by or required of programmers, but computer scientists and mathematicians.

My favorite was someone who mentioned that their technical interview consists of finding a fairly simple open issue on an open source project and then working with the candidate to resolve it. It's a real-world insight into how they would actually perform the job. Of course, it also takes longer than just giving people math problems.

17

u/[deleted] Sep 22 '20

I’m not a huge fan of leetcode, but the whole idea isn’t about whether you can solve the question or not, it’s about how you approach problems you haven’t seen before and how you break it down.

0

u/[deleted] Sep 22 '20

[deleted]

27

u/Diabolic67th Sep 22 '20

The last line in every pseudo-code algorithm should be "check google to find the better way of doing it."

→ More replies (1)

0

u/[deleted] Sep 22 '20

[deleted]

→ More replies (7)
→ More replies (26)

14

u/de__R Sep 22 '20

That's how these questions are supposed to work, but more often the interviewer is lazy. The person that did this problem before will get a high scorre on the question while the one that was on the right track but lost 20 minutes because they didn't know that Swedish and German have different collation rules won't, and that can make the difference in who gets hired.

→ More replies (9)
→ More replies (6)