
Why competitive programming matters in your software engineering career
There are a lot of contradictory opinions about whether competitive programming is useful or not. Below I explain why I believe it matters, based on my own experience. Feel free to comment and push back on what is written here.
What is competitive programming?
It is like a math olympiad, but with computers.
In these competitions you face a series of challenges spanning data structures, algorithms, geometry, physics, graph theory, and more. You write programs (alone or in teams) to solve those problems.
What is professional life?
It is a competitive programming match with no time limit, where someone pays you to solve problems. You still write programs (alone or in teams) to solve those challenges.
The answer
Here are the reasons why I think competitive programming matters at work. I will try to draw a parallel between the skills you build and how they show up in the industry.
- Problem-solving skills. In competitions you must solve problems as efficiently as possible. That requires understanding the computational complexity of your solutions, data structures, and programming techniques. When you apply this knowledge at work, you write programs that are faster, more efficient, and generally simpler.
- Teamwork. Many competitions are run in teams of 2 or 3 people. This is an extraordinary experience: it forces you to find ways to communicate your ideas, understand your teammates’ reactions, and maintain a productive atmosphere. Critically important at work.
- Code review. Related to the previous point: you regularly read your teammates’ code and they read yours, so you can share solutions and discuss ideas. Solid teams tend to write code in the clearest possible way and adopt conventions so everyone can understand it. This is comparable to pair programming (since each team uses one computer) or to the well-known code review pattern. Even in individual competitions, you read advanced competitors’ code after the contest to learn better ways of solving the problems. This makes you much better at reading other people’s code.
- Debugging. Every program has a high probability of containing bugs. In competitive programming, removing them — from your code or your teammates’ — is part of the job. This is a skill I personally value a lot, and it makes a big difference at work.
- Unit testing. Each challenge ships with a dataset to test whether your code solves the problem correctly. This creates the perfect environment for writing code you can verify against specific input — exactly like unit tests in any program you write at work. Some competitions even publish test cases before the problem, close to the TDD spirit.
- Interview prep. Most companies (especially the giants like Google or Facebook) use questions very similar to competitive programming challenges in their technical interviews. Practicing consistently increases your chances of landing a good job.
Where to practice
There are many places on the internet to practice. Some of my favorites:
- http://codeforces.com/
- https://www.hackerrank.com/dashboard
- https://www.codechef.com/
- https://csacademy.com/
Conclusion
Competitive programming does not cover 100% of the skills you need to be a great developer, but it is an excellent complement.
Feel free to share your opinion or any doubts you might have.
Mantente al tanto
Te avisaremos cuando la comunidad publique nuevos artículos, recapitulaciones o anuncios de eventos. Sin spam, puedes cancelar tu suscripción cuando quieras.
Sin spam. Puedes darte de baja en cualquier momento.
