> Where do I do that?

"I assume 'diversity of thought' refers to expressed thoughts..."

> First, I am struggling over how to identify 'diversity of thought' during the interview process.

I think we've covered this pretty well, so your struggle isn't over the "how" - but the "why".

> Is it something different than "can come up with innovative solutions" or "out of the box thinking" or "creative problem solver"?

It is no different, with one exception: it is measured in relation to your existing organization. If all your programmers are proponents of the functional programming paradigm, hiring another Haskell programmer, while relatively novel to the rest of the industry - likely does little to increase your organizations diversity in thinking (without additional screening parameters).

> These seem like two different interpretations of that phrase...

They are: one is selecting for proxies, presumably as a shortcut. The other is directly addressing what is desired. I'm always amazed at how proponents for such selection mechanisms are totally oblivious to how ridiculously prejudice it is.

> ...I lean towards ubernostrum's down-voted comment that "diversity of thought" seems often used as a euphemism for "put up with assholes" (my interpretation).

Clearly.

> Which means you end up biased towards rules lawyers. Which may be what you want, but bear in mind that you are presenting one performance goal while you have withheld a secret goal that you are actually looking for.

Boom, point proven. You have at that point learned something about that candidate's way of thinking, select on it or don't. If that was a hidden goal then it worked, if it wasn't then disregard.

> Here's a less secret goal: the test is meant to see if you know what modern C++ is like...

Not a diversity of thought test.

> ...and if you have a good idea of what the POSIX mindset is like (so you don't end up asking pointless rules-lawyer questions).

That is a diversity of thought test. Is the candidate willing to, in the face of ambiguity, insert his own opinion instead of speaking up?

> Which of these possible secret goals should the interviewee try to optimize?

As I said earlier: the one that, in your experience, indicates an ability to do the task that the candidate is hired for. Should there be a tie, the one that arrived at a solution that you did not anticipate. And no, that doesn't mean you should hire a guy who insists on sorting files using Node.js, just because he was the only one... you can't determine rationale based only on language selection. If he does it in shell script, ask why. You may learn that binary compatibility concerns are higher on his priority list due to some past experience that you wouldn't have considered.

> ...the essential problem remains - does "diversity of thought" differ from "highly competent and creative problem solver"?

Yes, but first I'll point out that "highly competent" is an unrelated concept. Because effectively nobody has unbounded useful creativity over an entire problem domain, you want to select individuals who's constraints overlap as little as possible - thereby covering more of the problem domain. Personal example: I took over a database from the engineering department because the guy maintaining it retired. I was horrified when I looked inside, the architect was obviously a PLC programmer - using triggers and views to form a hellish logic ladder. I was trying to figure out how I'd be able to untangle everything into a more tradition normalized database when I got a request from one of the engineers to insert a new trigger to account for some upcoming process change, I told him how much I didn't want to do that and asked if I could spend a day with him in order to get a better grasp on their problem domain - he was annoyed, but agreed. Well it turns out the old engineer wasn't totally insane, the problem domain was pretty much unbounded and constantly changing: new metrics, new datatypes, new requirements - totally normal for their department. Whereas I would have used a Domain-key normal form in that situation, he just created a new table and added a trigger. Both styles work, each has different weaknesses and strengths. Neither of us would have arrived at the other's solution. Diversity of thought.

> In my description, the first argument is a filename. The contents of the file are a set of lines, terminated by a \n.

Lol, even your attempt at clarification adds confusion. The ambiguity this time: is the set of lines terminated by \n, or is each line in the set terminated by \n, or is the file terminated by \n? Yes, I'm pretty confident that I know what you mean - but I have seen 0x1f used for stuff like this in production, bad things would have happened had I just made an assumption.

> Otherwise the desire to sort the contents makes no sense.

Sure it does: if instead of interpreting the explicit mention of '\n' to mean line termination within the file, one interpreted it as the termination of the first parameter. Again, one can guess the intent due to convention - but it is ambiguously phrased and immediately led to two competing possibilities of intent in my mind. Maybe that is because I think differently from you...