In my professional work I started noticing that the more advanced developer you are the more meaningful comments you leave on a code review. Recently when I was asked to interview several candidates I came up with a fairly simple code snippet (these were inexperienced candidates) in several languages (so they can choose) and 'hide' well known issues in the code. For example, in a Java snippet I would use == instead of .equals(), duplicate some code, use meaningless variable names, for OOP, come up with a strange class hierarchy, etc... I came up with a range of issues with different difficulties. Then we were to discuss what is wrong with a code and how to improve it. I found that this question gave me insight into several things. First, it was a red flag if a developer could not point out obvious issues with the code. Second, even if a developer could not find all the issues, I could point it out and they can say 'ah yeah' and talk about it in a meaningful way. It also allowed me hear them dig as deep as they wanted on certain things. I personally find it intimidating to write code during an interview. I also find it strange when potential employees give you a 'homework' to complete at home and hand in before the actual interview. But then how else are you supposed to evaluate their programming potential? So in my limited experience, showing the code snippet worked real well. Is there any issues with this approach or is it acceptable? Is it possible that someone does well with this task but would not be able to write quality code? 
Is a developer's ability to analyze code directly proportional to how well they can write code?
skills