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

2.5k

u/iloveparagon Sep 22 '20

Doing all that so you can get hired and implement REST APIs

741

u/well___duh Sep 22 '20

Or even worse: doing all that and hiring the candidate, then forgetting the job position was for Android development and you forgot to ask Android-specific questions, and you actually hired a subpar Android dev because you focused on their algo skills that don't necessarily translate to real-world dev skills.

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 (35)

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

→ More replies (17)
→ More replies (53)
→ More replies (80)

194

u/CharonNixHydra Sep 22 '20

Ding ding ding!

I went through the entire interview process with a FAANG company. It was for a someone who specializes in low level camera integration with embedded Linux / Android. I have several patents in this domain and have been in the field for almost 20 years. During the entire process the camera questions were softballs very basic stuff that anyone who worked with a camera for a year or two would know. Of the three coding interviews in the process I ran out of time on the last one and because of this they rejected me.

It bothers me greatly that the camera specific interviews with their camera engineers were so basic. It tells me that their camera engineers probably don't have a deep understanding of what they are working with. I creeped on their LinkedIn profiles and none of those engineers had more than a few years working with cameras. So they are hiring camera engineers based on their algorithm skills but that skill set has almost no use in low level embedded Linux camera systems.

118

u/foundboots Sep 22 '20 edited Sep 22 '20

Reminds me of Apple Google rejecting the guy who wrote Homebrew because he couldn't reverse a binary tree.

edit: got my infamous engineering rejections mixed up.

→ More replies (6)

8

u/munificent Sep 23 '20

It tells me that their camera engineers probably don't have a deep understanding of what they are working with.

It may just say that you didn't get any of the deep camera engineers on your interview loop.

→ More replies (1)

45

u/RazerWolf Sep 22 '20 edited Sep 22 '20

That's basically everything that's wrong with this industry. Algorithmics are useful don't get me wrong, but they're not the whole pie. It's just a hazing ritual some "senior" (5 years experience does not make you a senior in my book) devs use to showcase how smart they think they are. Dunning Kruger in full force.

39

u/civildisobedient Sep 22 '20

It's just a hazing ritual some "senior" (5 years experience does not make you a senior in my book) devs use to showcase how smart they think they are.

A good senior developer understands that the best solution isn't necessarily the most performant solution because there are often more important business considerations (time-to-market, system complexity, code maintainability, etc.) than raw execution speed.

→ More replies (2)
→ More replies (2)
→ More replies (4)

52

u/dread_pirate_humdaak Sep 22 '20

I went back to school for EE after 20 years of software. Interviewing at Google ATAP was illuminating. Hardware engineers are interviewed respectfully and not required to do stupid code tricks.

6

u/punitxsmart Sep 22 '20

That is good. But, HW Eng roles have less competition and also pay less on average compared to SWE roles at Google.

→ More replies (2)

75

u/holangii Sep 22 '20 edited Sep 22 '20

unpopular opinion: anyone who can pass a Google interview can figure out how to do Android development competently within a few months.

Internships only, but my experience with FAANGs is that you can trust anyone to be able to learn how to do any kind of programming. There's no such thing as being a naturally "subpar Android dev". You're either experienced in it, or you're not, but for interns and new grads, experience isn't that big of a deal since you can be trusted to learn. It's much more important to find people who are capable of learning quickly.

Algo interviews aren't perfect. I've met a few people who grinded leetcode all day and managed to get interview questions they'd already done. But most people don't do that, and the benefit is that the algo interview sets a baseline level of competency. The hiring bar across Google is much more uniform, and it allows engineers to switch teams all the time. In fact the only part of Google which hires differently is Cloud. For Cloud, you don't go through the standard hiring committee. You only need to impress the team you're gonna be on. And as a result, Cloud has a reputation for having an inconsistent level of engineering talent, and their engineers aren't able to switch into other Google teams as easily.

47

u/[deleted] Sep 22 '20

Honestly, Android has such a high amount of footguns that 6 months is barely enough to come to terms that the platform is shit.

Five years in the Stockholm syndrome, going strong

→ More replies (1)

25

u/permanentE Sep 22 '20

When I've had to work against Google public APIs I've not been impressed with the quality of the interfaces, implementations or documentation. Google hasn't been able to build anything interesting in the last decade. Maybe a bunch of algo wizes that think that software engineering is easy and isn't worth emphasizing don't make that great of an engineering team.

→ More replies (1)
→ More replies (19)

6

u/[deleted] Sep 22 '20

Yeah but if they have strong algo and design skills I’m sure they can pick up on other shit quickly cause they have the fundamentals down

→ More replies (20)

24

u/EatMeerkats Sep 22 '20

Nah, at Google it's moving protobufs (and I'm only half joking).

34

u/Duke_ Sep 22 '20

If I'm going to be doing the same thing regardless of employer, I might as well be making stacks of cash while I do it.

The hypothetical "I" of course. I may not ever make it into FAANG because I resent the necessity of coding tests after having struggled so hard for my degree in CS, M.C.L.

21

u/eterevsky Sep 22 '20

Nah, Google internal APIs are mostly protobufs-based RPC, not REST.

→ More replies (4)

19

u/pheonixblade9 Sep 22 '20

Most teams do a little more than that at Google 😉 but there is the old joke about how we just move protos...

14

u/sessamekesh Sep 22 '20

Eventually you get promo and write design docs about moving protos. Or so they keep telling me.

To Googler credit though, moving protos ends up being annoyingly nuanced a lot of the time. Running a transformation in o(n) instead of o(n2) on a listing endpoint is a pretty big deal, but easy enough to miss. Still "just" moving a proto between the datastore and frontend though.

→ More replies (7)

3

u/iamanenglishmuffin Sep 23 '20

Is that true? Almost everything Google goes requires advanced data structures at some point. Search algorithm? Maps? Massive data mining?

3

u/chef_baboon Sep 23 '20

REST and vest :)

2

u/agumonkey Sep 22 '20

So ask for REST interviews so you can finally research graph optimizations

2

u/biometrickitd Sep 23 '20

no, no. this is google, they use protobuf with proprietary RPC frameworks.

→ More replies (2)

2

u/otherbillhathaway Sep 23 '20

Excuse me, they are protobuf RPC APIs.

2

u/drew8311 Sep 23 '20

Even those jobs have maybe once a month where you need to solve a more difficult problem so might as well hire someone capable of doing it.

2

u/rawoke777 Sep 23 '20

No. REST "LIKE" API :) I'm always amazed at how everyone put this "std" on the pedistal and then have to use the words "REST LIKE" since they gone off spec or design a bit to make everything sane and working in the end. "Meh" these days I'm more prone to JSON RPC, but even more prone to 'Justing Getting Things Done'

Interresting problems and answers through in post !

4

u/ArrayBoy Sep 22 '20

But but but but but algorithms

→ More replies (29)

518

u/tempest_ Sep 22 '20 edited Sep 22 '20

When I was in undergrad there was a presentation by some Google engineers (setup by an alum I think) and they fielded questions from the group.

When asked about interviews all 5 of them gave often conflicting and contradictory answers to questions about how they interview people what they look for and what was important.

I am reminded of this every time I see one of these Blog posts.

109

u/capitalsfan08 Sep 22 '20

Yeah pretty much. I ask questions (not to this level) just to make sure people can communicate and have basic programming skills, and I'm pretty sure I've interviewed people who read stuff like this and then psych themselves out of our interview. If you came in and gave an answer like this, great, but we aren't really looking for that necessarily and if you don't explain things well, don't react to our questions and comments well, or simply come off badly personally, someone "mediocre" will get a offer before you. We want a good team member, and technical skills that you can show off in an hour interview aren't really that useful to showing how you help us day to day.

41

u/carsncode Sep 22 '20

This. The best you can hope for technically in an interview is usually just weeding out the ones with a total BS resume. After that it's all about personality. If you communicate well, fit with the team, and seem to actually want to work and learn stuff, you're better than most candidates.

