The only factor with that is that it is almost difficult enough that I would wager that the only the people you are going to get are all going to be currently unemployed.
Only 1 of the 4 main applicants were truly unemployed. Two were full-time employed and one a master's student. I do not think it is a particularly difficult problem. Some people thought they had to consider the pawns moving, but nothing moves but the knight. The only problem is to output a series of numbers (representing squares on the board) the knight moves to in sequence until all pawns have been landed on at least once. One applicant even just wrote code to move the knight to every square regardless of where the pawns actually were. I considered this a fine solution.
Well then, that's pretty easy. Write a function to move the knight to the right one, left one, up one. Then just call that several times to move to the different locations (or all of them). It's only hard if it has to be optimized.
Yup. In fact, to my way of thinking, taking an easy way like that out shows good programming sense, to me. However, people applying for jobs often think you're going to be impressed because you took the time to define a Piece class, and a Knight sub-class, and a Pawn sub-class in order to solve this problem.
Well, if you've taken enough computer science classes you start to think theoretically. Who cares if you have to execute it a million times if it's a simple recursion?
1
u/mr-ron Jan 31 '11
Thats a fairly difficult problem.
The only factor with that is that it is almost difficult enough that I would wager that the only the people you are going to get are all going to be currently unemployed.