Hacker News new | ask | show | jobs
by euske 3652 days ago
As for testing a prospective programmer, what I consider an ideal test would be something like this:

1. Pick the three most important lines out of this 100 lines of code.

2. Explain why they're important to those who're not familiar with the problem at all.

3. Rename its functions and variables to achieve maximum consistency to you.

4. Optimize the code for maximum efficiency.

5. Optimize the same code for maximum maintainability. (assuming the code will be used for 30 years)

1 comments

You start with a subjective criteria? Ouch. It reminds me of the time I had to do some work for a factory... every department was telling me how theirs was the most important work - with arguments.

I can make an argument for even a "write to log" line as being extremely important when something goes wrong; I have no idea how I would pick three lines out of a hundred.

If I were giving the interview (not OP), I wouldn't care which lines you picked, just how you justified it.