I'm a reasonably talented engineer and I've been ruled out by technicals for various reasons unrelated to actual technical skills. I've also bailed on interview processes that expect me to invest hours and hours proving technical skills. It's just not realistic to expect someone to do a four hour project and two hour trivia quiz as part of the recruitment process. I have a life, and a job, and you're not paying me yet, and if you don't respect that then I have to assume you won't have much respect for me as an employee either.

6

u/agumonkey Sep 22 '20

reminds me teachers at the univ lab talking about what OO was, 3 guys, 3 answers, nothing in common.

4

u/Socalinatl Sep 23 '20

It’s kind of useful in a way to think about job interviews like dating. Definitely accentuate you’re strengths and try not to dwell too much on flaws, since at the end of the interview you want them to like you and not a fake version of you who can’t live up to the hype.

Not every person you go out with is going to like you and neither is every company for every job. You wouldn’t give someone generic advice for a date that applies to all types of people and you can’t rely too heavily on advice for job interviews for the same reason.

2

u/MiniGiantSpaceHams Sep 23 '20

That's kinda the point of having several separate interviewers, though. Different styles lead to different results and you get more info to consider when deciding who to hire, and probably better rounded employees since they meet a lot of different people's requirements.

→ More replies (11)

249

u/slomodayglo Sep 22 '20

I can't wait to see this question get asked by a mom and pop shop running visual basic

162

u/[deleted] Sep 22 '20

What color is a database in SQL Server?

103

u/[deleted] Sep 22 '20

Mauve has the most memory

40

u/[deleted] Sep 22 '20

LOL, someone got the reference in a matter of seconds. You are the wind beneath my wings!!!

→ More replies (1)

13

u/[deleted] Sep 22 '20

Red is the fastest.

→ More replies (3)
→ More replies (2)

751

u/ambientocclusion Sep 22 '20

What a load of non-predictive crap. But at least it makes the interviewer feel smart, which must be the point.

436

u/DrunkMc Sep 22 '20

When I interviewed with Amazon they gave me tons of things to research and read. One of the websites started with a full page describing how the software interview is completely broken.......but it is what everyone does, so we're going to do it!

Something that I will NEVER fucking understand and I hate is white-board coding. The interview was 6 hours long, split into questions to understand you personally and the other half was white board coding. Not even pseudo code, they wanted full fucking syntax.......on a white board. I've been typing my code for 20 years and now you want me to write it? Also, in the packet was a note that this is awkward and you will be uncomfortable, so please practice at home.

Being able to copy, paste, and insert text quickly is all apart of coding and you're taking that away. Its INSANE to me. Especially cause to get to that point, I had to do a coding interview online where I can type and the interviewer could watch me type. I can so easily type and talk at the same time, but now I have to worry about being legible, spacing, oh shit, I forgot to declare something, but I can't insert, so I have to write it small inbetween two lines.

I remember I got dinged, because I did not use getters() in my white board code. He said that's not an object that, it's a struct. I was like, its just white board code, I would obviously use getters in real life. And he was very upset about that.

But yeah, software interviews are fucked. And apparently it still pisses me off, cause I did not mean to go on this rant.

133

u/percykins Sep 22 '20

I like where they insist you use actual syntax in whatever language you want. So I used Python... and had to spend my time explaining how list comprehensions work. Don’t insist I use a language that you don’t know!

81

u/gibtang Sep 22 '20

I once had a programming interview where I told the interviewer that I am going to use an associative array as I need store some key value data and it’s simple to understand. Then the interviewer piped in and ask why not a map instead to store key values instead of an associative array

60

u/the_gnarts Sep 22 '20

Then the interviewer piped in and ask why not a map instead to store key values instead of an associative array

A guy who interviewed me insisted that std::map in C++ was a hash table.

→ More replies (7)
→ More replies (9)

6

u/ChiefMemeOfficer Sep 23 '20

Yeah back when I was an IC I had to waste time explaining an interviewer how pointers didn’t really exist in the programming language I chose and he was like “but how do you solve the problem without pointers?” And I was like “um like this...” and he didn’t like it because he couldn’t believe I didn’t have access the pointers in a high level scripting language. Didn’t get the job.

→ More replies (6)

71

u/jl2352 Sep 22 '20

Something that I will NEVER fucking understand and I hate is white-board coding. The interview was 6 hours long, split into questions to understand you personally and the other half was white board coding. Not even pseudo code, they wanted full fucking syntax.......on a white board.

Should have written up Vim inputs for them to type out.

6

u/krista Sep 23 '20

senior dev interview, got asked to implement a linked list on a whiteboard in my language of choice... oh, about a dozen years ago or so... so i wrote it in 6502 assembly.

got board explaining that assembly is a real language and walked out.

turns out the company got sued for fraud and went bankrupt a year later... dodged a bullet on that one.

146

u/scottyLogJobs Sep 22 '20

I was like, its just white board code, I would obviously use getters in real life. And he was very upset about that.

Hilarious. Yeah, part of the software interviewing game is whether your interviewer is borderline Asperger's whose only goal is to prove they're the smartest person in the room, rather than a real person. I had someone literally tell me I was "stupid!" for leaving Amazon for a girl back in my home state (who I ended up marrying). Another guy who was clearly on Adderall who kept interrupting me and told me he had interviewed 100 people for this position. Wtf?

Have fun!

44

u/civildisobedient Sep 22 '20

Another guy who was clearly on Adderall who kept interrupting me and told me he had interviewed 100 people for this position. Wtf?

What a horrible existence. I can't imagine a full-time job just interviewing people day-in, day-out... the same questions. Candidate after candidate, some denied, some get hired to do Bigger and Better Things! But not Mr. Interviewer. No... for him, it is a life of thankless drudgery. YOU MISSED A SEMICOLON YOU SHOULD BE ASHAMED. All for the benefit of the company.

→ More replies (3)

39

u/Edward_Morbius Sep 22 '20

Another guy who was clearly on Adderall who kept interrupting me and told me he had interviewed 100 people for this position. Wtf?

30 years ago, I interviewed for a position at company. After several rounds of interviews, I was dropped. A few years later, I noticed that they were still interviewing for it.

10 years later. Still interviewing.

I retired a couple of years ago. They're still interviewing. I still get calls from recruiters. They stop when I explain that the company has been trying to fill the position for longer than the recruiter has been alive.

Not sure if they won't/can't hire anybody or can't keep anybody or what the deal is.

→ More replies (5)

8

u/_mkd_ Sep 22 '20

I had someone literally tell me I was "stupid!" for leaving Amazon

From what I've gathered of Amazon's culture, that's just the Stockholm Syndrome speaking.

7

u/Celebrinborn Sep 22 '20

"stupid!" for leaving Amazon for a girl

... Most people I know (on the programming side of Amazon, not the warehouse side which i know nothing about) say that you would be stupid to stay at Amazon...

→ More replies (1)
→ More replies (2)

33

u/Prod_Is_For_Testing Sep 22 '20

I had a remote whiteboard interview with google. We used google docs to share code. I was expected to get perfect, compilable syntax. On docs. It was the dumbest fucking thing. I failed it and at the end this fucking bozo told me to practice leetcode problems in notepad for my next interviews to be more prepared. What the hell does that possibly prepare you for, other than this ridiculous dick jerk?

10

u/DrunkMc Sep 22 '20

Exactly!!! You only need those skills for interviews and will never reflect your work. So dumb.

6

u/prussianapoleon Sep 23 '20

The thing I also hate about Google Docs is that it always auto capitalizes the start of the sentence so you have to work around it so it looks normal. And also the misspelled words underlining make it look so ugly when writing bunch of code.

→ More replies (3)

18

u/Attack_Bovines Sep 22 '20

I don’t fully agree with the process, either. However, I’d like to share my experience.

I work for a FAANG and interviewed at all of them in 2019, except 2. I was able to request a computer to write the actual code - but sometimes they asked me to use my own. They each had online editors that supported syntax highlighting, but nothing more. I only used the whiteboard for drawing. If I had to code in the whiteboard, I probably would’ve failed. The coding velocity in a familiar environment was key to my success (along with sheer luck getting problems I could do, having multiple offers causing FAANG to skip me through the pipeline, getting no interviewers having a shitty day, etc.)

