|
I 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). |
I can't quite shake the idea that what you're really testing is if the applicant has been to the same kind of school as yourself.
> 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
I've seen some really interesting (and performance-constrained) code done in .Net that didn't use pointers or linked lists in any way. It's not either "bland crud" or pointers, that's a false dichotomy.
Of course, concepts like parse trees, A-B pruning or Hungarian method of optimization are things that are worth having a hold on. But "how often you expect to use the skill" of linked lists with pointers in many modern languages, Java and C# included, is effectively never.
No idea where the crap java code for a sorted list came from, hope you're not trying to put those words in my mouth!
In the .Net world, good companies do try to look out for "broader" developers who are aware of useful open-source software toolkits, and want to practice things like Dependency Injection, TDD, Continuous Integration etc. They generally make better coders.