inning computer-programming contests is nothing new for David Arthur, but being awarded $50,000 for such a victory is. That’s the sum the Duke University junior claimed when he defeated 15 other collegiate programmers from around the world to win the 2003 Sun Microsystems and TopCoder Collegiate Challenge. After preliminary rounds whittled the field down to 16 final contestants, the tournament culminated in semi-final and final rounds on April 4 and 5, 2003 at the Massachusetts Institute of Technology in Cambridge, Massachusetts.
Arthur (or dgarthur, as he’s known to other programmers in the TopCoder online community), a double major in computer science and mathematics, has won other collegiate programming competitions and even more mathematics competitions at the high-school level in his native Toronto, Canada, but the Sun Microsystems and TopCoder Collegiate Challenge prize was by far the largest he’s won.
Although the competition took time away from his coursework, leaving him in a pinch to catch up and study for finals, Arthur took a few moments to speak with DevX about competitive coding, why he prefers C++ over Java in contests, and why he may not even pursue a programming career once he graduates.
DA: I started [getting involved in TopCoder] in January last year. Several friends had mentioned it to me. Since I’d never heard of it before, I didn’t take it that seriously for a while. But eventually I did give it a try and got hooked pretty quickly.
There just isn’t much like it out there in the world. There are a few contests and one big one called the ACM competition, but the way that works is you go to the world finals twice then you’re never allowed back. And I’ve already done that, so when I finally did find TopCoder I enjoyed the chance to compete again.
DevX: How long have you been competing?
DA: The ACM is a university-only contest. I started that my freshman year. There are also high school contests and I started doing computer competitions when I first heard about them. I’d actually been doing math competitions for much longer, because they’re older and better publicized. So I had some contest background before I even started the computer contests. Even though they sound different, once you learn to do well in one the skills carry over.
DevX: Is it the competition that interests you or is it solving the problems?
DA: What first got me involved [with TopCoder] was the money. That did a lot to get me the first time, but it quickly became a lot more than that. There was a time when I was doing it for not a lot of money because I felt I was getting better at competing, and also it really is a lot of fun to solve these problems. They’re sort of like little puzzles, and it’s enjoyable to see what the tricks are [necessary to solve them].
DA: My biggest problem on these is I try to go too fast. I skimmed one of the easy problems, thinking ‘well, I’m competing against some very good people. I need to try to get a big head start.’ So I read it very, very quickly and the first thing I thought of I spent about 30 seconds trying to analyze it and convince myself that it would work. And then I typed it up and realized just as I started testing my already finished program that it was completely wrong.
Because I’ve been competing for so long in both mathematics and computer science, my biggest strength is that I’ve developed something of an instinct. So when I see a problem I can figure out rather quickly what I need to do.
|Problems||Java Solutions||C++ Solutions|
DevX: How does coding for a competition differ from coding in a real world job (Arthur has had an internship at a company called Trilogy)?
DA: In the contest there’s much less time, so you’re solving problems that aren’t quite as long. In the real word you think a lot about design, you want to have nice code that other people can understand. Perhaps that isn’t quite as important with TopCoder, but if you look at the people who are in the finals and you look at their code, it’s definitely not so bad. There are a lot of people who come in and commit every design error in the book just trying to go super-fast, but when they do that it doesn’t really pay off. So I think it’s very much the same thing on a smaller scale, where if you make the same mistakes it’ll hurt you just as much.
Also, several things are very important in the real world, like to test your work. It’s much more important to have something right than it is to have it fast. And it’s the same at TopCoder. No matter how quickly you do it, if you have one mistake you’re getting absolutely nothing for the problem at all.
DA: Almost everything I do, I use either C++ or Java. I learned C++ some time before. So even though I enjoy Java when I have all the time in the world to look through the APIs to figure out how to do exactly everything I want to do, when it’s something like TopCoder where it’s very important to know how to do what you want to do very quickly, I find C++ to be easiest just because I have more experience with it.
DevX: Have you thought about how you want to apply your computer skills after graduation?
DA: I’m really deciding between a couple of things, and it’s possible I may not go into computer science at all. I am double majoring in math. I still do enjoy math very much, so it’s possible I may become a professor [in that field].
DevX: The ‘world’s best collegiate programmer’ might not even go into the programming field?
DA: Math’s fun too, and they’re very related. They’re not as far apart as one might think. I’m thinking about mathematics but I’m certainly not committed to it. Among the computer jobs out there, I think I’m fairly flexible. I’d want one where I’d feel I’m doing something interesting–since I’d be spending more than half my waking life doing whatever job I have. There seem to be a fair number of things I could go into that would do that, one of them being gaming programming simply because the problems they have to deal with are certainly as hard as anything out there.
DA: I think they’re pretty happy. The computer science department is publicizing it, they’ve got it on their Web site, and they’ve got little posters up. That’s very nice. But in general I think the computer science department has been very helpful all along. It’s not quite as large as some schools so when they do get people who actively compete in contests, they’re interested in us. They follow it, they pay attention, and they try to help you along. They’ve always been good to me in that way.
DevX: Are you going to defend your title next year?
DA: I’m going to try. TopCoder’s got some really good people already. And it looks like it’s just growing faster and faster. Who knows who’s going to be in it next year? I’ll put in my best effort but it’s definitely not going to be easy.