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.

In 2000 I co-founded Fog Creek Software, where we created lots of cool things like the FogBugz bug tracker, Trello, and Glitch. I also worked with Jeff Atwood to create Stack Overflow and served as CEO of Stack Overflow from 2010-2019. Today I serve as the chairman of the board for Stack Overflow, Glitch, and HASH.