Coding Problems for Homework

“Coding Homework” is a small website that I have built to list small problems that one can work on, to learn how to use a new programming language. For example, small problems requiring to read from a file, or to use regular expressions, how to find duplicate files in a folder, and so on.

Note that the problems listed on the site is not for testing your algorithm skills, there are many sites for that already.

This list was inspired by repeated requests and suggestions from readers of A Byte of Python for homework problems at the end of each chapter to exercise the skills they have just learned. So I thought why not make it applicable to any language and multiple programming skill levels. And it’s a good topic that can be collaboratively worked on with the programming community, à la Stack Overflow.

All the content will be licensed under Creative Commons Attribution-Share Alike 2.5 India License so that anybody can reuse this content, especially in classroom situations.

Screenshot of "Coding Problems for Homework" website

I also had my own specific goals when implementing this side project:

  1. Solve the lack of “homework problems” for people to exercise their programming skills, especially in the context of learning a new programming language.
    • I am not trying to replace existing lists but rather focus on making the reader active (providing exercise problems) than letting him/her be passive (reading code listings).
  2. Learn how to do website layouts, specifically how to use YUI Grids CSS.
  3. Learn how to pick colors for website design; ColorCombos turned out to be useful.
  4. Learn to use Google App Engine.

It has been a fun side-project, spending a few hours here and there. It is very far from polished, but the basic functionality works. There is still more to do — adding a search functionality, conforming to standard UI design patterns, caching for the rendered HTML (from Markdown), optimizing the housekeeping code, and so on.

This site itself is a good example on the kind of problems that beginners can work on, but they would not know what kind of problems they can solve and what level of expertise (beginner / intermediate / advanced) would be needed. That is where this list of problems can help.

I request you to spend 5 minutes of your creativity to add a few problems so that beginners and intermediate level folks will have interesting problems to test their learning of a new programming language. Thanks!

It might be helpful to you as well when you’re going to play around with functional languages (Haskell, Erlang, etc.), funky new languages (Ioke), or new languages by big companies (Go).


13 thoughts on “Coding Problems for Homework

  1. its a very nice initiative… For someone starting off at the bottomlines, it would prove to be very helpful.

    Thanks and all the very best!

    P.s.: a mobile version of ur blog would be awesome! Wp-mobile plugin?


  2. Nice idea and a nice site but you have a minor problem.

    If I browse by “Beginner” level when I hit “Next” I get the next 5 “Beginner problems but then when I hit “Next” I get a mix of all three levels.

    // Tony

  3. how about creating an environment for writing and executing the code then and there itself on the web ? and comparing solutions with others and rating the solutions too .

    i know it would be bad for students who try to copy solutions from site , but bad students are always there :)

  4. Swaroop this is a great idea – I’ve been thinking about something like this for a long time – especially when reading SO it’s obvious such a thing is a must.

    Hope it succeeds.

  5. @Pradeep Thanks!

    @cruisemaniac Yep, that’s the idea.
    Also, I’ve had the WPtouch plugin installed since quite a while, but will look into WP-Mobile plugin.

    @Tony Oops! Thanks for informing me. Will look into it. Update: Fixed.

    @Sashank All that can be done but we need content first to make that possible.

    @Eli @Dan Thanks, glad you like it. Please do spare some time and contribute a few homework ideas :)

  6. Cool idea!

    Is it going to be possible to post and discuss possible solutions (perhaps a bit like in Project Euler (

    I think it might be worth considering to enable the users to set up collections of problems. Suppose you want to build a MP3 metadata editor. To do this you have to solve a couple of separate problems:
    1. Figure out how to parse existing MP3 metadata (ie. Could you please clean up the urls? :) )
    2. Figure out how to write MP3 metadata.
    Optional: 3. Figure out how to visualize this (ie. at simplest level you might be dealing with command line based UI but perhaps it might be cool to implement graphical one too)

    I am sure there are many other examples like this. Anyway thanks for cool initiative. Let’s hope it’s successful.

  7. Yo,

    Just submitted a problem (although shamelessly stolen from the work I’m doing – but I felt like I had to add it because I implemented it in Python in under a hour and a half with just your book to go by, and starting from “Hello, World!”).

    It’s of course, terribly boring, but it does give you some practice with the loops and bitwise operators. :) I’ll try to find something slightly better soon (shouldn’t be hard!).

    Grand effort, kudos. Just the sort of thing I’d find very handy. :) I’m certainly watching out for how this evolves!


  8. Swaroop, great idea. The site looks simple and elegant. Kudos! One request though: RSS feeds for the problems. That way, we can keep track of whats happening.

  9. Hi Swaroop,

    Nice site. As you mentioned, there are a lot pf sites for algorithms, but something like this is just as necessary while learning/mastering any programming language.

    Is it possible to allow tagging of problems and publishing an xml feed for the tags? I think it would be very helpful to people who want to track specific type of problems.

    I have also recently created a website where I have organized various CS course videos in one place. It’s very nice to see sites such as yours coming up.


  10. @Juho The idea, currently, is only problems and not solutions, because the point of it is for the user to explore how to solve it in the idioms of the new language. If solutions is what is preferred, then perhaps “Programming Language Examples Alike Cookbook” project and Rosetta Code project are more appropriate.

    Yes, the URLs will be cleaned up in future, just wanted to get it out :)

    I’m holding off on doing anything advanced until we have a sufficient community-supported body of work, without which it would not be meaningful.

    @Neeldhara Hehe, thanks for pitching in!

    @aravindavk @Ramjee Thanks!

    @Vishal Yep, RSS is a good idea, will add that in future.

Comments are closed.