Re:Job Interview question: "Reverse a Linked-list. Write cod...
by awa on Monday January 18, 2010 @01:08PM
(#1060440)
Agreed with the sentiment. The worse part is the post has 5 points which is more than some of the good posts/articles out there.
Also, to give some leeway to the OP he might have been trying to point out the fact that the code had errors (which was later corrected) and showing why blindly taking advice from random blogs might be harmful for your career. In that case I would have appreciated if he had left a comment.
Re:Job Interview question: "Reverse a Linked-list. Write cod...
by jordyhoyt on Monday January 18, 2010 @03:13PM
(#1060713)
Good point, I had not considered that. Agreed
Re:Job Interview question: "Reverse a Linked-list. Write cod...
by eru on Monday January 18, 2010 @12:56PM
(#1060401)
I agree.
(Sorry, couldn't resist:) You can extend the clever answer to XORing the strings, if you extend the XOR-operation to strings. But I probably would not use that in production code.
Additionally, sites like these are a disease. At work, I overheard a phone screen in which the interviewer asked the question, "you have a collection of numbers, all of which appear twice, except one number which appears a single time. How do you find the number?" The person being interviewed gave the "clever" answer (xor all numbers together, result is your answer) within seconds. The interviewer said, "that's nice, but not what I'm going for. What if it's a collection of strings?" She couldn't do it.