I came across this accidently, and wish I cam across it a long time ago. There is a site that has weekly algorithm contests for short (and sometimes longer) computer algorithms. Apparently, there is the rare case where winners are even given royalties for their work. Even if you're not interested (or eligible) for the competitions, it seems a decent way to get some brain exercise, and you can compare your program snippets to what was accepted as the best answer.
TopCoder
enjoy!
TopCoder
enjoy!