How do you practice coding? I've seen the great CodeKata and also Steve Yegge's Practicing Programming.

What are some more interesting exercises?

16 accepted

Jeff's Code Kata (from this post):

I don't have a long list of effortful study advice like Steve and Peter and Dave do. I'm far too impatient for that. In fact, there are only two movements in my book of code kata:

  1. Write a blog. I started this blog in early 2004 as a form of effortful study. From those humble beginnings it has turned into the most significant thing I've ever done in my professional life. So you should write blogs, too. The people who can write and communicate effectively are, all too often, the only people who get heard. They get to set the terms of the debate.

  2. Actively participate in a notable open source project or three. All the fancy blah blah blah talk is great, but are you a talker or a doer? This is critically important, because you will be judged by your actions, not your words. Try to leave a trail of public, concrete, useful things in your wake that you can point to and say: I helped build that.

When you can write brilliant code and brilliant prose explaining that code to the world -- well, I figure that's the ultimate code kata.

As far as interesting exercises and challenges are concerned, you could try looking at some stuff from TopCoder or Google Code Jam


Project Euler and Anarchy Golf are two of my favorite sites for simple programming exercises.


Check out the Bowling Game Kata for practice in Test Driven Development.


Python Challenge is an interesting set of 33 puzzles which you solve by writing little programs in Python -- although there's no reason you can't use the language of your choice.


A great article by Peter Norvig: Teach Yourself Programming in Ten Years


The Monopoly - The Game code kata seems interesting. It is good to try some code katas that are not just mathematically puzzles. Below is sample from the first release called Basic Board and Player Movement:

For this first release, we want to be able to support the basic player movement. All players start on the first location. The players' order is initially determined randomly and then maintained for the remainder of the game. Each player takes a turn, during which they roll a pair of dice, move from their current location to a destination calculated based on their current location plus the roll of the dice. The board has a total of 40 locations. When the player reaches the end of the board, s/he starts back at the beginning again. Since this version is so simple, we'll simply play a total of 20 rounds, where a round means every player takes a turn.


D'oh! Forgot about Ruby Quiz and Perl Quiz of the Week!


I've enjoyed several of the Programming Praxis exercises.


CodeChef and SPOJ rocks.


You want some more interesting problem solving questions. Try programming contest practice questions.

UVA online-judge provides a huge list of problems and allows you to submit your answers to see if they are correct. Here are a few sample questions.

Another useful site is Hunting UVA Problems. It will create a list of problems that are roughly the next easiest for you. You will need to sign up to UVA online-judge before using this tool.