DEV Community

Rodolfo Miquilarena
Rodolfo Miquilarena

Posted on

Why Is Competitive Programming Important?

To answer this question can be hard since not many people are interested in the subject, either by not knowing about it in the first place or seeing it as something that will drain a lot of time from them without actually giving them tools for everyday work and like those two reasons there are probably a thousand more you could bring up, I would suggest before you read this article to take a look at the concept of competitive programming, just in case you aren't familiar with this fascinating world.

Improves upon your reading and understanding skills

I am not just talking about reading fast, I am also talking about understanding what the text in front of you is trying to communicate, how to spot ambiguities, how to understand the problem, and abstract yourself off anything that could be unimportant to the final solution. This is really important in my opinion since sometimes requirements can be poorly written or poorly specified, also they can be 40 pages long and have only about 10 pages worth of useful information, the ability to pick the things that are actually important and separate them from the other stuff, is crucial for any programmer, especially when the requirements come from another company.

Alt Text

Teaches you the wonders of algorithmics and data structures

Algorithms are what we as programmers do, however, there are so many algorithms and paradigms that you might have heard about but don't know much of, and are so fascinating, from the concepts of a Greedy algorithm. to Dynamic Programming, passing by Dijkstra's Algorithm and KMP, or even some Divide and Conquer algorithms, going to things that you might never heard about but are actually very useful like Ford-Fulkerson's Algorithm, Modular Exponentiation and the Maximum Bipartite Matching concept.

Alt Text

And of course, we cannot miss out on some Data Structures like Tries, Binary indexed trees and Segment Trees, just to name a few.

I just named a few concepts and algorithms, but this list goes far and beyond, as programmers knowing this will help us understand how some things are done, how can be other methods to solve specific problems that don't need to be using brute force, and since we need to adapt a requirement to an algorithm or set of algorithms, it helps us to abstract ourselves and select the best solution for the current problem at hand, since all algorithms have their advantages and disadvantages.

Alt Text

You learn about the importance of execution time and memory management

Besides solving problems, we as programmers understand that a machine has finite resources, both a limited amount of memory to work with and a limited amount of instructions per second a processor can execute, in competitive programming usually there are very tight time limits and memory limits, a problem as simple as retrieving the n-th element of an array can be really challenging if the memory limit is low, and a problem as simple as finding pairs of elements can be quite challenging if the time limit is very strict. So in competitive programming is a must to understand the Big O notation for complexity, and also understand how to identify when something is gonna be too slow for a certain amount of entries, this way of seeing things can help a lot at the everyday work since we should be doing code optimization constantly, for example making a program that runs as fast as possible while consuming the less memory possible.

Alt text

Prepares you for coding interviews

Yes, knowing a language very well, a framework or other things is very important, actually, it can be paired up perfectly with all the advantages we talked about, but some companies, especially big ones like Google and Amazon, take special care to find out if you can solve these kinds of problems without using specific frameworks, for example, the most usual question that pops up in an Amazon interview is the BFS problem, which you would need to solve from scratch to approve said interview since most of the time they won't let you use a pre-made library. There are now tons of sites to practice these kinds of problems, and the reason being that they are pretty much a requirement to go work for the most notorious companies.

Alt text

And as a sort of conclusion...

There are many more advantages from learning about the world of competitive programming, also there are, of course, some disadvantages, however, I can highly recommend if you have any interest to start doing some research and learn things you didn't know before, thanks for reading!.

Top comments (0)