Re:LINQ Ruined My Favorite Interview Question
by untog on Thursday July 11, 2013 @11:13AM
(#6026511)
I think the point still stands though, when you think of it as an interview question. The point is to get to the bottom of how the candidate would process such a query themselves, not to test their knowledge of the core libraries of their favourite language.
I feel like that's what the post author meant when he said that LINQ had "ruined" the question- because it kind of does the same thing.
[ Parent
| on HN ]
Re:LINQ Ruined My Favorite Interview Question
by rhizome on Thursday July 11, 2013 @02:11PM
(#6027897)
Isn't it kind of axiomatic that any question that provides for a concise and measurable solution will eventually be refactored into a library? It seems like kind of a weakness in these kinds of "programmer" questions, that they all regress to trivia. Why not an open-ended business problem and/or deliverables-type question? I'm sure that would speak more to the daily job, where I've never heard of someone being tasked with "OK, find the top 10 words by frequency in a random Wikipedia article."
Re:LINQ Ruined My Favorite Interview Question
by untog on Thursday July 11, 2013 @02:56PM
(#6028316)
Surely the 'trivia' in this instance is knowing the names of libraries, as opposed to be able to think through programming concepts?
Just like math homework back in the day, the teacher didn't do it to check your answer, they did it to check how you arrived at your answer.
Re:LINQ Ruined My Favorite Interview Question
by rhizome on Thursday July 11, 2013 @04:33PM
(#6029015)
My memory of the math homework you describe brings up two images: geometry proofs and story problems. Never did I have to explain multiplication when doing my times tables, nor quadratics.
collections.Counter.most_common() uses heapq.nlargest() which is slightly more efficient than a full n*log n sort.
But implementing a heap correctly from scratch is I guess outside the scope the OP intends for the interview question.
I would expect a good candidate to:
1. know that a heap is optimal here (remembering whether Counter uses it is optional)
2. express reluctance to implement it from scratch because surely the stdlib can do it better.
So IMHO using libraries like this ruins the question only in the sense of showing its not a challenge for the candidate. Something so simple should not take a page of code.
Re:LINQ Ruined My Favorite Interview Question
by klipt on Thursday July 11, 2013 @04:39PM
(#6029067)
> collections.Counter.most_common() uses heapq.nlargest() which is slightly more efficient than a full n*log n sort.
Creating a heap is O(n) if I remember correctly, so that may well be the most efficient solution.