We will be talking about competitive programming in this article. So we’re going to go through and find out what competitive programming is, some of the information about how it works. Then hopefully I’ll answer for you, by the end of the article, whether competitive programming is something that you want to do or look further into. So without further ado, let’s get into that right now.
What is competitive programming? Well, I like to use an analogy here, so let’s think about a sport where you’re competing against other people, or weightlifting. Now obviously in weightlifting, the idea is to lift the most weight and you’re competing against other people to do that. And over time people get eliminated if they can’t lift a certain weigh. And eventually there’s someone who’s left over who basically wins, because they lifted the heaviest weight.
Now in competitive programming, we’re not using our physical muscles, we’re not losing weights, but we’re using brain muscle, brain power if you will. And we’re creating, we’re completing challenges that have been created for us, by people who are actually running the competitive programming contests or competitions, in which there are a lot of ‘mesa that presents you with a problem and you need to solve that problem in computing terms by creating a program to do so. But, the real kicker is you need to do its quickly as possible.
So the whole idea of competitive programming’s on getting something that works, that actually meets the requirements that are given to you. So it has to actually solve a particular problem, but also has to be done as quickly as possible. Now quickly as possible in a sense of getting it completed in the amount of time you’ve been allocated, but there are also other stipulations often there that your solution may have to complete or compete.
Compete: I’ll get it right this time, in a certain amount of time. So for example, I might say whatever the solution is it has to execute and take no longer than one second to do so. And you’ll find that there’s a judge, an online judge, who you’ll upload your version, your solution and they’ll go through that and run that and verify that that actually works in the amount of time. And also that you basically how much time you’ve actually taken to write that, is also calculated and stored somewhere as well. Now, it’s usually done on a number of rounds.
So you can start from round one, there might be, say there’s 500 people competing, the people who don’t make it to the end of round one, people who don’t finish the solution in the given amount of time or whose solution is incomplete or doesn’t work or takes too long to execute, they will get eliminated and then you move to round two. And there’s another challenge, and you keep moving through till eventually, you get to a final round and there’s a winner award and someone will eventually win that, completing the last challenge that’s been assigned to theming the quickest amount of time.
And depending on the type of competition that’s out there, you might find that that will take you onto other things and eventually you could even get to a huge competition where there’s lots of cash prizes and other sorts of prizes. So it can be quite a thing where you can actually make money if you’re the type of person who can really work well under pressure and complete a lot of these challenges quickly.
Now a lot of these contests or competitions have actually got high score titles and these points that you’re owning, it can continually help those appointed or allocated to your account. And that means that someone can go back and see the history and they can see the archive, oh, Tim has got 5000 points here and they can compare themselves to you. So there’s this letter that’s available. And the secret way to check your progress against to other people and see how you’re going against them.
But again, the point I want to stress here is that competitive programming is all about getting something done as quickly as possible. Getting it done really, really fast. Now sometimes you’ll get to decide on the programming language to use, but other times, you’ll have to use the language that the person that you’re providing the solution to, is actually, no, or is basically saying that they’ll receive. So they might come back to you for example and say I’m only going to accept C++ and C for a challenge.
So you’ll need to go in there knowing ahead of time what language to use. So often, they’ll accept multiple languages so you maybe have to do a big job of Python, C+ Parcel C keep in mind again, being competitive, it’s coming down to time and your solution takes1 1/2 seconds and another solution takes a second, now if the stipulation was that it needed to be no more than one second long, then you might be eliminated for that.
So for that reason, often C++ is a language that’s heavily promoted but I’ve seen competitions on all sorts of different languages. And you’re not necessarily eliminated purely because of your choice of language, but just keep that in mind as well. And not to mention, there’s usually an online grader, almost, always an online grader who will take your solution, so there’s a submission process.
You get your code working in your favorite IDA, then you’ll copy and paste that, upload it and they’ll actually verify that. And once they’ve verified that it’s working, you will then go and post that and you can view the points that you’ve completed at a certain time. And however the calculation is or the amount of time, how quick it is, will be added to your account. Right, so with that said, we now know what competitive programming is.
Why would you want to do competitive programming? Well, as you can probably imagine, you’ll probably become a better programmer thanks to this process. And you’re testing yourself against other, in many cases, elite developers. So it can be something that will really put your back to the wall and really they’ll help your skills and you’ll get better at problem-solving, because you really need to think on your feet and come up with solutions really quickly.
Now often the problems that you need to solve, here’s another big one, are used in interview, are interview questions, at large companies like Google, etc. So the more that you understand and are able to compete with these, or complete these competitive programming challenges, that’s going to help you for technical interviews, because you’ve actually been through these processes. So these questions that are often asked, similar questions, at interviews. So that’s a good way to brush up on those skills if you want to do that.
What are the prerequisite skills that you need to have to get into competitive programming? Well, in general, you need know, have you really have a good knowledge of your chosen programming language? This isn’t something generally that I recommend for beginners, just because of the nature of what you’re doing here.
You’re needing to come up with a solution fast, so it means that you should really have a good understanding of programming languages. But also, I would suggest you also need good understanding of data structures, because you’ll be using those in your solution and probably algorithms as well. So with that said, who is this, we talked about who it’s not aimed for, so let’s talk about who it’s aimed for now. Because I’ve talked about beginners, probably not suitable.
Beginners in general are not going to be suitable because they haven’t really got those core skills that are needed. You really need to have some experience with programming. But it’s really aimed more at the people who know something about it.
They’ve got a good level of programming skill and are looking to take their results to the next level. They’re really wanting to go through this as an exercises that they can answer technical questions at interviews down the trek, but also just to become better programmers because the more coding you do in general, the better you get at programming.
Now, one really big advantage of competitive programming’s it can be really worthwhile if you like working under pressure. Now you often get that in your career as a programmer. You may need to think under pressure, you’ll need to come up with a solution quickly and that can be a good thing because this is what this is all about.
It’s all about the clock is ticking all the time and you need to come up with a solution really fast. And that can be exhilarating if you’re the type of person who works well under pressure. And obviously contrasting that, if you’re not that type of person, you don’t like pressure, you might find competitive programming’s not quite fair for that purpose.
Now one bad thing though, about competitive programming’s that it can teach you bad skills, believe it or not. So when you get a job, if you carry working like you’ve done now, like a competitive programmer, where you’re trying to get something finished as quickly as possible, well, that can lead to rushing a solution and can lead to bad programming practices.
Because obviously in a job in the real world, it’s not necessarily just about completing it in the fastest possible time, it’s making sure that you’re using best practices, your solution work, it works, so it’s been thoroughly tested. It works well with an existing code base and so on and so forth. And in fact, further to that, Google have actually come out and said that they’ve found, interestingly enough, that people who excel and win at competitive programming, that can be seen as a negative factor when they actually go for a job.
And that’s for that reason, that basically there’s someone’s rushing because they’re so used to doing that as a competitive programmer, may actually not be a great fit for a job, but until they realize they need to slow down and think a little bit more about the process before they actually get to the stage of just putting, start typing, in other words.
So thinking of architecting a solution instead of just rushing to finish it as quickly as possible. There is no doubt though you will get better a programming if you go through competitive programming and that’s purely the case because you’re actually doing more programming. And I would suggest for that reason it’s maybe worth a look. And the other thing to keep in mind is that it might even be worth just to try it and just knowing that you’re not going to try and get to be the best of the best, but just to enter a competition, try it out and just see how you go.
Try not to get too discouraged and just remember that these types of events, contests and competitions for competitive programming, tend to draw out the elite. And so you really will be competing against the best of the best in many cases. So if you’re not getting the results you think you should be getting, just keep in mind that you are competing at that level.
But it’s probably worth a shot but just don’t get too discouraged obviously, if you’re not getting the results you want. I see it as something that is there, it’s something that some people will probably love, particular is people who love to put themselves under pressure. But it’s certainly not for everyone.
So for that reason, if you think you’ve got the skills, give it a whirl. Amazing, you made it to the end of the article. Hope forward to catching you in another article. Feel free to leave a comment and share this article with others if you liked it. Thanks a lot for reading and have a great day!