6

u/lrem Sep 22 '20

Software interviews are broken indeed... But at least Google has been doing it on Chromebooks long enough that some of the interview units have died of old age.

4

u/GolfSucks Sep 22 '20

You should get a job at my last place. They seemed white boards "not aesthetically pleasing". They didn't have any.

3

u/ouiserboudreauxxx Sep 22 '20

That's how Google is and I've heard that they will take the code from the google doc or whiteboard and make sure it compiles after the interview. I had a phone screen with them and the interviewer said not to worry about syntax so I'm not sure if they do that for everyone. The recruiter had told me it needed to compile.

→ More replies (1)

3

u/eterevsky Sep 22 '20

What amazes me is that many candidates prefer whiteboard coding to coding on a computer. I performed multiple interviews where the candidates had a choice between an editor and a whiteboard and chose whiteboard.

→ More replies (1)

7

u/[deleted] Sep 22 '20

Fuck Amazon. The requirements they have for Frontend Engineers is wayyyy overkill.

→ More replies (5)
→ More replies (90)

93

u/hyperforce Sep 22 '20

What a load of non-predictive crap.

While I agree this is crap, I think the larger problem is the industry as a whole has not found a predictive method that also fits the constraints of the hiring org (time, money, etc).

Why aren't we spending more time on finding out what that is?

100

u/aoeudhtns Sep 22 '20

The way I also look at it: since we haven't found a predictive method, use the cheapest non-predictive method that gives you a minimum level of confidence. In other words, I use the traditional "tell me about your work experience" style and expand on things as we go, delving into rationale for technical decisions that they made and what they found easy vs challenging. Maybe throw a hypothetical based on something real from the team they're interviewing for and try to gauge their critical thinking ability. Etc.

In the absence of any work experience, then I quiz on retention from CS curriculum and try to gauge interest in the field. There's no career motivation like self motivation.

And of course, the candidate has to want to work for us, over somewhere else. I personally would bail out of these puzzle question interviews that have no bearing on the actual job.

99

u/[deleted] Sep 22 '20

One thing that I have started to do is to take a utility function from our codebase (something like a string parsing routine), obfuscate the variable names, then hand it to a candidate and ask what it does. This, IMHO, does a better job of testing what developers actually do (dig through code to add features or fix bugs) as opposed to what we like to think we do (use our brilliance to create the most fantastic software the world has ever seen).

→ More replies (11)

40

u/dnew Sep 22 '20

I've found fizz-buzz level questions absolutely essential if you expect the candidate to program. I'll start with the discussion like you say, then try to come up with either a simple programming task ("print all the primes less than 100") or some straightforward questions their experience should be able to answer (like "what's the difference between an inner and outer join" if they claim they have DBA experience). Otherwise, I tend to get BSed into believing the resume.

The real problem IME at Google is that the job you're doing has very little to do with these sorts of algorithms and much more to do with things like "how do you write a 2-million-line program that you can modify at random for five to ten years while never actually taking the server offline". That isn't something that this sort of algorithm question will handle.

→ More replies (31)
→ More replies (4)

7

u/[deleted] Sep 22 '20

Once a measure becomes a target it ceases to be a good measure. This problem will never be solved.

6

u/gaoshan Sep 22 '20

Our process is to pair review code that pertains to the work we do (so React, node, graphql, etc.) candidates walk us through the code base, explaining what is going on. We then spin it up and see what it does and how well this matches. Next they need to solve a fairly trivial problem with the code, then a less trivial problem, then difficult problem (and on this we are looking for problem solving... not completing it is by no means a deal breaker). Along the way there are a number of deliberately suboptimal things that the candidate has a chance to notice and call out if they wish. Combined with the rest of our process we end up with capable people that can do the work, are good learners and fit with our team vibe.

→ More replies (1)

15

u/chmod777 Sep 22 '20

We already have a predictive method: temp to hire or probationary periods.

The problem is that the industry wants people to be fungible and plugable. An instance fails, you bring a new instance online.

0

u/[deleted] Sep 22 '20

[deleted]

→ More replies (2)

3

u/[deleted] Sep 22 '20

Do they seem like a nice person and can they problem solve? That is 99% of it right there.

→ More replies (3)
→ More replies (15)

61

u/rexspook Sep 22 '20

yeah I just take myself out of consideration for these types of interviews. Just indicates poor hiring practices which is probably a sign of poor management. Not a place anyone should want to work for.

24

u/[deleted] Sep 22 '20

I yeet myself out

5

u/Ddlutz Sep 22 '20

Unfortunately, that rules out working at any top-tier compensation company (Google, FB, Amazon, etc).

If you know if any companies that are same or higher compensation that DON'T do leetcode algorithm interviews, share. But I doubt they exist, or exist in a high enough number that more than a handful of positions are available.

→ More replies (1)

40

u/gilels Sep 22 '20

I think the real purpose of these interviews is to avoid bad hires. Google gets a ton of applicants, so they can accept a large false negative rate (rejecting perfectly good candidates) in order to avoid bad hires.

16

u/ambientocclusion Sep 22 '20

Is there any proof they avoid bad hires? Not based on some people I’ve worked with who Google has hired.

13

u/badtux99 Sep 22 '20

This. We've had a number of former Google employees interview with us. None of them have been worth a bucket of warm spit. They were assigned tiny tasks to accomplish at Google, and if we ask them to solve anything big that requires originality or creativity, they're utterly lost. Now, Google *eventually* filtered them out of its system, but it shows that their hiring process hires plenty of bad engineers as well as rejecting many capable engineers. There has to be a better way, but everybody reflexively defends the way they're currently doing it, mostly because it's a filter to keep older / more expensive engineers out and thus reduce payroll and benefits costs.

→ More replies (1)

12

u/gilels Sep 22 '20

I don't think there is a foolproof way to completely eliminate bad hires, but I do think this reduces the number of bad hires. I also think this way of interviewing rejects many perfectly capable engineers, but companies like Google can afford to do that.

→ More replies (1)

38

u/znupi Sep 22 '20

I work at one of the big tech companies and there is a clear correlation between strong performance in the coding interview and long term performance on the job.

I run these types of interviews too and the point is never to feel smart. I root for every candidate I interview.

11

u/Nall-ohki Sep 22 '20

Multiple upvotes. I want my interviewees to do well.

→ More replies (4)

21

u/jasondclinton Sep 22 '20

I'm a Googler who does interviews and has served on hiring committee. If I saw this question in the candidate's packet, I would mostly discount its findings. The interview question is not how we are supposed to be running interviews.

3

u/WhiteshooZ Sep 23 '20

Specifically, what is wrong with question?

→ More replies (3)

17

u/tharinock Sep 22 '20

The best interview I had was just a discussion about the programming language I was expected to work with. We talked about the features planned in the next big release, what parts of the language I liked and didn't like, and my opinions on what good code in the language looks like. That's the kind of interview that's relevant, and you can't really BS.

43

u/Nall-ohki Sep 22 '20

Maybe relevant, but totally easy to BS, and tells me nothing about your ability to produce code.

12

u/joahw Sep 22 '20

I worked with a guy that loved to talk about new features in programming languages. He'd come in on Monday and love to tell you about some new blog post from Microsoft announcing the new version of C# and what is good and bad about it.

The trouble is talking to people about that stuff was basically all he did. He'd BS about contributing to some ML github project in his spare time but there was always some major slippage when the rubber met the road on actual work.

3

u/professor_jeffjeff Sep 23 '20

I've asked this question before or a very similar one which is "I'm about to switch to <language> next week, what would you say is super important for me to know?" where <language> is what they say their favorite language is. Usually leads to a discussion that teaches me a lot more about their abilities than anything else, especially for more junior candidates. For candidates with any level of experience, I only ever usually ask one questions which is "What do you consider to be good code?" and then we go from there. I have some points that I at least want them to mention, but this tells me how they think and how they're likely to attack problems in their job much more so than whiteboarding some bullshit that they'll never use.

3

u/eterevsky Sep 22 '20

Can you think of any other format of a 45-minute interview that would be more predictive? I'm genuinely interested.

