Not everyone can be good at competitive programming In fact only few people are able to solve those complicated problems with time restriction.
Many people ask that is competitive programming useful to get a job in tech?
The short answer is that it’s not that necessary, but I encourage people to give it a try at least.
Nowadays online programming competitions have become more and more popular. Websites like TopCoder, HackerRank etc. have built great platforms that attract lots of developers.
Participating programming competitions can be both rewarding and interesting.
How competitive programming works?
TopCoder is one of my favorite competitive programming platform, I’ll use this site as an example throughout this post.
Although TopCoder has developed more than competitive programming (they also have design, data science challenges etc.), our main focus is just programming competitions for job seeking.
In a nutshell, they have daily challenges that you can join to compete with everyone. In each challenge, you need to complete up to 3 different problems in 75 minutes. And then it’s challenge phase where you are free to examine the source code of other participants and search for bugs in their code. If you successfully submit a challenge test case that fails the code, you’ll get extra points.
After that, your code will run through system tests. Based on your performance (correctness, time), your rating will be adjusted accordingly.
Competitive programming VS coding interview
Competitions has a lot in common with coding interview. From this perspective, competitive programming is definitely useful to interview preparation.
First, in both cases you are required to solve coding problems with time restriction. When preparing by yourself, a lot of people find it quite different when setting a timer in front. You will feel more pressure and may fail with simple questions.
Second, coding problems are similar. I won’t say they are exactly the same, but the core ideas are close. If you are not familiar with basic data structure/algorithms, you won’t be able to solve either.
Third, solid code is required. It’s so different between explaining the solution and coding the solution. From my experience, only few candidates can actually provide perfect code.
However, problems in programming competition are generally harder. Dynamic programming is usually required and some DP problems can be crazy.
Also the main focus of competitive programming is solving the problems, but interviews evaluate more from a candidate, e.g. communication, culture fit etc..
How to use competitive programming to ace my interview?
As mentioned above, programming competition is a great resource to sharpen your coding skills. You don’t need to be a top player, but practicing with coding problems is highly recommended.
Take TopCoder as an example. If you just get started, you can go and check its LEARN page. The member tutorials session gives you introductions to different topics. Also, you should check problem sets and analysis section, which has solutions to past competition problems like this one.
You can treat them as normal interview questions and practice by writing solid code. Once you have some general idea of the problems, you can choose to join a competition. I’m pretty sure you’re gonna have a lot of fun.
It’s worth to note that questions are usually harder than interviews, especially for Division one. If you find it too difficult for you, don’t be frustrated since most people have the same feeling. Many top software engineers from Google/Facebook may be just average in TopCoder.
Although programming competition has a lot in common with coding interview, they are still different. Having a good score in one area doesn’t guarantee the other. Never overlook soft skills like communication, culture fit as they are important in interviews.
Dynamic programming is quite common in competitions. If this is something you are afraid of, you can check tutorials and learn from past competition problems.
Some advanced algorithms like max flow are common in competition but not necessary in coding interviews. So don’t worry if you find it hard to understand.
Joining a live competition will once again teach you how different it is between explaining a solution and writing perfect code.
Competitive programming is an optional for interview preparation. If you are struggling with those very basic concepts, this is not for you at this point.
Again, the idea is to further practice and extend horizon. It will definitely be helpful to your interview preparation and you will have a lot of fun for sure.