EK: Hi everyone, my name is Ethan Kellogg.
EY: I’m Ethan Yang.
EK: Today we’re joined by Rohin Garg, talking about his journey in competitive programming. Garg is a two-time medalist at the International Olympiad in Informatics, as well as the president of the competitive programming club at MVHS.
EY: When did you first start competitive programming?
RG: I started programming in general pretty young. I wanted to be better than my sister, so when she started, I decided to start. This would be sometime in early elementary school, but I don’t really count this as the beginning because I didn’t really know what I was doing. In elementary school and early middle school, I learned how to do basic things like coding in basic Python, JavaScript and such. And I started competitive programming in particular at the end of seventh grade and early eighth grade.
EY: What was your first experience like? What did you think when you first started competitive programming?
RG: I remember that I started competitive programming at the beginning of eighth grade, and that’s what I tell people, but I guess when I really tried it out for the first time was a few months before then. But I quit after a few days, so I don’t really count that. I started doing some bronze problems and I thought it was really boring and hard, and I got a headache after trying two of them, so I quit immediately. So I just left it for a few months and then when quarantine started, I went back to it, and then I changed what I was doing instead of just mindlessly implementing things. I actually tried learning things and understanding the algorithms and I thought the problem-solving aspect was a lot more interesting to me than implementing really ugly stuff. So at that point, I started liking it more and then I got more into it.
EK: What problems were you solving? Was it on Codeforces or USA Computing Olympiad?
RG: I started at the very beginning from USACO because that’s how I learned about it. That’s where I did problems initially. The first thing I did was take the bronze and silver contest after I started. After that, I got into it and learned more about competitive programming as a whole. That’s when I got into the other platforms such as Codeforces and LeetCode and stuff like that.
EK: What resources did you use to learn how to do competitive programming?
RG: To preface this, I started learning five years ago or four years. The resources back then were a lot different than what we have now. I think there’s a lot more good stuff that people can learn from now. But what I did when I started was I just did problems and when I couldn’t solve it, I just looked at the editorial — the solution for that problem — and then I just googled the words that I didn’t know. That worked for me because I liked doing the problems and I didn’t mind googling things. But nowadays there are a lot more structured curricula like the USACO Guide, which I think is pretty good and high quality.
EY: What do you do to practice for competitions and what keeps you motivated?
RG: The amount I practice has slowly declined over the years. Nowadays I just do Codeforces contests sometimes. Codeforces is pretty much the only thing I do besides the actual USACO contest. So before contests, I warm up a bit and the week before I’ll solve a few problems. After I started training for IOI and USACO Camp, those level problems, I also tried doing other countries’ Olympiads because they were pretty good practice.
EY: How do you balance spending time preparing for competition with other things like school and running the club?
RG: When I started it was during COVID, so I actually had pretty much nothing else to do in my life. That’s not true anymore and that wasn’t true in ninth grade for example when I was still putting a lot of time into it. One other thing that’s very underrated when it comes to doing these competitions is finding a group of people to do it with you, not necessarily in a class. I’ve never taken a formal class for programming. Doing it in a group with other people who are as motivated as you makes it a lot more fun and a lot easier to keep working on it because you have people to talk to and it’s not just doing problems constantly, it’s also talking to friends. When I was in eighth and ninth grade, because everything was online, it was really easy to find people online who were interested in the same thing and I was lucky to meet good people who were also motivated. I’m friends with a lot of these people still today and I still talk to them pretty actively because of this. That’s how I started. In terms of balancing it with other things, at some point I stopped thinking of it as ‘I need to allocate this much time every day to do this’. It’s like how high schoolers always have time for reels and TV. The same way I feel like I always had time for competitive programming when I wanted to spend time doing it, and then made time for it. I did it when I was free and I didn’t feel like doing anything else.
EY: How did you feel when you got accepted to the IOI and how did you feel when you were done with the qualification process?
RG: The qualification process is a week long and we do six contests or five contests for five hours each day. It’s pretty intense, but along the entire way you know where you’re at. It didn’t really feel like there was one moment where I realized that I made the team. There was a ceremony where they gave plaques and awards to everyone, but in general, I think the entire camp process was really fun. Besides just doing the problems and programming, the rest of the camp too was my favorite part. Just meeting friends and making friends and then going to Six Flags, stuff like that, I enjoyed it a lot. In general, during the actual contest times, going into it, I assumed it would be stressful and scary, especially given that everyone’s in a room doing it together. After the contest starts, you just focus on the problems and it’s easy to get it out of your head, just because there are enough other things to think about that are going on in your brain.
EY: How do you think camp prepares you for the IOI and what have you learned through the camp experience?
RG: In camp, there are a lot of different parts. First, a lot of the coaches, who are both experienced contestants who have graduated or are industry professionals, come and talk to us about things besides competitive programming expanding on it. Related specifically to competitive programming, there are also a lot of contests and editorial sessions. Even besides the lectures, being in a place where everyone else is really interested in the same thing you are, and when a lot of your conversations are about competitive programming and algorithms, it’s really easy to learn from those around you by talking to people smarter than you are and accumulating information. We also have some events where we teach each other concepts that we think are cool. All of these things combined, I think, I learned a lot from those. Also, the problems in the contests they give are very instructive, so you learn from that too.
If it’s your first year, you generally go there to learn more and don’t actually compete for the IOI team. After that, you spend a lot less time in lectures and a lot more time doing contests. For me, because my first year was online, I never got that in-person lecture experience that most other people did. It was pretty different for me compared to what it’s like for most others, but you do learn a lot from the lectures.
EK: On that note of education, you’re president of the CPC club here, right? What skills, other than competitive programming skills, do you need to be successful in this club?
RG: One thing that matters a lot and is pretty understated is that to do well in these contests, you have to be, one, able to take losses. If you do badly in something, use it as motivation rather than just quitting. Two, I think it’s very important to actually enjoy what you’re doing. In my experience, almost everyone who gets to the top is just people who enjoyed it a lot. They were able to spend a lot of time on it, which allowed them to absorb the material and think about problems because they were having fun, not because they were being forced to. Three, being a bit of a sore loser helps too, just because after you do badly, it really drives you to do better. If you are competitive and a sore loser, you tend to try harder during these contests.
EY: How do you think teaching others to be successful in programming and leading the club has impacted your own experience and performance?
RG: Teaching, in general — this is kind of cliché, I guess — but they say that when you teach someone, you figure out whether you actually understand the concepts. I think that’s very true in competitive programming, and in math and these competitive Olympiads in general. When you try to teach people from the ground up, you need to understand how these concepts build up from the beginning, and you have to be able to put yourself in the shoes of the learners to see if you can draw connections that make sense in their heads, not just in your own. I think this is really good for solidifying your thought process.
For example, I wrote two problems and editorials for USACO. When writing editorials, being able to explain things clearly was much easier because I had taught people before. I was able to work through that thought process in my head — how to make the solution make sense to someone who doesn’t know how to solve it at all.
EK: On that note, we want to know — how does problem setting differ from problem solving?
RG: Problem setting is a pretty fun and actually different endeavor. A lot of it is more creativity-driven because you start from nothing and create your own problems to solve. There’s multiple ways in which people go about this. One way is by picking a cool solution idea and trying to build a problem around it. But the method that produces more interesting problems is when you see something in your life and think, “How could I turn this into a competitive programming problem?” That might sound a little nerdy, but sometimes it’s actually pretty natural. The problem statements end up being much more interesting, and when you solve them, it feels really cool. There’s a lot of problem-solving involved, too — it’s just that there’s no time limit. You take a problem, play with it, change the numbers, change the setting until you come up with a good solution.
EY: What made you want to start problem setting and writing editorials as well?
RG: I actually started problem setting on Codeforces. There were a lot of contests going on, and I thought it would be cool if I could get my name up there too. I just saw it and thought, “Oh, I might as well try. It seems kind of interesting. I’m taking so many contests, so I might as well try contributing to one.” I’ve written two Codeforces contests before and it was pretty fun. It’s a lot of work — writing the problems, preparing tests, making sure none of the solutions are breakable, writing editorials, and all of that stuff — but I think it was worth it in the end. Nowadays, every once in a while, I hear someone talking about my problem or mentioning that they solved a problem I wrote, and it’s satisfying to hear.
For USACO, it’s more about giving back to the community that helped me. Every time I think of a problem that I think would fit well in a contest, I send it over. Two of them have appeared in contests so far, and when those appear, I wrote the problem end to end.
EK: Are you able to walk us through the process of one of the problems you designed?
RG: I think the problem I’m most proud of started when I thought of a process based on a problem I had read. The thing I came up with ended up being completely different, so I solved it and then asked someone else to try solving the problem. I accidentally gave them a harder version of the problem than I had intended — the way I phrased it made it harder, but also a lot more interesting than the original problem, and it ended up being really cool. The solution idea was really hard to come up with, and I probably wouldn’t have even come up with it if I hadn’t gone through that weird process.
EY: What do you think was the most memorable or your favorite moment when participating in competitive programming?
RG: The most memorable thing to me, ironically, is not really about the competitions at all. I think it was two years ago at camp, on the second-to-last day before we went to Six Flags, when we pulled an all-nighter. We were all just up, spending time with friends, talking and playing games. I’m still really close with these people, and I was really close with them then. I made a lot of friends because of camp, so it was really nice to just spend time together.
EK: Are there any other aspects of programming that you explore other than competitive programming?
RG: I participated in hackathons before, and I find that whole experience really fun. I know a little bit about development in general. I’m not particularly good at it, but I can do something. Nowadays, AI is a pretty hot field, so I’ve been reading a lot of research and trying to understand the new developments so I can keep up with the world. I expect AI to be relatively big in the coming years, so that might be a field I’d want to work on in the future as well. Actually, in the last year or so, I’ve been spending a lot more time on things outside of competitive programming because it kind of feels like my high school era is coming to an end.
EY: How do you think competitive programming will shape your future endeavors? Do you plan on still competing after high school? What applications do you think it will have?
RG: Competitive programming has always been a hobby for me, so I’m sure I’ll continue after college and during college. I’ll still do contests for fun. I will try to get on the ICPC team, which is the intercollegiate programming contest that they hold. I’ll keep doing it, and I’ll keep working on it because it’s fun. After I graduate, I’m sure I’ll be trying for a software job because I find programming in general very interesting. Even though writing software for a big company is different from writing standalone algorithms to solve an individual problem, I think the problem-solving process is very useful. I think it will help me a lot, when it comes to working through problems and maybe incorporating some of these algorithms if I end up working in such a space.
EY: And that’s all we have! Thank you guys so much for tuning in, and thank you so much to Rohin for spending time with us today.
Music: “Journey” by Filo Starquez on Soundcloud | Used with permission