12

u/jl2352 Sep 22 '20

I agree, and really hate this type of puzzle masturbation.

Where I work we have had a lot of success with finding these problems within our own product. Using that as the basis. Rather than a hypothetical. For example we have a feature which underneath is basically a graph. It requires walking the graph, checking for cyclic routes (to avoid infinite loops), and so on.

We don't ask about graphs. We ask how they would build the feature. If they use graphs, awesome. If they come up with something better, amazing. If they come up with something poor, then we know they would have implemented a real feature in our product poorly. It'a a no.

Interviewees have given excellent feedback citing that they liked how the problems were real problems. They weren't bullshit. They didn't feel like their time was wasted.

4

u/itsgreater9000 Sep 22 '20

Isn't this assuming stuff about the codebase though? You say that underneath it is basically a graph - does this include the time it took to build up the knowledge of which data structure to use (since it seems like it is "basically" a graph), and the engineering discussions that went on which I assume were not as high pressure as in an interview?

From my experience, I see clever solutions that exist most frequently have evolved over time as more of the information necessary became apparent, and stuff had to be hacked on to make something "look" similar to some existing data structure. For example, at work we were given one set of specs for initial development which did not make it clear we were doing a directory style implementation of something, so the data structure was effectively a matrix (list of lists style) during the initial set of work. As more information unfolded we realized we needed to implement a tree like structure that mimicked a directory. Since we didn't have the time to rewrite the core of the code, we had to hack on the kind of stuff you would find in a typical application that knows about it being a tree, for example finding the leaf nodes (files) and recursing up and finding metadata about objects in the "path". Obviously the solution is not at all optimal, but given that it's a tool that is seeing minor use at best, we decided it was more advantageous to put effort into other stuff and quickly hack on solutions for what we needed.

I mainly ask because the insight needed to come up with this was only apparent when all the requirements were in - before, when the requirements were not clearly defined we had to go and implement whatever made sense. The result is that if I were to interview someone with that, I'd have to make sure it was pretty clear what was happening about the underlying data, otherwise I would risk losing out on the knowledge that developed during the project which eventually created a tree-"like" structure.

To me, this makes these types of situations substandard for doing interview questions (exception being when all the requirements are known), since there is so little time to stew on the idea that probably happens when doing work.

→ More replies (1)

5

u/capt_barnacles Sep 23 '20

You have no evidence that it's non-predictive. On the other hand, we know Google:

  1. Does many thousands of interviews a year

  2. Is data driven in almost everything they do

  3. Has a history of making changes to their interview process based on data.

So... We should just go with random internet person's hunch.

7

u/GhostBond Sep 22 '20 edited Sep 22 '20

But at least it makes the interviewer feel smart, which must be the point.

Someone at google actually admitted this a while back:
https://www.journeyfront.com/blog/googles-interview-questions-were-all-wrong.-how-are-yours-doing
"We found that brainteasers are a complete waste of time," Laszlo Bock, senior vice president of people operations at Google, told the New York Times. "They don’t predict anything. They serve primarily to make the interviewer feel smart.

As mentioned before, Google found zero correlation between how well a candidates scored on brain teaser questions and how well they performed in their job.

The actual problem seems to be that:

  • They don't have a better way.

  • It's automated and easy for hr - which is not inconsequential, try to imagine how many applications they get, and how you'd burn people out doing 16 interviews a day all year.

  • They have a huge number of applicants, because of their large salaries and huge name, so it doesn't matter if they throw out 80% of good candidates.

  • The fact that others try to cargo-cult whatever they do is actually a plus for them - their competitors are left fighting over the scraps of what's left, while also rejecting the 80% of good candidates who just aren't good leetcoders.

13

u/MaraEmerald Sep 22 '20

This is not a brain teaser. Brain teasers are like I’ve got 8 matches, how can I place them to form a square and 4 triangles.

→ More replies (2)

3

u/capt_barnacles Sep 23 '20

And that's why they stopped doing brain teasers. The measured and adapted. If you're going to say this kind of interview is "non-predictive" you're going to have to show me some data. Because I'm confident Google wouldn't continue doing it without data showing it works.

2

u/International_Cell_3 Sep 23 '20

It predicts you'll work your butt off on a specific task that requires research and practice. There's the added benefit (for google) that these jobs siphon off a large and talented segment of the labor force that would be working for someone else.

You're kidding yourself if you don't think the most data driven company in the world that hires thousands of people every year keeps doing this because there isn't data to suggest it helps the company.

2

u/MiniGiantSpaceHams Sep 23 '20

The point of these is not to see if you're smart enough to complete it perfectly under pressure, it is to give you something complicated to think about and see how you think and work towards a solution. No one is going to be solving this exact problem at work, but you will see complex problems and this lets the interviewers know that you can handle that and reason through it. In that sense it's pretty predictive if interpreted correctly, which is why you'll get several of these from different people.

2

u/[deleted] Sep 23 '20

This thread is so refreshing

→ More replies (7)

285

u/decimated_napkin Sep 22 '20

I firmly believe algorithmic programming interviews are being used as a proxy for an IQ test. Bottom line is companies dont care about getting the best candidate, they just want to make sure the candidate they do hire is good enough. By giving them questions that have to be studied on leetcode for a few months, you are essentially locking in a certain baseline intelligence and logical ability. For companies like Google this approach may be practical, but when a whole industry does this it just ends up being toxic in the long run.

263

u/[deleted] Sep 22 '20

I have a different take. Regurgitating solutions isn't as much an IQ test as a test of how much prep you've done. By giving tests requiring this much studying, the companies aren't testing IQ as much as willingness to put the time into preparation. They are, in effect, selecting for young and single developers who will be more willing to put in extra hours at work. Devs with a family are going to go home at the end of the day, and employers can use these tests as a fig leaf to filter them out.

61

u/AnalyticalAlpaca Sep 22 '20

I have a different take. Regurgitating solutions isn't as much an IQ test as a test of how much prep you've done.

100% this. When I was searching for a new job awhile back, I did so-so in the earlier interviews because I did basically 0 prep. As I continued to interview I learned the answers to more potential questions so I seemed a far better candidate, while in reality I had the exact same skills as the early interviews.

17

u/[deleted] Sep 22 '20

For the first couple interviews, I always pick my less desirable companies to get some practice.

66

u/decimated_napkin Sep 22 '20

I think it is probably both, can definitely see this side of it as well.

31

u/[deleted] Sep 22 '20

Also laziness. Why spend time coming up with something good and wasting HR man hours, when you can just copy what Google does?

→ More replies (1)

9

u/ichiruto70 Sep 22 '20

Eh kinda. A lot of people grind leetcode for years and still don’t get in. You still have to be smart to actually understand algo’s and why you would apply them.

9

u/[deleted] Sep 22 '20

True. These tests will filter out almost all poor coders. My point is that the tests will also filter out a lot of good coders who won't take the extra time to study the algorithms. This is fine with the employers, because that will tend to give them a young single workforce willing to put in long nights.

15

u/badtux99 Sep 22 '20

This. Age discrimination is illegal, but HR departments have figured out that they can do sideways age discrimination of this type to filter out older people and people with families (people who will cost more in terms of salary and benefits) and thus encourage it. Note that this isn't relevant to actual job performance -- in fact, there's actually a postive correlation between age and job performance (i.e., older applications generally perform better than younger applicants in the actual job), but that's not what HR is interested in. They're interested in reducing payroll costs. And they encourage practices on the part of hiring managers that will reduce payroll costs.

3

u/chaosatom Sep 23 '20

i agree with napkin and zxcv. pure leetcoding makes sense for college grad, but they have to incorporate different strategies for experienced ppl.

3

u/Otis_Inf Sep 23 '20

That suggests working somewhere is a privilege, while working somewhere is just fulfilling a 2-way contract. It's not a privilege to work somewhere, you just do what's in the contract and the employer does what's in the contract. If an interviewee has to put a lot of work in prep, the interviewer has to do that too. They have to make sure the interview represents what the interviewee will face during work. That's the thing here that's often overlooked: the interview is as much about finding out whether the candidate is good enough for the company as it is for the candidate to find out whether the company & job are what the candidate wants.

