Prolog is among my very favorite programming languages, but it’s regrettably rare. Yet problems that are best expressed and solved using constraint and logic programming (such as Cheryl’s birthday) are, I would argue, not rare at all. It’s more that the mainstream has a blind spot for this powerful problem-solving tool. So, if a candidate started sketching out a solution using Prolog, Microsoft Solver Foundation or JaCoP, I think they would be demonstrating exactly the broad knowledge and clarity of thought we look for in devs. But according to my Facebook friends, the candidate might be showing a fondness for over-complicated solutions.

There is a weakness displayed by the First Five Primes test, though. Ask a few follow-up questions before starting to code. “Do you just want a fixed set of values or a flexible solution?” in the case of the primes and, regarding Cheryl, “Can we just wait until Facebook tells us it’s her birthday?”