Is competitive programming required to become a good software engineer?

Before we answer the question asked in the title, it is necessary to understand what competitive programming is? Why people are doing it? And what do they get from it? Once we answer these questions, we will be in a good position to conclude whether competitive programming is really required to become a good software engineer.

What is competitive programming?

Competitive programming is like a contest or sport where you will be given a problem statement which you have to solve using your preferred programming language in least amount of time.

In the above statement, we would like you to pay attention to two things

  1. Preferred programming language
  2. Least amount of time

We asked for your attention on these two because we believe that competitive programming teaches you a lot about them, let’s see how.

Preferred programming language

In a programming competition, you do not jump in with working knowledge of dozens of programming language. If you do that, you are bound to get one of the last positions in the leader board. Now, why are we saying this? See, programming languages are tools to solve problems and to solve a problem you need to have a good hang of your tools. So, it’s better to know one or two programming language and know it very well because in the competition you might not have time to search a particular way to do thing in the language which you are using.

Hence, when you keep using one or two programming languages to participate in competitions, you eventually become good at it which will be an advantage for you in future.

Least amount of time

As the name implies, you have to solve the problem in minimum amount of time both in terms of implementation and execution of the solution. Let’s talk about both scenarios.

In a competition, you have to come up with a solution very fast or at least before everyone else. This will give you an upper hand in the situation where you will have a bit more time to implement and debug the code to solve the problem. Let’s assume you come up with a solution which requires you to use lists and hash maps in it and you don’t remember or know how to use them in your programming language. In this case you will definitely search for it on the internet which will take up some time which will add up in your time taken to implement the solution, which might cost you some points. So, participating in programming competitions train you to implement frequently used algorithms and code patterns such that you don’t have to even think before writing these as it would come from the muscle memory which will save you a lot of time.

Now, your solution has been implemented but it has to run within the time constraint mentioned in the problem statement. Therefore, you must write an optimized solution to the given problem then only it will execute in the given timeframe and pass all the test cases. So, programming competition forces you to think in an optimal way to solve a problem.

Why people do competitive programming?

There are three main reasons why people like to do competitive programming:

  1. To learn programming, data structures and algorithms – mostly done by students and job seekers.
  2. To be a competitive programmer – this is like becoming a professional sports person. Mostly done by students and developers who have a vast experience in competitive programming.
  3. To keep their skills sharp – Mostly done by experienced developers in their leisure time.

Majority of the people lie in 1st category i.e. people who are either new to programming and want to learn it or people who are preparing for job interviews.

2nd category consists of programmers who take being a competitive programmer as a career (alongside with their primary job). They can generally be found on the first page of the leader board of programming competition.

3rd category generally consists of experienced developers who are responsible for creating and maintaining large and complex software systems, who have a lot of understanding of underlying system architecture. These developers do some competitive programming to keep their skills sharp or just to have some fun in their leisure time.

Is it required?

First of all, you should understand that software engineer is not just a person who only codes. A software engineer possesses different qualities, out of which one is programming. Competitive programming improves only this quality.

In real life, you won’t be using as many algorithms you learned and implemented in your competitions. But that doesn’t make software engineering easy as compared to competitive programming. As a software engineer you have to deal with large software systems which are made up of different sub systems which communicated with each other to create a complete solution. In such cases if you try to use your competitive skills and implement a feature or fix a bug quickly then either you will end up with a incomplete/buggy implementation or your code might get rejected in code review because you are not habitual of writing human readable code. And this is just one example out of hundreds where your competitive skills can make you a liability on your team.

So, is it required? Well, the answer is not as simple as YES or NO. It actually depends on who are you and what do you want to achieve. Let’s discuss about some scenarios which will answer to most of the situations.

  1. You are a student and
    1. Just starting out – You should definitely actively participate in competitive programming. You can give 60 – 70% of your free time to it and rest can be given to learn more about programming languages and build very small applications with it.
    2. Been doing it for 1 or 2 or more years – In this case you should not give more than 30 – 40% of your time to competitive programming. You should be spending more time in building projects or doing an internship or work as a freelancer. This is the time where you have programming skills but don’t know how to use them. So, try to get some real-world experience.
  2. You are working professional (junior and mid level) and
    1. You are looking for a job change – You should be focused more on learning about the things which you worked on and you should at least give 20% of your time in learning data structures and algorithms through competitive programming.
    2. You are not looking for a job change – You should not give more than 10% of your time to competitive programming. Instead focus on knowing more about the project you’re are working on and technologies related to it.
  3. Remaining – Up to you. If you want do it otherwise don’t do it.


In a nutshell, competitive programming is a great way to increase your programming and algorithmic skills but to be a good software engineer you need more than just that. So, you should include competitive programming in your journey as per your experience level.


Comments

Post a Comment

Popular posts from this blog

What is object destructuring and spread operator in JavaScript?

What are filter, map and reduce functions in JavaScript?