That's what annoys me so much about these puzzle based interviews: they totally ignore whether the candidate actually will like the job.

The only good interview is one where the candidate has to do a task of the job they have to do, and the interviewer(s) help the candidate like a co-worker would. that way the candidate learns if they like the job or not and the interviewers learn if this candidate is fit for the tasks they will do (which is never coding on a fucking whiteboard ffs)

→ More replies (5)

15

u/[deleted] Sep 22 '20

As someone who has given lots of interviews, you'd be surprised how many people can answer these questions but can't write a method signature.

Really quite shocking. To that point though, interviewing is hard.

→ More replies (3)

5

u/eterevsky Sep 22 '20 edited Sep 22 '20

It's 50% a proxy to an IQ test, and 50% a sanity check for candidate's ability to turn a relatively simple algorithm into code.

15

u/KrypticAndroid Sep 22 '20

So what’s better?

81

u/serviscope_minor Sep 22 '20

So what’s better?

One of my favorite interview questions has at it's core an algorithm, but a simple one, and we start off with a quick discussion of the problem and how they might solve it. There's not a lot of choices on the algorithm because as I mentioned it's simple. This is mostly preamble so they have a mental framework for the next bit.

Then, we present them with some code which already implements it, except it's awful code, and has some bugs. Their goal is to refactor the code and make it clean. So they have to read and understand it, map it onto their understanding of the algorithm and make fixes. Many of the fixes are simple and can be done point-wise without fully understanding the code.

It's much more akin to day to day work of a software engineer. There's no trick to know or leap to make, it's just crappy code which needs fixing. It's telling for example if the candidates try to wing it, or add some basic tests, and whether their idea of "production code" is a profusion of classes.

18

u/[deleted] Sep 22 '20

I definitely agree that simple algorithms are better. Interviewers massively underestimate how hard something is when you don't already know the answer and have to come up with it on the fly. We "implement atoi" which seems to work quite well.

I like your refactoring idea - might steal it for the future. Although I did do one interview where they got me to write some code, and the feedback was that I didn't write enough tests. They didn't ask me to write any tests! So I think it does run the slight risk of candidates not knowing exactly what you want. I'll give it a go though!

→ More replies (4)

15

u/decimated_napkin Sep 22 '20

This is a much better method in my estimation.

→ More replies (3)

25

u/wy35 Sep 22 '20

I've heard Stripe does code pairs where you and the interviewer work together to fix a bug or implement a simple feature.

→ More replies (11)

12

u/LUV_2_BEAT_MY_MEAT Sep 22 '20

My company has you write a small simple program like fizzbuzz, then has you make changes/enhancements to it. For an example we might ask a junior dev:

  • Implement fizzbuzz

  • Now we need it to handle numbers 1 - 200

  • Now we need it to print "foo" on %7==0 and "bar" on %9==0

  • Now we also want to want to output not only to standard output but also to another interface

  • Now it reads the input number array from an HTTP get

Or whatever. The difficulty scales to experince level. I like this because thats what you'll do at your job - negotiate requirements, write code and maintain it. You'll get a feel at how good they are at writing maintainable code, as well as their views on testing/refactoring. We let them bring their own computers and do it in the own language/IDE if they want. We'd even let them google stuff if they asked.

11

u/nokoko Sep 22 '20

What would you do if you received 2k resumes per day, every day selected the best 100 to take your test and 90% of the candidates pass it with a perfect result? Who do you hire at the end of the month?

→ More replies (4)
→ More replies (4)
→ More replies (8)

5

u/HandsomeBronzillian Sep 22 '20

That's something that people overlook.

Anyone can copy a code from stackoverflow. You want people in your company who are able to come up with new solutions and who can react to a new situation.

I'd much rather have an employee with 3 years experience, but with a good critical and logical thinking capability than an employee with 15 years experience with an average one.

But of course, as you stated, those tests are ok granted you are paying people enough to endure such a long and tedious process.

Just think of how many hours one has to prepare for this kind of test, the expectations, anxiety and the opportunities he has to give up on just to be able to attend to your long job interview process.

Now imagine doing all that for a 3k$ monthly wage. That would be horrible.

But it is ok for google because the benefit out weights the risk and effort to participate in this long process.

→ More replies (13)

22

u/Declan_McManus Sep 22 '20

Seems like a long way to say "naive recursive solution << memoized recursive solution << dynamic programming solution".

I've run into a real-world instance of a problem worthy of dynamic programming all of one time in my five years of full time experience. Interestingly, using a poor algorithm was half of the problem, but the other half of the problem was the fact that we had a web UI waiting behind a spinner for the algo solution, recomputing on every page load with no caching or precalculating the result.

The majority of our 'solution' to the problem was splitting the page's one network call into two- one without the hard algo that loaded quickly and made 95% of the page operational, and one with the hard algo that took longer but didn't block the user from the rest of the page.

→ More replies (1)

21

u/[deleted] Sep 22 '20

For anyone interested, this site lists companies that whiteboard, and companies that don't, along with their city location (worldwide)

http://they.whiteboarded.me/companies-that-dont-whiteboard.html

33

u/feverzsj Sep 22 '20

well, you know it's fucked up, when there are tons of companies specialized in algorithm puzzle training. A ten billion dollar market exists just to make you suffer.

→ More replies (1)

229

u/za4h Sep 22 '20

"Here are some behind-the-scenes look at our process that hasn't worked for at least a decade, possibly never. Now startups can copy our deeply flawed system! Enjoy cramming for months next time you interview." -Google

50

u/IMovedYourCheese Sep 22 '20

For an interview process that has supposedly never worked, Google as a company has done pretty well over the last decade.

12

u/finrist Sep 22 '20

Sometimes I think Reddit fails to realize that an interview process often is not a pass/fail process but rather just input to when comparing candidates.

6

u/i_post_things Sep 23 '20

As far as I know, Google HC doesn't compare candidates with each other. The hiring committee doesn't do team matching so they can't quantititatively say that one candidate may or may not be better than another for any particular position. It's not like they know "well we need to hire 5 candidates by the end of the week" and pick the top 5 scores.

A number of packets go to committee, each member grades it each packet, then they meet up to review the packets one at a time, arriving at a decision.

→ More replies (1)

39

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

As all companies with flawed interview processes have. They succeed because they have a good business and this stuff is just a relatively small tax on a tiny part of their cost.

If they replaced this with a 15 minute test of random tech trivia and some dice throwing the cost savings wouldn't show up on their balance sheet at all.

