It depends whether the question on the language or on the programming.
in reply to Meditations on the Nature of Code Exams
In college, I encountered both kinds of questions, sometimes on the same test. And when I conduct interviews,
I ask both kinds of questions.
Language questions tend to be short, and rarely represent complete programs, and I expect near perfect syntax. Cool language tricks earn bonus points. Some of the Perl questions I might ask are:
Programming questions tend to be more involved, and can be often answered using pseudocode. Language tricks are dangerous, as they can mask your knowledge. If I ask you to implement an efficient sort routine, and your only response is some library call, you aren't going to score any points with me.
- Print out the keys of the third hash in array @a.
- Deduplicate the elements in array @a.
Bottom line, a test is your opportunity to demonstrate your understanding of the subject matter...correctness is secondary. Make sure you know what is being asked, and what the expectations are.