CodingBat is a free site of live Java and Python coding problems to build coding skill. Each problem has a problem description and a table showing some sample output for that problem. Type your Java code into the large text area and click the “Go” button to save your code, compile and run. Each time you click Go, the results are shown in the right side of the page. On each problem page, the “prev” and “next” links lead through the sequence of problems in that section. The “chance” link goes to a random unfinished problem in the section.
The problems in each section get harder towards the end of the section. Some of the problems (marked with an “H”) have hint text and/or the solution code available. In particular, all of the problems in the “Warmup” sections have solution code available, so that’s an easy way to get started.
Going through many practice problem is a great way to solidify your understanding of how the code should work. CodingBat problems work great as homework, or for self-study practice, or in a lab, or as live lecture examples. The CodingBat problems are designed to have low overhead: short problem statements (like an exam), nothing to install, immediate feedback in the browser, and there’s lots of them to build up those skills. The idea for CodingBat came from my experience teaching CS at Stanford combined with seeing how student’s used unit-tests in more advanced courses, and crystalized when I saw an Owen Astrachan demo of a unit-testing thing he uses with his Duke students.
CodingBat Design Idea – Coding in the Large and Small
Every big programming problem has a lot of little programming problems in it. The little programming problems have elements we see again and again — string and list manipulation, loops, a little logic.
Working with students in office hours, I see what a big advantage it is for students who are practiced and quick with these little bits of code. Skill with the little code allows students to concentrate on the larger parts of the problem. Or put another other way, someone who struggles with the loops, logic, etc. does not have time for the big picture.
CodingBat is all about building and practicing little code problems. The number of problems in each area is pretty large, so you can repeat and solidify your code skill in that area.
If you want to build skill in running, what do you do? You run. To build skill in code, write code. Ok, that’s pretty obvious, but with this site, I’m trying to create an environment where people can concentrate on the coding with nothing else to get in the way. With all the surrounding structure taken care of, you can get a lot of coding practice done in just an hour or two. I’m conscious that the problems do not have realistic stories to motivate what’s going on. Instead, they are stripped down to have short problem descriptions with as little ambiguity as I can manage. Of course programming problems with realistic stories are a very important part of CS, but I leave those for larger take-home assignments. CodingBat is just about lots of little problems to provide opportunity to practice.
I also like the way you can get immediate, positive feedback. It’s a simple mechanism, and yet I find it satisfying to try to finish enough check marks to get that gold star!
Right now, the problems are the sort you would see in a first or second Computer Science course. Click on a problem, type some code into the method body, hit the Go button, and work it from there until you get the green check mark.
The name of the server is CodingBat, based on the Greek word “bat” meaning “this domain was available”. You can always get back to it from my Stanford home page.Flag this Resource