It's all about incentives: it's super easy to add hurdles in the process, but if you remove them and even one bad hire slips through then you are to blame (even though the stricter system wouldn't have caught them!). This is how we as a society keep building Azkaban over and over and over.

→ More replies (26)

13

u/Whisperecean Sep 22 '20

Except 90% of their revenue comes from ads.

That's like arguing Boiron is a high tech biotech company.

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

14

u/Flexy_s Sep 22 '20

A few months ago I was asked to be part of the interview process for new programmers at my company. I noticed after the first few interviews that we ask them questions which aren't representative of their day-to-day job if we employ them, so I...... refactored those questions and testsamples.

Now we actually test for the things we actually hire for, which is a much better experience for everyone involved. I don't give a damn if someone can write complex algorithms by hand on a whiteboard. We're developing enterprise applications and not rockets.

7

u/hardolaf Sep 23 '20

Rocket control software prefers even simpler algorithms...

191

u/ichunddu9 Sep 22 '20

37

u/GhostBond Sep 22 '20

And he happens to mention what really happened in the blog post itself:

...This was the first problem I used during my interviewing career, and it was also the first to leak and get banned...

In reality it got "leaked" way way before he was aware of it. He was simply patting himself on the back about hiring people who had practiced the problem before the interview while pretending it was the first time they saw it.

4

u/BlueLionOctober Sep 23 '20

It's really easy to spot who the people that have already seen a problem are.

→ More replies (4)
→ More replies (15)

48

u/Sleakes Sep 22 '20

Like I appreciate the insights into the thought process around figuring out something for the first time, but realistically how does this in any way translate to actual ability to ship a functional product. I guess I tend to take the view that software engineering is more about knowing how to piece together the tools and blocks you're given not creating new blocks from scratch. How often does someone actually need to re-implement something functionally close to a problem like this?

28

u/GhostBond Sep 22 '20

They don't, and it doesn't.

Main advantage is that it's autograding and easy to administer, for a company that gets a bazillion applicants.

7

u/dmazzoni Sep 23 '20

At FAANG this sort of thing comes up all of the time.

Angular was invented at Google. React was invented at Facebook.

Facebook had a million lines of PHP code and it was too slow, so they wrote a PHP compiler.

Google couldn't find a revision control system large enough for all of their code so they wrote their own.

That's the type of person they want to hire.

4

u/moosetruth Sep 23 '20

I work at FAANG and I have, a few times, done work that reminds me of interview questions. It’s mostly about hey, I’ve got a petabyte of data here, I should probably consider time and space complexity in how I process it. That said, the 100ish hours I spent studying and the 6 whiteboard interviews was probably overkill to test whether I know how to think this way.

→ More replies (1)

83

u/[deleted] Sep 22 '20 edited Sep 23 '20

He might have as well asked me to play a game of chess with him. He'd know about my real world programming skills by the end of it just as good as if I was doing that knight hopping on the number pad problem.

6

u/FUZxxl Sep 23 '20

Actually, this knight-hopping problem is a fairly good model problem to assess real world algorithms skills. There are multiple solutions using various standard approaches. You can learn a lot about the candidate by seeing how he approaches the problem.

5

u/skeeto Sep 23 '20

I completely agree. Every time these big interview threads come up, the overwhelming consensus is that these intermediate-level programming problems are somehow irrelevant, or that they require some sort of special study. What are you people doing that algorithmic issues never come up? I bet they do, and that they're usually just solved poorly, which would explain a lot. I have two simultaneous reactions to these threads:

  • I'm disheartened that the industry is in such a state that this kind of challenge is considered difficult. Is this why software quality has plummeted? I would never hire anyone who couldn't at minimum reach the recursive solution quickly on their own. When prompted to make their solution efficient for a larger number of hops, I'd seriously hesitate to hire anyone who couldn't work out a solution that completed in a reasonable time, whether it's dynamic programming, memoization, or something else.

  • It boosts my personal confidence since, if this is my competition, I will never have trouble job hunting. More than that, r/programming naturally selects for programming enthusiasts — who else would participate in a discussion forum? — so the people here are generally above average, and even these above average people struggle with intermediate-level problems.

→ More replies (2)
→ More replies (3)

45

u/freework Sep 22 '20

The major problem I have with these kinds of interviews is the issue of motivation. All of the time I'm working on programming problems in my everyday life, I have sufficient motivation to do it. Whether it be finishing a personal project so I can have the thing I want to build, or to earn a paycheck, there is always motivation to keep me going. When I'm faced with these terrible unsatisfying interview problems, my first thought is always "who cares". The "problem" seems very hard to solve, and with absolutely no payoff. I'm very certain that if I'm properly motivated to come up with the perfect solution, I will come up with a solution, no doubt. If I ask the interviewer "what do I get if I solve it", the answer is always "absolutely nothing". I can't tell you how many times I've spend 45+ minutes working on complex interview problems like this to only be ghosted in the end. If the company told me that they would 100% give me a job offer if I complete the puzzle, that would help immensely, but they never do that. At best, a 100% correct answer only gives you the chance of getting a job offer. Basically a lottery ticket for a job. That's not enough.

3

u/sudosussudio Sep 23 '20

Yeah how much more salary can I get by doing these interviews? Ever since I became a senior dev I’ve turned them down. I’ve worked with ex Googlers who make as much as I do. The real value for working at Google is networking but you can do that on your own if you’re good enough at it.

5

u/ouiserboudreauxxx Sep 22 '20

This is my problem too, and I could also find motivation I were definitely getting a job.

I think some graph problems are interesting, but that's pretty much it. The other leetcode type problems make my brain glaze over. Just seems like such a waste of time.

For all of that work, at Google you could pass all of their leetcode interviews but not pass the hiring committee or get matched to a team. I would be so mad if I passed the technical part but didn't get hired.

→ More replies (7)

11

u/srini10000 Sep 22 '20

It's no coincidence his name is an anagram for algo excelc

127

u/chucker23n Sep 22 '20

This was the first problem I used during my interviewing career, and it was also the first to leak and get banned. I like it because it hits number of sweet spots:

  • It’s easy to state and understand.

  • It has a number of solutions, each requiring varying degrees of algorithms and data structures knowledge. Also, a little bit of insight goes a long way.

  • Each solution can be implemented in relatively few lines, making it perfect for a time-constrained environment.

  • It has fuck-all to do with a software development job.

  • It serves mainly to make you feel smart and me feel dumb. What a lovely way to start a professional relationship.

  • It tells you nothing about my skills, because, hey, did I mention it has nothing to do with how software development works?

28

u/GhostBond Sep 22 '20

Also when he says this:

This was the first problem I used during my interviewing career, and it was also the first to leak and get banned.

What's really happening here is that his repetitive question quickly leaked, then the people he was passing were the people who it had been leaked to. Eventually someone caught on and banned it, but way after people had been practicing it for a while.

4

u/sudosussudio Sep 23 '20

Reminds me of when I worked in hardware and it seemed accepted practice that everyone got illegal data dumps of cert questions and just memorized them. Fortunately there are a couple of certs like CCIE where they take you to a lab and make you solve actual problems but those are expensive to take and administer.

→ More replies (1)
→ More replies (3)

4

u/This-Moment Sep 23 '20
  • It serves mainly to make you feel smart and me feel dumb. What a lovely way to start a professional relationship.

Exactly. I actually once had to weigh in on a hiring choice for a guy I had 10 years previously interviewed to work for. The interview was those goofy questions, and the guy came across as kind of an ass about it.

So my feedback was "I only met him once and he came across as kind of an ass."

We didn't hire the guy. I'm sure he has no idea why.

Makes me wonder how many jobs he's missed because he didn't know not to spit into the wind. How many other devs did he make a lousy impression on over the years.

But I learned something important, and I like to think there's a lot of former junior devs out there that will hire me in a heartbeat someday when the "boss" shoe is on the other foot!

3

u/game_dev_dude Sep 23 '20

I feel like I'm taking crazy pills. If you're expecting everyone to reach Level 4 for a standard web-dev job, sure that's stupid. But I don't understand the overall disdain for this problem.

I'd expect most people to be able to figure out Level 0, Level 1, maybe Level 2. It's a small recursive function, not some crazy algorithm you'd need to have studied in the past. Seems like a fair way to figure out if someone can actually analyze a problem and write code to solve it, basically a slightly more advanced FizzBuzz.

65

u/DuneBug Sep 22 '20

"Our interview questions are crap, but they were the best we could come up with." - should be the first line of every blog post. No you're not clever, no your question's not brilliant except that it was leaked.

As usual, this particular question doesn't seem very clever to me. The knight movement is a red herring to obfuscate the graph and unnecessarily complicates the question. A lot of people haven't played chess, and coding knight movement on a game board is actually non-trivial. I'm sure figuring out it's a graph problem is half the battle, but IS it? Are you going to hire anyone just because they deconstruct the dialpad into a graph? No. You want to see the traversal. BTW the #5 can never be hit.

The author even acknowledges this by accident. I'm sure after half the candidates wasting 1/3 the interview implementing a solution to knight movement, he offers "what if you just implemented that later"? I know that, because I have done the same thing when I was asking dumb questions.

The next is the question doesn't actually want an algorithm, it's asking for a mathematical calculation. This isn't testing your programming skills, it's about math. Not every coder is great at math, but a lot of mathematicians can write code. Are you looking for a math guy that's done some coding? If so, good test.

/rant

15

u/clappedhams Sep 23 '20

He said in a previous post that he has dual Bachelors in Math and CS.

I'll never forget the time that a company sent me "coding homework" that had four problems like this that I had to solve in under 5 hours and my answers were being checked for efficiency and run time.

That was just to get an interview. For an internship. In fucking Pittsburgh.

10

u/[deleted] Sep 22 '20

I had an interview with a large company recently for a C++ development job. It ended with a test that took 6 hours, and only when I started the test was I told I was not allowed to use any C++ containers. I was told the time complexity had to be strictly less than O(n*n), and I could not copy any code.

Of course, the problem was one that was solvable in O(n) using an unordered set.

Sort of an odd thing to test: can I solve the problem(which I did) and also either implement a hash table or a self balancing BST in time?

I didn't want to copy any implementations of those(although honestly in retrospect thats probably what most people do), but making one from memory is pretty much just memorization.

So, I'm not quite sure what they were testing? Can you copy solutions without being cought, or did you happen to memorize how to make a balancing BST or hash table?

10

u/Edward_Morbius Sep 22 '20

So the elephant in the room is that "What's the attraction to working at Google?"

From everything I've heard it just "working at another giant company doing your little thing" and the people who get to do the really cool stuff are a tiny minority.

I've worked for large and small companies, and while the small companies don't usually have tons of money, the opportunities to build cool stuff are everywhere, while the big companies are likely to hand you some legacy disaster and say "This has to work. It's yours now".

0

u/[deleted] Sep 22 '20

[deleted]

→ More replies (7)

19

u/dottybotty Sep 22 '20

Phew I was feeling a little destroyed after reading that but coming back to the comments and seeing a lot of other also found it difficult makes me feel better haha. Obviously Google has a crazy high standard. There is definitely some positive takeaways from that even if it seems pretty intense for job interview.

2

u/sudosussudio Sep 23 '20

If you practiced daily you’d be able to do these. I used to just because I was insecure about my skills. I’d do 10-40 minutes a day on codewars. I stopped because I realized I was senior enough I could turn down these type of interviews and still get jobs.

→ More replies (8)

8

u/norad2 Sep 23 '20

As a mid level software engineer who doesn’t code at all in his free time, was laid off due to covid, and is in the throes of interview hell, this thread makes me feel so much better about my skills. It gives me confidence because I AM good at finding out the answers software engineering questions I don’t know, but implementing a depth first search in an interview setting....might as well just end the interview right there. It’s tough out there.

74

u/ncsuwolf Sep 22 '20

Google interviews are bullshit. They asked me a bunch of nonsense trivia that never would have come up on the job.

0

u/[deleted] Sep 22 '20

[deleted]

57

u/ncsuwolf Sep 22 '20

They kept asking me about zombie processes clearly looking for some textbook definition I had long forgotten and could easily look up if it ever mattered. Another was asking me to reinvent some obscure algorithm where I knew the answer was recursion and spend thirty minutes getting the initial step right and maybe look it up to make sure I didn't forget the "obvious" optimizations. None of which I can easily convey via telephone and google doc. That was the worst part. C-w closes the damn browser window but I use emacs to program where it is akin to copy. I have a fancy degree and references that will confirm I can show up on time and dance like a monkey. The job at google is the same bullshit as anywhere, you can't capture genius in a bottle. I went to college to program super computers to simulate supernovae and people act like I'm going to bring the same furvor to hocking crapware just because they pay me more than my professors.

→ More replies (3)

9

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

They made me solve a programming problem using a Google doc and then antagonized me for using language specific solutions to solve a contrived problem for stack management

→ More replies (2)
→ More replies (1)
→ More replies (7)

32

u/TheTrueDarkKnight Sep 22 '20

I've been designing systems for over 3 decades and never, in all my time, have I felt the need to ask such ridiculous questions. This whole series of articles and interview mindset amounts to nothing more than zero-value mental masturbation.

Makes me feel sorry for anyone who has to interview with anyone the likes of the OP.

26

u/drtasty Sep 22 '20

I've actually asked this problem a few times before (yes, feel free to yell at me) and have since asked a heavily modified version that I think is much more fair. In my experience there are multiple flaws in the question beyond the ones being discussed in this thread:

  • It suffers from the same problem that the SAT has: The domain of the problem statement itself. I find that lots of my coworkers have no idea how chess is played -- nor should they be expected to -- and explaining the movement of a knight is non-trivial. In an interview, that's valuable time wasted that a different candidate doesn't have.

  • The number one thing most candidates try to do immediately is attempt to traverse the keypad as a 2D array. To not explicitly specify that the board shape is completely irrelevant in the problem statement is, IMO, misleading.

  • The number of different optimizations listed and the expectation that a candidate would identify (and potentially code) them all is laughably ridiculous. I've had a single candidate even mention level 4, much less implement it. And that is with skipping Level 1, which most candidates do. There just isn't enough time if you care about also discussing things like testing, complexity, and metrics. These are FAANG candidates as well.

However, with the right modifications (and living in the world where I have to ask Leetcode questions), I will go against the grain and say I think it's a good question. Lose the dumb expectations of the candidate miraculously figuring out the "tricks" on their own (I'm here to help, not watch), and you end up with an analysis that reveals:

  • Can the candidate code? Do they grok interface design? Can they iterate and improve? (Side note: The memoization optimization is nice because it's additive. There's nothing worse than writing a brute force solution and then tearing it all back down.)

  • Does the candidate understand recursion and traversal?

  • Does the candidate know how to use common data structures like hash maps, and understand the tree structure of the call stack?

  • It's easy to frame this as a "service" and ask questions about testing and monitoring.

  • All of the intangibles, like communication, code structure, problem approach, etc.

