How to get started with Competitive Programming?

How to get started with Competitive Programming?
How to get started with Competitive Programming?

Competitive Programming is pretty much the key term that we all hear these days, right? People getting into FAANG, cracking difficult coding interviews and at the base of all of this is what we are going to learn about.

So, don’t worry we will be laying the complete roadmap of how to start competitive programming, how it shall help you, whether it is necessary for interviews or not and so on. This article will cater to the needs of students who are still doubtful about whether it will be of any help or not. Let’s start with what really is this Competitive Programming.

 What is Competitive Programming?

Like any other sports/games competitive programming is a mind sport incidentally more like chess and other mind sports. It’s more of a problem-solving game given a problem faster efficient and more classical ways. The more you practice the better you get at it. It is recognised worldwide as a mind sport and every year a large number of contests and competitions are held worldwide to promote this along with various prizes, interview opportunities with huge firms, prizes etc. If that’s not lucrative enough, just to let you know there are coders who just participate in these competitions as their job even.

To start or not to start Competitive Programming

In recent times competitive programming has gained huge popularity because of its uniqueness and gradual popularity has welcomed a huge number of organisations along with participants to engage in this sport. Many startups and firms have also started having interview rounds based after shortlisting candidates from these competitive coding contests.

Well, competitive programming enables and enhances the problem-solving ability of the programmer. Organizations search for candidates who have excellent problem-solving capabilities as languages, frameworks, technologies can be learnt at any point of time but the concept or logic behind complex solutions depends upon the thinking capabilities for solving a problem.

So, although it is not necessary to do competitive programming but it does help in building the problem-solving skills. Caution that you should only continue it from you love for coding or passionate about it else most of the time people lose interest and leave mid-way without making much progress. Personally, do give it a try without losing patience for some time, I feel most of you would fall in love with it.

What is needed for competitive programming?

Just a knack for programming. Really, all you need is a computer, an internet connection and a knack for programming that’s enough to get you started. Now, most of the current contests for beginners on various programming sites require some basic knowledge of a programming language to start with. Even there are contests for beginners which involve pretty much simple ad-hoc problems which are best for enhancing your confidence.

Roadmap to start Competitive Programming

Interested enough to move forward with how to start? Let’s put forward few points step by step –

  • Learn a language and go to the depth, understanding the bits & bytes of that language. (p.s. also don’t go for a PhD in that language either). You can start with any language Java, Python, C++ anything that suits you but also looks for the code lengths and memory usages of each before moving forward with a particular language as it hugely affects your performance time in contests.
  • Start getting comfortable with a coding site with a good interface like Hackerrank and solve quite a few numbers of problems from them. Why choose Hackerrank? Its recommendation system takes you slowly and gradually with increasing difficulty and building up your confidence.
  • Learn data structures and libraries of that language. For example, for Cpp – arrays, strings, LinkedList, stack, queue, recursion etc. and STL (Standard Template Library), these will help you immensely in writing shorter better understandable codes and also improve your performance.
  • Solve at least 40-50 questions from Hackerrank and make yourself comfortable with the IDE.
  • By now you should have gained much confidence and we are ready for moving into contests in sites such as Codechef, Codeforces etc. Start with long challenges in Codechef, where you will get 10 days’ time to solve 8-10 number of questions, particularly this is best suited for beginners as it gives ample time to research about a problem and come up with a solution.
  • Maintain Consistency, be patient and try to push yourself out of your comfort zone by revisiting the questions which you were not able to solve after every contest. Do them urself again. Watch editorials, other’s solutions after the contests if you are not able to understand it. Although as a beginner do not engage more than 30 mins for a question if you are not able to find an answer.
  • If possible, find someone with the same aim of competitive programming for pair programming. This helps to learn by other’s mistakes and also improve one’s ability to think out of the box.
  • Start learning Algorithms along with the contests, algorithms can help you clear your confusions, there are few algorithms which are difficult to visualize when starting as beginners. Algorithms will help you to optimize your program and is one of the most vital factors in ranking in contests as it hugely affects your execution time.
  • By now you will be familiar and confident with most of the contests, now its time to move up to higher levels. Start by participating in international competitions like Google CodeJam, TopCoder contests, ACM ICPC etc. If the right amount of hard work and patience is given you can definitely find yourself among the top participants in these contests.
  • Very importantly do not lose confidence if your ratings drop, do not give up. Initially, it will be challenging to maintain the consistency but it’s very fine and quite everyone goes through this phase.

Already a developer and want to start competitive programming?

Well generally, being a developer, you will require more problem-solving skills rather than participating in contests. But its never a bad idea to improve your skills for such. Competitive programming will never disappoint you. You will always find something to learn every time. The best thing that you will get from this is various kinds of optimising algorithms which you can use to scale and optimise real-world projects.

Lets also list all the sites and IDE where you can practice:

Also attaching well known worldwide competitions:

I hope this article can reach out to most of the dilemmas of starting competitive programming and also bring out the interest in it. Stay tuned for all the resources that you might require for smooth sailing into this journey of competitive programming. Hope this article helps aspiring programmers and developers. Meanwhile, you can check out our Competitive Programming course and blogs to take a quick look.

By Aniruddha Guin