If you're hiring, how do you find good developers? It's a perennial problem, and no one seems to have a surefire solution.

Aptitude testing is one method that's been gaining traction lately, albeit with a twist. Forget simple coding quizzes, these days the kookier the question, the better. Mind you, what employers hope to achieve is beyond me.

Perhaps the best known proponent of this technique is Google. As if its notoriously stringent academic standards weren't enough, Google's interminable interview process also involves a Byzantine entrance exam. Here's just one example of a typical Google interview question, according to SFGate.com:

Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announces that at least one husband has been unfaithful. What happens?

All I can say is wow. I doubt I'd do well at this particular exam. The problem isn't that the questions are difficult, though I suppose they are. The problem is that they're asinine.

Anyone can make up a perfect world scenario: "A certain branch of government contains 435 representatives, all of them equally honest and wise. No representative would ever vote for a bad bill, and every representative must vote for a good bill when it's introduced in proceedings..."

But there's another problem with this type of question: It seems to demonstrate less the applicant's problem solving ability than the employer's own limited thinking.

Garbage in, garbage out
There's a published, accepted solution to the village/husbands question. According to it, a certain number of husbands are killed on the first day, then a few more the next day, and so on, depending on who has cheated on whom. It's all described in terms of the variable n and laid out as a neat little algorithm.

Here's my solution: Nothing happens.

If every husband cheats and every wife knows when another woman's husband cheats, then every wife is already aware of cheating in the village. The queen has introduced no new data.

Furthermore, if each wife is aware of 99 instances of cheating and we assume she isn't stupid, she can probably surmise through induction that all 100 husbands have cheated. If word gets out, it will be a bloodbath. The entire community will be destroyed. The only solution is to never, ever seek out any information that would prove that her own husband is unfaithful. If everyone keeps quiet, the burden of proof rests with the queen alone.

Essentially, it's a classic "garbage in, garbage out" problem. The wives subvert the data collection process, and the algorithm fails for lack of input validation.

Google's hiring algorithm

Somewhere out there is a hiring manager who thinks this is actually a pretty good answer. I'm sorry, the kind of manager who asks an asinine question and is pleased to receive an equally specious answer is not the sort of boss I'd want to work for. Give me poorly defined goals and I'll produce lousy results (and go home miserable every night). Garbage in, garbage out.

That's all just my opinion, of course. Curiously, however, the whole aptitude test rigmarole doesn't seem to be working so well for Google, either. As Valleywag reported last week, Google director of research Peter Norvig addressed the matter in an interview with Peter Seibel for Seibel's book, "Coders at Work."

In the book, Norvig is quoted as saying, "One of the best indicators of success within [Google] was getting the worst possible score on one of your interviews. We rank people from one to four, and if you got a one on one of your interviews, that was a really good indicator of success."

Got that? In practice, even those applicants who crashed and burned on the asinine questions still did pretty well on the job.

Norvig has since expanded his comments in a blog post. "To me," he writes, "that means the interview process is doing very well, not that it is broken. It means that we don't let one bad interview blackball a candidate. We'll keep interviewing, keep hiring, and keep analysing the results to improve the process."

That's pretty telling, if you ask me. Much like the village/husbands problem, Google sees the entire hiring process itself as an algorithm, one that can be continually refined and optimised. And just like the village/husbands problem, as long as the applicants supply correct data at each step of the process, the algorithm can't fail.

But hang on. I have a friend who works at Google, and right now he's in the market to hire a programmer. He's having a hell of a time doing it, though. It seems the recruiter assigned to his job opening keeps misplacing his want ad and doesn't seem particularly inclined to repost it, so he's not even seeing any candidates. Last I heard, he was advertising the position in his IM status.

Garbage in, garbage out.

You'd think that a company that's reputedly staffed with Ph.D brainiacs would have figured it out by now. Since it apparently hasn't, however, I leave the question open. If you're hiring, how do you find good developers?