→ More replies (3)

13

u/rightsofman Sep 22 '20

The knight dialer is a great example of all that is wrong with these kinds of interviews. It encapsulates the misconception that interviewee skill and understanding of Computer Science is directly proportional to how recently they graduated and thus inversely proportional to how much experience they have in the professional world. Who would disagree that this problem relates very little to the real world? Why would a professional continue to think like this? They don't and they shouldn't. It could, and I claim frequently is, the case that folks that once were great with these academic exercises are no longer so good at them because they have moved on to solving harder and more interesting problems. Academic problems are nice for - academic situations. To focus on narrow thought processes. In my experience questions like this are only given by young inexperienced folks Especially only folks with bachelor degrees.

16

u/drsimonz Sep 22 '20

I don't get why people are so upset about these interviewing practices. If you don't like it, don't apply to work at celebrity companies. It's like trying to break into acting....literally millions of other idiots are competing for the same slot, so you have to be willing to sacrifice everything, including your dignity, to be competitive.

So Google likes asking algorithm questions? Amazon has a reputation for being high-pressure? Well fuck if I'm ever going to apply there! I'd rather get paid slightly less (which is still way more than most industries) to work on the same problems at a more reasonable pace, and not have to memorize bullshit trivia. Which you can do by working at literally any other software company.

→ More replies (1)

4

u/teerre Sep 22 '20

I would accept “let’s assume there’s a function that gives me the neighbors” along with the following stub.

That's the first I hear something like this. I wonder is this is common.

3

u/sabas123 Sep 22 '20

Most likely. Basically if anything is an trivial thought and is known to be most likely trivial to implement then people have no problem accepting it.

→ More replies (2)

4

u/trumpisbadperson Sep 23 '20

I am Google engineer and honestly, I don't know if I would have answered this question well. But the blog post is great. Detailed and clear. The interviewing paradigm at Google, however, is insane.

11

u/dnew Sep 22 '20

The real problem IME at Google is that the job you're doing has very little to do with these sorts of algorithms and much more to do with things like "how do you write a 2-million-line program that you can modify at random for five to ten years, importing third-party data and keeping up with changing business requirements, while never actually taking the server offline or expecting clients to promptly or synchronously update their usage". That isn't something that this sort of algorithm question will handle.

→ More replies (6)

8

u/oldsoul-oldbody Sep 23 '20

I had an interview where they asked super technical questions, at length. Fed up, I ended up saying, "I appreciate what you're trying to do with this line of questioning, but my strength is problem solving and project management. If you're looking for rote memorization, I'm probably not the candidate you want." I left the interview shortly after that. I got a call back from them, but had a better offer elsewhere.

