Coding, Puzzles and Mathematics

Coders like to solve problems – the high one gets when one finally ‘cracks’ a problem is one that is as powerful as any drug – they are also alpha males – they don’t like to lose… :-) This powerful combination leads to the traditional image of a pale, pasty, overweight  geek in glasses sitting over a computer screen in the wee hours of the night, mumbling to themselves and ingesting caffeine by the pound.

I’m a bit like that (OK – I am not pale and I like to work in the morning but the rest is similar ;-)) except the problem I might be solving may not even have any real world application. It might simply be a solution to a puzzle !!

This post is about coders and their love of puzzles… Most of us have heard and even experienced the classic puzzle question in interviews for development positions. There are numerous books on this topic (the classic “How Would You Move Mount Fuji? Microsoft’s Cult of Puzzle‘ is a great read) – both about the interviewing techniques as well as methods to solve them. I don’t want to get into a discussion about how good or bad the use of this technique is in interviews (I personally don’t favor them – in the wrong hands they can be horrible – like this one ;-) )

What I like to do is examine the puzzles themselves – puzzles can be of several varieties – one can spend hours and hours over them – indeed some people make it a full-time hobby. There are several puzzle competitions  – one of the most challenging being the MIT Puzzle Hunt (the wikipedia entry is very informative). You also have organization leveraging this interest by posting challenges like the FBI

However, the puzzles that interest me are the ones that have a basis in pure logic. I tend to regard puzzles with an eye to the elegance of the solution. A good logical puzzle with an elegantly simple solution is a thing of beauty – I like to go through the reasoning and try and look for extensions or extrapolations. I look at the assumptions and limitations and try to understand the thought process behind the puzzle.

They are a good way to learn, to get ideas on new approaches.  They expand you mind and  are finally but most importantly – they are FUN. I often use them as a fun way to learn new computer languages – good candidates are mathematical puzzles :-)

Here are some nice links – check them out and happy solving :-)

  1. Maths Challenges – Check out the links section where there are some programming challenges.
  2. Project Euler – Awesome site with some really cool puzzles.
  3. Delphi For Fun – The programs are in Delphi which is aversion of Pascal but it has some nice algorithms.
  4. FBI Ciphers – Ciphers are a fun type of puzzle that kind off go off in to crypt-analysis.
  5. Shine’s Take on IT – My friend Shine is reading “How would you move Mount Fuji?” and is blogging about his read.