4 ms·
Can you reveal the algorithm you are asking them to implement? Your anecdote is interesting in the context of the recent stories about a lot of programmers not
by haasted 15y ago
Can you reveal the algorithm you are asking them to implement? Your anecdote is interesting in the context of the recent stories about a lot of programmers not being able to solve the fizz-buzz problem.
- DrJokepu 15y agoI'm not the parent but we're in very similar position (finding it very difficult to find decent .NET developers, candidates can't answer even the most basic algorithmic questions), so I'll answer your question for you. I typically ask candidates to implement a function that calculates the nth element of the Fibonacci sequence, write a program that prints the values in a binary tree in ascending order and finally to implement an algorithm that finds the value of the element in the middle of a linked list. These are just "introductory" questions, but very very few candidates make past this stage so I very rarely get to ask serious / deep programming questions to candidates. And believe me, I'm very forgiving on interviews and try to take into consideration that the candidate is probably very nervous, especially when they are fresh off the school, but what can I do with a candidate who can't figure out how to get the number of elements in a bloody linked list, even after carefully explaining how a linked list works? Or the ones who get the idea that they should be counting all elements but have no idea how? How could I discuss the finer details of type covariance or ask them how they would go on about implementing a face detection algorithm if they can't even come up with the naive solution to the Fibonacci "problem"?
- StrawberryFrog 15y ago> implement an algorithm that finds the value of the element in the middle of a linked list I'm struggling to think of the last time I had to use a linked list for anything. I'd be tempted to give the troll answer: put the elements into a List<T> already, divide list.Count by 2.... Sure if it's doubly linked then you can walk it from both ends and meet in the middle, then think about how to handle the case where there are an even number of elements, but do you really want a serious answer about linked lists in .Net?
- DrJokepu 15y agoThat's not the point, the question is about understanding fundamental, abstract computer science concepts and being able to craft simple algorithms. Even if we don't manipulate these data structures directly these days in code, there are "real world" concepts that are very similar to these fundamental data structures such as HTTP redirection chains, various stages of a workflow and so forth. It is due to the very nature of computers that a good developer has to be able to find abstractions in real world patterns and solve problems using these abstract ideas. A linked list (or a binary tree) is a very simple abstract idea and it's a good device for measuring the candidate's skill at solving abstract problems. Additionally, my view and experience is that unless we're trying to hire a specialist in a niche, domain knowledge (in this case, .NET) is considerably less important than general programming skills and abilities; a good developer with limited .NET skills would still write excellent .NET code, a developer who's very familiar with the .NET Framework but who's poor programming skills would be a liability for the company.
- StrawberryFrog 15y ago> Even if we don't manipulate these data structures directly these days in code We don't manipulate them indirectly either; .Net or Java lists aren't implemented like that.
- crpatino 15y agoI am sorry, but I just cannot let that go! From a recruiting point of view, this kind of questions are indicators. They are easy to verify and they are correlated with some other, more relevant skills. First, knowing your 101 Data structures is correlated to your Computer Science general knowledge. What relevance does it have? It depends on the job description. There are jobs that merely require churning out bland CRUD application code, and it does not make much of a difference if you know this stuff. But, in general, for anything that has strong performance requirements, it might be a concern. By example, if you let me feed the troll, your solution shows a mix of cleverness, (potential) ignorance and unawareness of the high level goal.. that I might be concerned you would produce something like... class SortedList extends List{ //... add(E element){ parent.add(element); qsort(this); } //... } On the other hand, Linked lists also give you a hint of the ability of the candidate to manipulate pointers/references. This may or may not be relevant, again, depending on how often do expect to use this skill in your code base. A trivial solution would let you at least know that the person pays attention to detail and does not leave a mess behind. A more sophisticated approach gives you more information about actual expertise (like, if you know about cycle detection, this is a piece of cake).
- tychobrahe 15y agoI know how you feel. Last time my manager asked me to come up with a simple test for interviews I added a question with code and asked what it was: a bubble sort in C#. No one got it right, not even a "it sorts the array".
- jackfoxy 15y agoI don't want to publish it, only because I like it so much for its simplicity, yet efficacy in weeding out candidates. I don't want it to become too popular. I will say it has to do with processing a single array in a way that could come up in a business application (although I have never seen it). An important part of the assignment is to understand the simple instructions, which include the statement //sample test case (your solution should pass any test case), followed by a sample test case, an array of a particular length.
- haasted 15y agoThat's all right, and understandable. Seems my question was not completely wasted, though. It generated a fairly interesting discussion above. :)