4 ms·
I also believe in coding questions but the linked list question in this situation wasn't a good one to use for both candidates. Why? Well of course the kid st
by peacemaker 15y ago
I also believe in coding questions but the linked list question in this situation wasn't a good one to use for both candidates.
Why? Well of course the kid straight out of university would answer a question on data structures correctly, he probably did the class for that only a few months prior.
In your example, Candidate A was obviously a no-hire after not even knowing what braces a C function uses but a lot of people similar to Candidate A who can actually code are being presented with questions about linked lists and similar structures no-one who has written code for years would remember, let alone use in their daily work lives.
I want to say again, I'm 100% for coding questions but I think they should reflect more on the type of work you need the candidate to do in the job rather than some academic examples you feel you must ask just because Microsoft/Amazon do.
- ernestipark 15y agoI wouldn't consider reversing a linked list a data structures question, it's a coding question. Everyone knows what a linked list is and that you have to iterate through it and flip the "arrows". The tricky part is being able to maintain all the pointers and know how to order your operations and handle any edge cases. That's what questions like these are supposed to check for, can you actually articulate into code a solution that you understand on a high level in your head.
- araneae 15y agoIt's absolutely a data structure question. You have to know what functions are available to you from within the data structure. For instance, in a singly linked list you only have the function "getNext()" and "getHead()"; in a doubly linked list, you have additionally have the function "getPrev()" and "getTail()". If parent asked me this question in an interview I'd probably jokingly say "well, you didn't specify doubly or singly, so I'd just call getTail and then getPrev until I was done!" And then I'd write a recursive function for a singly linked list because everyone likes recursion. How could you possibly answer this question if you didn't know what a linked list was? If you never took a data structures class, you probably used "lists" but you have no idea what the bare bones construction is. Just using lists doesn't mean you know how to write one from scratch.
- RexM 15y agoIf for some reason you don't know what a linked list is, you can always ask. I think it's about admitting when you don't know something just as much as it's about being able to reason through the problem and give a correct answer. All else equal, I'd much rather hire someone who didn't know what a linked list was, but asked and answered correctly, than someone who pretended to know and limped their way through the problem, even if they did eventually give a correct answer.
- arghnoname 15y agoLinked lists are so fundamental, not knowing what they are is a big red flag. Anyone with even a modicum of curiosity about this field, college educated or not, should know what a linked list is, its complexity, and how it is structured.
- ernestipark 15y agoI meant it's not a data structures question in that it doesn't ask anything particularly prodding into understanding deeply something intricate about a data structure. I assume any CS student knows what a linked-list is and can figure out that it has a getNext() function. It's more about coding than understanding a linked list.
- davidhansen 15y agobut a lot of people similar to Candidate A who can actually code are being presented with questions about linked lists and similar structures no-one who has written code for years would remember, let alone use in their daily work lives. Your reference to "remembering" is entirely irrelevant. What is relevant here is whether the candidate can reason through the problem - and more power to the candidate if s/he's been out of school for N years. What I strive for with technical questions is not to find out how well the candidate remembers their Knuth( although finding someone who actually read Knuth is nice ) - it is to determine how well they think through problems. And with no offense intended, if you can't at the very least come up with some ~3N complexity stupid-but-it-works stack-based solution to the problem of reversing a linked list, you probably shouldn't be a professional developer.
- peacemaker 15y agoNo offence taken, I do actually know a lot about linked lists, trees, graphs and so on. Partly from past experience, partly from reading technical articles and partly because I've researched the type of questions asked and therefore brushed up on these questions. I guess the main argument I have is that I don't believe these are the best way to find out if a developer will be good at the position being offered. But I can't think of a better solution (other than getting them to work a trial period) and others seem to like this way of doing things. Therefore I will learn and adapt, which is the way of programming anyway :)
- salsakran 15y agoI completely disagree. If you view data structures as something that you "remember" from your university days, then you are more of a "tool user" than a programmer. No matter what a candidate has managed to accomplish using their IDE and copy/paste adventures, if they can't reverse a linked list on the spot they are a blindingly obvious "no-hire". This should be the sort of thing anyone looking for a programming job should be able to do as the programming equivalent of muscle memory.
- peacemaker 15y agoNo not really, most professional developers, even using languages with little to no supporting libraries/APIs rarely, if ever, have to write code to reverse a linked list. Of course, given the question in an interview a decent programmer should be able to reason their way through the problem. This is not what I am debating. As a curiosity, I might wish to understand the inner workings of an STL map container, but 9 times out of 10 in a professional environment it is more appropriate that I understand how it should be used, it's pro's and con's and all it's supporting functions. However, even the most novice of programmers can find those answers out with a quick search online. I guess I just don't like questions where you are required to remember facts you no longer use rather than reason your way through problems you might encounter in a real job.
- salsakran 15y agoHere's the thing -- I (and a great many people I've worked with, interviewed, and was interviewed by) don't believe things like reversing a linked list are facts. They're basic skills that are either present or absent. If you aren't able to do such basic things correctly on the spot, I simply can't trust you to check in complex/highly concurrent/etc code that works. As an IC developer I don't want to deal with your code or clean up your mistakes. As a manager, I can't trust you to write code unsupervised. This quote in particular would be a massive red flag and probably the end of an interview: "it is more appropriate that I understand how it should be used, it's pro's and con's and all it's supporting functions". In most companies, what's being sought is not someone who can just use the tools as appropriate. It's someone who can develop new tools and solve problems for which there isn't a pre-canned answer available. If you don't know how to solve the problems for which trivial answers exist, how can anyone expect you to be able to reason through truly novel and difficult problems. The sort of attitude you're espousing is perfectly fine for large ERP/custom corporate app/corporate website/etc programming work. It's just not what people in the valley are doing.