Having fun with Competitive Programming

Competitive Programming refers to a sport where participants (contestants) have to write solutions for a set of given problems in a certain amount of time. The solutions themselves have to be correct and run under a time limit as well.

If you already knew what Competitive Programming is, then you might know competitions such as ACM ICPC, IOI, Google Codejam or Facebook Hacker Cup. These are well-known competitions where participants from all over the world try to solve programming problems that are both correct and run under the time limit. In ACM ICPC, for example, participants take part in teams of three and have 8-12 problems to solve in under 5 hours.

I was introduced to Competitive Programming when I was in 11th grade and took part in the Portuguese National Olympiad in Informatics. I wasn't very successful at first but the following year I managed to qualify for IOI 2013.

Now that you've read through the boring introduction, I want to tell you about how you can have fun with Competitive Programming even if you've never heard of it. So you might be thinking that this kind of contest is only for algorithm rock stars who are really experienced in writing efficient code really fast. Well, I'm definitely not one of those guys (yet!), but I still like taking part in programming competitions in websites such as Codeforces or Codechef.

Why do I do it? The first reason is that I like the feeling of being on a clock and having to finish something in a small amount of time. Secondly, it's a really good way of getting comfortable with programming in general (and to master programming languages as well). I've also always been very curious about algorithms and maths and every now and then I read about solutions to problems and I learn a little more. The concepts associated with programming exercices are usually applicable in all kinds of situations in software development (be it in small or large scale).

Other reasons include preparing for programming interviews or challenging your friends. It's a very healthy habit (as with most sports) and I think that more people should be giving it a try.

Having said all of that, I hope you give it a try if you haven't already and you can share your opinion on this sort of thing with me on Twitter.