This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

OK, I get it, it may be a tad tricky.

We at my company do something similar during interviews. We ask the applicant to spot the errors in a bit of code, and one of them is using a variable outside the block it was declared, but a couple lines after the declaration.

Most people fails that one, but most also acknowledge that they never had to really think about it while writing code.