Now that I'm a senior level developer, I remember nothing, Google everything, when it comes to code. I have too many projects on too many platforms using too many languages and frameworks on my plate to keep syntax in my head.

3

u/schlenk Sep 22 '20

There should be a closed form solution that runs in constant time. After all, the graph is quite small and fully deterministic, so there must be a repeating pattern once the phase space loops back to a starting position you already know. Once you found the period size for each starting point, a lookup table would work. Might be too memory heavy in the worst case though.

→ More replies (1)

3

u/CJKay93 Sep 22 '20

What a state this field is in when this is necessary.

3

u/vplatt Sep 23 '20

It's not necessary. Most companies function perfectly well without this kind of silliness.

3

u/thilehoffer Sep 23 '20

As a Software Development Manager who is responsible for hiring developers, I would only use tests like that if I was hiring someone to work on complicated algorithms. For most development those questions are useless.

23

u/_iuh Sep 22 '20

we shouldn’t be too hard on the blog writer. they’re just trying to help potential candidates get through the interviews. ie - blame the game not the player.

20

u/ymek Sep 22 '20

They’re the proctor, the candidate is the player. So, yeah, I’ll blame the person making the interview questions because it’s literally their call.

→ More replies (2)

0

u/[deleted] Sep 22 '20

[deleted]

→ More replies (2)

5

u/jewnicorn27 Sep 22 '20

It is just a pseudo test for intelligence, and or how much practice/effort you're prepared to put in to getting the job.

I knew a guy at uni who was somehow studying recruiting, specifically psychometric tests. I asked why they bothered, if you could just practice for them, and said "why wouldn't you want to consider someone who cared that much about your interview". I guess that's a fair answer.

Interview process would ideally find the best candidate, but that isn't really what happens. It's really to try find someone capable of doing the job. If you happen to lose some great candidates, in exchange for getting someone suitable more often. That can be viewed as a good thing.

→ More replies (10)

4

u/LUV_2_BEAT_MY_MEAT Sep 22 '20

I don't really have a problem with asking DS/A questions in interviews but the stock that big N companies hold them to is insane. Its seems like 95% of if you get the job is how you do in these questions.

→ More replies (3)

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.

→ More replies (1)

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.

→ More replies (7)

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.

→ More replies (1)
→ More replies (2)

2

u/UnseenData Sep 23 '20

Interesting. Thanks for the share!

2

u/orlyfactor Sep 23 '20

The one interview I had at Google was a disaster. The guy on the phone kept asking me how I would improve the Collection APIs in Java, specifically ArrayList. I went through some ideas and not knowing how Oracle actually implemented it I gave some rationale, etc. but NO, it wasn’t good enough and the guy kept asking the same question over and over. I asked him if he was familiar with the term “blood from a stone” and explained I was the stone and he would never get whatever answer he was looking for (it honestly went on for about a half hour). Worst interviewer I have ever experienced in my life and I let their HR know but they didn’t care.

→ More replies (1)

2

u/mkygd Sep 23 '20

Interesting thanks!

2

u/Kazaan Sep 22 '20

I'm probably too noob to understand, I only code since 20 years but sorry, I don't see in what this test validate if a developer fits a position.

IMHO, after a soft skills interview, some theory questions to check if the candidate know the basic, a few "real life" coding to see if he/she can put the theory in practice, maybe some puzzle coding to see the way of thinking is more than enough.

They are recruiting like trial periods don't exist.

2

u/GolfSucks Sep 22 '20

The thing I don't understand about this knight question is that there's a simple, constant-time solution. Just build a lookup table. The search space is so small that it might fit in a single screen.

5

u/SJC_hacker Sep 23 '20

They did build a lookup table for neighbors of a given digit. You can't use a lookup table for the entire solution because the length of the number is unbounded.

→ More replies (1)

2

u/lance_klusener Sep 22 '20

The reason these questions and type of interviews exist is because there is a large number of people applying for roles, so there needs to be some filtering mechanism.

I may get down votes or negative comments for these, but i wanted to put this out there.

2

u/drninjabatman Sep 23 '20

It is fashionable these days to say that whiteboard interviews are removed from reality but really it is an inherent problem of the way the labor market functions. The interview process needs to take less than a month. There are really two options here:

  • there is a 1h interview during which the candidate is either tested on trivia or on how they tackle a small problem in an abstract (tech-agnostic) way.

  • The candidate is asked to build a N hour project. Now unless the employer is willing to pay for the N hours the candidate spends we are talking about free labor, and furthermore N can't possibly be large enough to reflect the actual everyday work.

So really the problem is with the structure of the market and less about the particulars of interviewing.

2

u/teszes Sep 23 '20

So here's my thoughts on this.

If I started the interview, the knight example would have started me going down an entirely different direction than the interviewer's solution. Of course I would be hinted to correct my course, and the interview would consist of me going in some direction, the interviewer trying to coerce me to see into his head and guess how he would approach the problem.

I think this tests only how well can you understand and expand upon what the interviewer asks you and more importantly, if you take the next step he took. If not, tough luck, as at the end it will look as if you don't know what you are doing. I don't think this maps well to any real-life scenario, except maybe pair programming an algo problem, with this particular interviewer as your senior.

I think it is a test that selects people who are able to do just that, people who think like that particular interviewer. I would not be such a candidate, or I sincerely don't know. I wouldn't take this in the same direction, and tbh, I think he overcomplicates the problem just so he can map it to the real problem he wants you to solve, which is where he says the question's complexity is. If I have sufficient time to think about how the neighbours can be represented, I may actually get a different solution than his.

Like this one:

def count_sequences_own(start, num_steps):
    num_corn = 0
    num_vert = 0
    num_side = 0
    num_zero = 0

    if start in (1,3,7,9):
        num_corn = 1
    elif start in (2,8):
        num_vert = 1
    elif start in (4,6):
        num_side = 1
    elif start == 0:
        num_zero = 1
    else: 
        return 1 if steps == 0 else 0
    
    for _ in range(num_steps):
        num_corn_new = 2*num_side + 2*num_vert
        num_vert_new = num_corn
        num_side_new = num_corn + 2*num_zero
        num_zero_new = num_side

        num_corn = num_corn_new
        num_vert = num_vert_new
        num_side = num_side_new
        num_zero = num_zero_new

    return num_corn + num_side + num_vert + num_zero

I have arrived at this solution in an hour. In that hour, I've started from the beginning two times. It gives the same results for all starts, for the first 10000 sequences as the interviewers. It has no recursion and it is much faster.

Does this mean that I am Google material? I don't know. But is this interview a good gauge if I'm good at this? I don't think so. It would have gauged how alike do we think with the interviewer more than my aptitude in solving this problem, I think. If I tried to push against the "clues" I got, and stuck to doing it my way, I may have arrived at this solution, which the interviewer either liked or not. Or most likely the mental tug of war would have prevented me in effectively thinking about this problem.

2

u/[deleted] Sep 24 '20

I don't understand why the original poster did not recognize that the numbers fall into 4 classes. The numpad is left-right symmetrical, so it should be immediately obvious that there are at least 3 mergers.

I really like how cleanly your code maps to the numpad moves, but I can't see why stepping through all stages linearly should be as fast as binary exponentiation of the matrix.

2

u/Fabalabulous Sep 22 '20

People here seem to think that this problem is ridiculous. Is the general consensus that this is a difficult problem? Or is it just that it doesn't at all apply to the job you will do? I did my degree in mathematics so I think that this sort of question plays into my hands much more than a straight computer science question.

2

u/[deleted] Sep 24 '20

I really like the problem. Many brain teaser problems require the candidate to make one big leap that may or may not come to mind, so they come down to luck, which is a terrible way to judge skills. This knight problem can be attacked systematically, and the solution can be improved upon in many ways. That works much better in an interview situation.

→ More replies (1)
→ More replies (2)

2

u/everyones-a-robot Sep 22 '20

Pro tip: don't work for a company that conducts interviews that are completely irrelevant to the work needed.

It measures one thing: "How willing is this monkey to jump through hoops?"

→ More replies (1)