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

14

u/AllColorsOfARainbow Sep 22 '20

I'm not sure why the people in this thread are getting so worked up. This could be a 2nd year computer science problem and it's a totally reasonable approach for determining how a candidate approaches problems.

17

u/Aro00oo Sep 22 '20 edited Sep 23 '20

I'm not a fan of these type of interviews because it biases towards current comp sci students and even the currently unemployed -- who could very well be unemployed for a reason!

That's the demographic that's actually "practicing" and thinking of these types of questions whereas the ones that are already employed full time are generally in a completely different world in terms of the problems they face with less time (and realistically, motivation) to play with problems like this.

It's of utmost importance to understand data structures and types as well as some nice design patterns, but the applications of them are completely different in a real world setting compared to these silly "suppose this scenario you haven't thought about since your last job interview" problems.

I personally prefer "build me this that does x, y, and z using a, b, and c" problems but then employers run into scaring away good candidates who really don't want to spend that much time on the problem, so it's a tough situation for all parties involved.

My recommendation to most is: keep doing you, and you're not dumb. But going on Hackerrank (or other providers) for these types of problems every few months to brush up on thinking outside of your environment and even codebase can be very beneficial!

6

u/[deleted] Sep 22 '20

It determines if the candidate has done this kind of problems before. It doesn’t determine if the candidate can solve problems. The reason is that real world problems aren’t similar to these kind of problems. So even if the candidate approaches correctly this problem it can’t be extrapolated to developing an app. Or to building a rest API or troubleshooting a spark app, and I could make a list with all the possible problems that a developer in every field could have.

7

u/_selfishPersonReborn Sep 22 '20

I've never seen so many people that don't get why computer science degrees are important for programming. Like holy shit, does everyone in this thread expect any problem that requires an iota of thought to be given to them as an stdlib function?

3

u/audion00ba Sep 22 '20

I am pretty sure that technically could be done. It's just that nobody bothered to implement that yet.

Caveat: you do need a CS degree and 5 billion dollars to pull that off.

2

u/metamatic Sep 23 '20

stdlib function? You mean npm module, and yes, apparently.

5

u/GhostBond Sep 22 '20

I'm not sure why the people in this thread are getting so worked up

I once had an interview that I knew in the first 30 seconds that I didn't work to work there. The interviewer who it was clear I'd be working with had a certain type of bullish, big ego, add personality that I had had to deal with before.

So knowing I didn't care, he gave me some puzzle problem question. I talked about it a bit, transitioned into talking about another trick problem I had seen, then asked him to solve it.

The guy went through:

  • acted friendly and started in on it

  • within 30 seconds realized it was actually difficult and would make him look bad

  • you could watch the anger bubble up and he realized that "this is easy just takes a minute" problem wasn't

  • he angrily breaks out of it and says something like "I'M NOT HERE TO ANSWER QUESTIONS, YOU'RE HERE TO ANSWER QUESTIONS!"

My experience has always been that the kind of mentality that goes on about how "easy" these questions are, typically f**king hates being asked to solve a question they haven't seen before themselves.

8

u/znupi Sep 22 '20

So let me get this straight. You went to an interview, tried to interview the interviewer, and concluded he's an asshole for not wanting to solve it? Lmao. You should reassess who the bullish, big ego person was in that room.

1

u/GhostBond Sep 22 '20

^ Lmao what a lot of thought put into trying to avoid the conclusion.

Point was that the difference between "easy" trick problem and a "hard" trick problem is simply whether you've done it before. The kind of people giving these out having a fit about being asked to solve one is because they know it's hard to solve one you haven't seen before and makes you look bad in front of others if you can't.

3

u/znupi Sep 22 '20

having a fit about being asked to solve one

Nah mate. They're having a fit because you're wasting their time. If you don't wanna work somewhere don't interview there.

Also nobody said these problems are easy.

4

u/SJC_hacker Sep 22 '20

Why is it unreasonable to flip the script on the interviewer? How does the interviewee actually know there are smart people that work at the company?

3

u/znupi Sep 23 '20

It's unreasonable because it is already really hard to fairly judge a candidate in 40 minutes. Also, the company has the right to impose whatever structure on the interview in order to ensure a consistent hiring bar.

The interview structure normally allows for some time, 5-10 minutes (times the number of interviewers), where you can ask the interviewee questions. You can use that time to determine whether the company is a good fit for you. If that's not enough time you can ask for a separate freeform chat with an engineer.

-3

u/GhostBond Sep 22 '20

I understand you're rotating through all the excuses you can to try avoid the conclusion.

4

u/znupi Sep 22 '20

The conclusion is you were disrespectful and wasted the interviewer's time. You also most likely don't have what it takes to work at one of these companies and are being a lil bitch about it 😀

0

u/GhostBond Sep 22 '20

Lmao, I don't think I've ever met someone who likes these problems, who wasn't an arrogant little prick.

9

u/slomodayglo Sep 22 '20

If you want my opinion I believe it's because people think they're better programmers than they really are, and problems like this force them to confront that fact.

1

u/cdglove Sep 22 '20

So much salt in these comments. "I didn't get hired at Google because their interview process is broken and doesn't detect that I'm actually a good programmer."

Ya....OK

2

u/znupi Sep 22 '20

Yeah at least the first couple of solutions are fairly obvious and I'm sure that with some guidance (which he seems to give happily) you can optimize it further.

0

u/KillianDrake Sep 22 '20

There is never going to be a situation where a company is going to bank an entire product's architecture on a fresh hire based on how he memorized some question in an interview. It's going to be a team-based effort where everyone will have time to study the problem-space and come forth with proposals. This is how it is done at Google and every other company in the world. Solo shops don't deal in these types of problems.