Competitive Programming
So I decided to take a plunge into the world of competitive programming after testing the waters for a while. I spent my free time in the last couple of weeks solving algorithmic puzzles on different websites and wanted to share my experience here.
I had done a few easy problems here and there earlier, the problem really was focus. Selecting a site to start with is a tough task with so many good contest sites with great repositories of problems. There’s TopCoder, which is the most popular, but it forces you to download a standalone Java Applet and doesn’t have a great interface. Don’t know if its just me, but I didn’t like the experience too much. Codeforces, Codechef, Interviewstreet, SPOJ, Project Euler and a whole host of online judges by various universities leave you with an infinite supply of algorithmic problems. Almost all of them host weekly or monthly contests and have a rating system similar to chess ELO ratings. Believe me, solving these problems gives you a kick and helps you improve your algorithmic skills. It is also quite addictive once you get rolling.
You need to select a particular site and stick to it for a while. Make sure you choose one that has a good mix of easy and hard problems so that your confidence is not tripped up. Codeforces has hints for problems in their archive and would be a good starting point. I don’t have much of a background in algorithms and haven’t taken any formal course, but this is probably a great way to learn about them and also improve your debugging skills.
Though most programming languages are supported by these sites, learning C++ and STL will be incredibly useful. Many problems have tight time limits which would frustrate the hell out of you if you are using an interpreted language like Python. Even if you are using an optimal algorithm. This is what made me give up the last time I tried these sites, not any more.
Codechef has a monthly programming contest with some nice algorithm problems, so I decided to have a go at it last week. This contest is a ten day long event with ten problems. So I spent a couple of hours a day working out these problems and managed to solve 7 out of 10. The problems that I could solve were using the standard algorithms that you would find on CLRS, with some minor changes. So I guess, if I can do it, anyone can. Need to ramp up my skills and read about more algorithms to solve the remaining, but it was really fun and exciting.
Another thing I learnt from the past couple of weeks is that multitasking doesn’t work even if you use great productivity apps, todo lists etc. Just pick something you would like to work on and spend a considerable amount of time without context switching to get more productive. Life becomes less hectic and more enjoyable this way.