4 ms·
The linked list thing happened to me very recently. 3 interview rounds and all asked linked lists questions back to back. I was very honest in that in my 2 ye
by screye 6y ago
The linked list thing happened to me very recently.
3 interview rounds and all asked linked lists questions back to back.
I was very honest in that in my 2 years on the job, (ML, DS) I had never once run into a situation where I would use a linked list. I didn't remember if Python even had a default linked list implementation and I decided to implement it from scratch. Wrong decision.
I didn't get through, but the choice of linked lists was quite bizarre, esp. for a Data Scientist position. I would have much preferred a coding question that was relevant to the job or a take home assignment.
Well, I guess it was a good signal nevertheless.
- mhh__ 6y agoI think it's very possible to pass all the courses and still be a pretty lousy programmer. If I read someone's code I'm often not really looking for the correctness at the beginning, but whether they get programming i.e. it's more than just characters on a screen which pass the tests
- devoutsalsa 6y agoHow can you tell if someone gets programming? Could you share a couple examples of getting (or not getting) programming?
- mhh__ 6y agoI think it would be rude to give identifiable examples, but the things that trigger my subconscious when reading good code are often the perfect balance of aesthetics, pragmatism, and mechanical sympathy for one's surroundings. Understanding even the absolute basics of how modern processors actually work is a huge plus for me because I'm biased. The absolute basics also apply obviously - good comments, variable names that I don't have to run the program to divine the meaning of for example. I wouldn't try to judge this based on an interview or whiteboard however, real code written for fun rather than dance monkey dance
- nullserver 6y agoHand them a small hash/dictionary {a=>1, b=>2, c=>2} Have them swap keys and values. See if they can cope with duplicates. On large hiring spree (20+ hires, hundreds of interviews) I would walk in, give them that in any language they wanted. Moment I saw they understood, I would let them know they passed and walk out. Let others handle the social aspects of interviews. 90% failed test or took ages to get to solution. Remaining would finish it under a minute and be confused as to why we gave them such a trivial test.
- skyde 6y agothe way I see the problem is company say they want an expert in X where x might be 1- writing driver and OS internal in assembly/ ANSI C 2- writing video game physic engine in c++/CUDA 3- writing machine learning model in Python/R but the interview is always something like 1- reverse a (linked list.tree) using your language of choice 2- write code to solve the N-queen problem ... Basically they ask bad question to evaluate data structure knowledge and ability to solve riddle. But they ask 0 question related to the specific expertise required for the role they are trying to fill.
- cmollis 6y agoexactly.. this is so stupid in my opinion and just signals another 'we only hire the best.. ya know, like google'.. implementing breadth-first-search, or a linked-list insert during a coding interview is quite possibly the most ridiculous way to determine if a potential hire will be able be productive at your company.. which, as we all know, will be writing spring boot services that return json.
- cmollis 6y agonow, I should also say that if your company builds libraries that actually implement these algorithms in a better, stronger, faster way, then of course by all means ask away. And, I also get that understanding what I linked list, hash map, trie, graph, etc.. is an important signal for interviewers that you've got some computer 'science' background. However, more relevant question might be why they might be used.. or the algorithmic complexity of one over the other (since in practice we're just going to use a collection library anyway). I might argue that another (equally irrelevant) signal that you've studied computer science would be ask what the integral of 1/x is.
- skyde 6y agoI got asked those kind of question "integral of 1/x" during interview with big tech (Microsoft) and Wallstreet (Morgan stanley, goldman sach). But to be fair at Wallstreet you are likely to work with quants and have to do integral :)
- foenix 6y agoI've been doing python for 14+ years now. Never been asked about linked-lists, but was asked about prototypical inheritance in javascript (didn't get that job -- in retrospect, very glad i didn't). Now that I'm on the other side of the interviewing table, i always start off by saying "I think coding interviews are stressful as heck, so you should know that what I'm looking for isn't the "right" answer, it's that we both learn something. You can google your way to the right result, but it takes much more skill to implement in a team." Basically I try to turn interviews into a learning experience. With that lens, I tend to have a much better appreciation about a candidate than forcing them to pick up a marker and write a loop on a whiteboard. Aside: Linked lists in python have a built-in deque: https://docs.python.org/3.7/library/collections.html#collections.deque https://docs.python.org/3.7/library/collections.html#collect... (I still had to google that one)
- dirtybird04 6y agoWent through interview rounds last year and I was asked a recursion questions for a DS interview. Been doing this for 10 years and have never come across a data problem that only recursion could solve. But I remembered it from university days, so I cobbled together a working answer. At the end of the interview, I asked the interviewer to give me one scenario where a recursive solution would be the most efficient one. Blank stares. That was my eye-opening moment. I would never work for a place that asks these ridiculously outdated copy-paste interview questions. Can't believe I put up with that shit for so long.
- balfirevic 6y ago> Been doing this for 10 years and have never come across a data problem that only recursion could solve That makes sense - there are no such problems (which is obvious if you consider the fact that Turing machines don't have recursion - nor functions, for that matter). > I asked the interviewer to give me one scenario where a recursive solution would be the most efficient one That also makes sense, as recursion usually isn't a technique that will bring an efficiency edge over non-recursive technique. It might often bring maintainability and understandability edge, though. Solving the problem using recursion highlights the fact that it has, well, a recursive solution - which means that the solution can be expressed as a set of operations on top of solution to a smaller instance of the original problem. This can be an important property to notice about a problem, whether or not you're going to solve it with the function that calls itself. Additionally, some problems have a solution that can be nicely expressed as a set of mutually recursive functions (instead of just a single recursive function). These are harder to express non-recursively. Many parsers are written like this, for example the C# parser: https://news.ycombinator.com/item?id=13915150 https://news.ycombinator.com/item?id=13915150
- odonnellryan 6y agoIt would be more difficult to read and maintain any solution to many problems where you are operating on nested objects, especially if the nesting is more than a few levels deep or even arbitrarily deep, without using recursion. Also generating such objects, such as with nested parentheses, is easier as well.
- collyw 6y agoI failed a interview for not remembering the internals of a hashmap. I learned that 20 years ago in university and have honestly never needed to consider it since then. I work with databases, servers and web apps. I was actually surprised at how many of the computer science fundamentals that I did remember after 20 years. While an understanding of how these things work is useful it's mostly unrelated to the job.