r/programmingcirclejerk • npm ceo • Apr 27 '16

Interviewer asked me to implement a breadth-first search algorithm. What the fuck?! You’ve got to be shitting me. If my 960+ days GitHub commit streak doesn’t prove [that I'm a great coder] then I don’t know what will.

https://medium.com/@evnowandforever/f-you-i-quit-hiring-is-broken-bb8f3a48d324
78 Upvotes

34 comments sorted by

34

u/Someguy2020 Apr 27 '16

hiring book-smart academic candidates who know their algorithms and data structures cold,

Well I do think google is a bit awful ( I mean a lot awful) with their process, I do at least applaud them for not dumbing down things. You want to work on some shitty front end then keep playing with angular. You want to work on systems at the level of these companies then crack a book.

20

u/[deleted] Apr 28 '16 edited Apr 28 '16

You want to work on some shitty fr.ont end then keep playing with angular. You want to work on systems at the level of these companies then crack a book.

This is what I find so funny about complaints like this. Sometimes I think frontend developers (maybe all hip startup developers?) forget the world exists outside of their niche and get all pissy when companies expect actual engineering knowledge for actual engineering jobs.

Edit: To be fair, some companies ask oddly specific or obtuse algorithm questions. And writing those algorithms on whiteboards really needs to stop. Google is extraordinarily guilty of both of those.

5

u/solid_steel Apr 28 '16

It's the blessing of ignorance. The unknown unknowns. I've encountered this with all sorts of developers - maybe web-devs are over-represented because they have an online voice? I've met quite a few corporate/java folks who act exactly as this guy.

7

u/Kyo91 Apr 28 '16

The only thing that bugged me when I interviewed for Google was that their phone interview had us use Google Docs for coding. I'd prefer a whiteboard or notepad or even sending them images of code that I wrote on paper to using Google Docs for coding.

26

u/eeeeee34rf Apr 27 '16

Isn't it a bad idea to publicly associate your name and projects with a furious rant against interviews?

18

u/username223 line-oriented programmer Apr 28 '16

That's why he doesn't mention names:

No personal names will be used to preserve anonymity... Who am I? My name is [Some Dumbass] (@[SomeDumbass] on Twitter),

Oh, except his own.

22

u/Someguy2020 Apr 27 '16

Luck and chance should not be part of the tech interview process

I agree, but you should still be able to puzzle through solving a maze.

3

u/killercup has hidden complexity Apr 29 '16

Interviewer: So, I see you solved that BFS with Math.random. That's great, but I'm sorry, we have a rule against luck and chance…

20

u/bitbait not even webscale Apr 27 '16 edited Apr 27 '16

<uj> Not sure what's the deal with people constantly complaining about interviews and acting as if everything they're asked about algorithms or data structures doesn't have any significance in real life and was some highly theoretical complicated nonsense which is only used by university professors in their ivory tower.

I remember a highly upvoted thread in /r/programming where a guy complains about being rejected by google because he couldn't perform some basic operation on a binary tree EVEN THOUGH HE WROTE SOME PACKAGE MANAGER :O

There mainly was absolute outrage and hardly any objections, also a lot of cringy nonsensical posts ala "I'm a professional developer and I've never even heard of binary trees lol".

So you want a high paid job as a Software Developer at Google and can't invert a binary tree and they should hire you without asking questions because of some work you did which isn't related to Google, without anyone knowing how much help you had or how long it took you? </uj>

edit: found it https://www.reddit.com/r/programming/comments/39d0u1/google_90_of_our_engineers_use_the_software_you/

Yeah ok to be fair he wrote homebrew which is sort of huge but still the outrage is over the top, doesn't mean you don't have to know shit, especially without any further information about what he was supposed to do at Google. But maybe it wasn't the best example

18

u/womplord1 Software Craftsman Apr 28 '16

In the suggestions:

"How to Get Any Job You Want (even if you’re unqualified)" - Raghav Haran

"I get rejected a lot. Here’s how I deal with it." - Raghav Haran

More quality jerking material

8

u/[deleted] Apr 28 '16

How to Get Any Job You Want (even if you’re unqualified)

Look, if I ever have to perform an emergency triple-bypass surgery, I'll just follow the instructions on CardiacExchange when it comes up.

14

u/ochowie Apr 28 '16

This guy sounds like he would make a terrible coworker and all the companies that passed probably dodged a big bullet. Imagine if a colleague asked this guy a question he felt was beneath him.

5

u/insane0hflex .NET wage slave Apr 28 '16

"LOL R U SRS JUST GOOOGLE IT U PLEB"

18

u/[deleted] Apr 27 '16

At some point during our conversation I casually mentioned Webpack 2 and tree-shaking, which was followed by a question on how would I implement a tree-shaking algorithm. How the hell would I know? If, and when, I need to know how tree-shaking is implemented, I will go look it up.

Ah, yes, the "Ctrl-C, Ctrl-V" strategy to writing code.

16

u/[deleted] Apr 27 '16

If I ever need anything other than Ctrl-C, Ctrl-V, dickhead, I will go look it up, okay?

9

u/Someguy2020 Apr 28 '16

In fairness, the best I could google up on tree shaking is that it is dead code elimination.

That seems like a tricky (complicated?) problem. I mean isn't that going to be done by doing some sort of tracing of program logic?

4

u/sammymammy2 lisp does it better May 13 '16

You'd traverse the AST, look for function calls (and the source of those functions and so on) and put them in a table and then after you're done tell every function that is not in that table to fuck off. It's not that complicated to do it naively.

7

u/tardi loves Java Apr 28 '16

Ah, yes, the "Ctrl-C, Ctrl-V" strategy to writing code.

Doesn't work in vim. Not programming.

5

u/[deleted] Apr 28 '16

I've done interviews were we asked a similar question we didn't know the answer to, and could care less about it being correct. We hired people on how they would respond.

3

u/[deleted] Apr 28 '16

could care less

TRIGGERED

0

u/[deleted] Apr 27 '16

[deleted]

40

u/[deleted] Apr 27 '16

TIL solving a maze requires serious AI knowledge.

"Follow the left wall" -> Skynet.

28

u/IceDane Apr 27 '16

It's funny that he didn't realize that the maze solving and BFS could've been the same exercise.

It really isn't top tier CS, as you say. If you get handed a tree (or a graph), which you do really often, you shouldn't have to look up how to search through it efficiently. I mean, has this guy never had to search through a JSON result from an API or something? What the fuck has he been implementing if not search algorithms?

47

u/this_user Apr 28 '16

I mean, has this guy never had to search through a JSON result from an API or something? What the fuck has he been implementing if not search algorithms?

Node doesn't block, so efficiency in your search algorithm doesn't matter.

11

u/[deleted] Apr 28 '16

I've dealt with a lot of JSON and never had to write my own search algo to find a node. I could if I needed to, but have never needed to, so I don't think this is a good example.

8

u/[deleted] Apr 28 '16

If you get handed a tree (or a graph), which you do really often, you shouldn't have to look up how to search through it efficiently

At my last job I saw this with trees/graphs all the time. It's so funny when a frontend dev says trees aren't relevant because their job literally revolves around manipulating a tree of document objects.

4

u/choikwa Apr 28 '16

obviously DFS

15

u/insane0hflex .NET wage slave Apr 27 '16

He also lists clones of things. Pleb doesnt even have an original idea.

13

u/[deleted] Apr 28 '16

The funny thing is that if you look at the actual problem, it's quite easily solvable. It's really just like fizz buzz in that the solution is right in the problem description

It's a search

And you do it breadth first

0

u/[deleted] Apr 27 '16

[deleted]

16

u/ismtrn Zygohistomorphic prepromorphism Apr 27 '16

I remember that story. The consensus was that "inverting a binary tree" has no standard definition.

0

u/[deleted] Apr 27 '16

[deleted]

13

u/[deleted] Apr 27 '16

<uj>Maybe it does? Most problems you deal with as a dev don't have a "standard definition" you can just go implement. You usually have to go talk to the clients or the designers and figure out what exactly they want, and then try to respond to that.

0

u/[deleted] Apr 27 '16

[deleted]

6

u/[deleted] Apr 28 '16

I don't believe the interviewer literally asks you to invert a binary tree. It's likely they didn't use the word "invert" at all, or that they say "the definition of inverting a binary tree is X. Pleas write a function to invert a binary tree"

2

u/ismtrn Zygohistomorphic prepromorphism Apr 29 '16

The story started from a tweet. I imagine the guy who wrote the tweet had to significantly reword the question posed to fit both that and his criticism of it into 140 words.

1

u/username223 line-oriented programmer Apr 28 '16

</j>Some help for your next job interview: if you are asked an ambiguous question with an obvious interpretation, start with "do you mean X?", not "LOL WUT ambiguous!" In this case, you might try "do you mean reversing the child pointers?" It's an exercise to see if you understand recursion, not an invitation to a pedant-war.<j>

19

u/[deleted] Apr 27 '16

I've never taken a CS class in my entire life, and I've implemented breadth-first-search on whiteboard in an interview (after asking the interviewer what the term meant).