Thursday, March 4, 2010

Facebook puzzles

Tonight I joined the community of people who are spending their time to solve Facebook Puzzles.

Those puzzles are programming exercises. Facebook provides couple of those puzzles in different difficulty levels. Each of them consists of a problem description, sample input and expected output data. Solution are excepted in a range of different programming languages like Java, C, C++, Ruby, Erlang (.. really long list ...). You submit your solution as an email which is processed by a bot which compiles and runs the submission against an input which is not known by us. Result of this run is provided as an email which provides a binary success / failure indication.

As far as I looked at those problems they are restricted variants of hard problems. Only the tiny restrictions make them solvable in polynomial time. So quite some thoughts on finding a proper algorithm is needed for this one which makes this stuff pretty interesting. Another dimension is that your solution will be run on large/difficult test data. Therefore you really need to spent some time to optimize your solution in runtime and space. That makes it even more interesting. The more advanced puzzle involve the usage of the Thrift framework and elements of distributed computing. Nice :-)

Facebook provides quite some ground for a vivid developer community around the puzzles. There is a fan page, quite some discussion threads and even stuff outside Facebook (like this FAQ) which deal with that topic. There is a Facebook application which allows you to share the glory of solved puzzles on your Facebook profile and there are public pages which show High-Scores like thriftpuzzle server. Everything set for a good competition ;-).

Facebook places the puzzle as a recruiting tool - showing guys which solved puzzles and have been hired. Definitely this is a good tool for a company to get smart developers into your orbit.

Some of my colleagues started solving those puzzles some time ago and I was trying to keep myself out of this one as this definitely would impact my family life. High risk of addiction ;-). Now it happened, but I try to keep my involvement low. Personally it is a nice opportunity to
  • solve some nice algorithmic challenges
  • learn/compare programming languages on valuable problems
  • get in touch with the Thrift framework - on my list anyway.
Why don't you try this as well?!