TechInterview: “I have a black triangle, a white triangle, a black circle and a white circle…”

These classic problems are reported in [Shafir 1994]. Read it if you can get your hands on it. The interesting thing for us as programmers is that certain types of logical thinking are inherently hard. In particular, most people will stop working through a problem when they get to a disjunction, that is, a point on the decision tree where you need more information. This becomes especially interesting when you don’t actually need the information because the result would be the same in any case. But there is something that makes most people unwilling to go past uncertainty points in problem solving anyway. Good programmers usually overcome this problem. It’s a critical skill in debugging — we don’t want to waste time investigating areas that could not possibly cause the bug. This might be one of those interesting brain-properties that distinguishes great programmers from everyone else.

Shafir, Eldar. (1994): Uncertainty and the difficulty of thinking through disjunctions.  Cognition, 50, 403-430.  (Reprinted in J. Mehler & S. Franck (Eds.), Cognition on Cognition, Cambridge, MA: MIT Press, 1995.)

About the author.

I'm Joel Spolsky, co-founder of Trello and Fog Creek Software, and CEO of Stack Overflow. More about me.