Well, there's life, and then there's interviews.
Ask your friend - would he show up to the interview in tattered jeans and a grubby t-shirt?
His task in the interview (no matter what the format) is to impress the person conducting the interview. Impress them enough to get offered a job.
So if applying for a programmer job, why in the world would this guy submit "tattered jeans and grubby t-shirt" code?
I really hope this person has some clue about coding style, comments and whitespace. In that case, he made the judgement call that the interviewer was more concerned about "rightness" than about "goodness" (my interpretation).
BUT - given the task (linked list? this should be easy-peasy for a programmer), it would seem the task is about far more than just "rightness" of the code.
I suspect the interviewer was looking for many things, INCLUDING good coding practice (it's 1000x harder to "unlearn" bad programming practice than to get them right at the start). The interviewer was probably also looking for something to indicate initiative, good assumption making, perhaps even creativity or inventiveness.
For example, there are many ways to write a linked list that are "correct", but some (like using recursion) are deemed more "elegant" than others.
I suspect your friend missed the mark on several levels in this interview.
-R