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:

  • https://www.codingninjas.com/codestudio
  • https://www.hackerrank.com/
  • https://www.codechef.com/
  • https://codeforces.com/
  • https://www.topcoder.com/community/competitive-programming/ (Only after you are comfortable with advanced problems)
  • https://atcoder.jp/

Also attaching well known worldwide competitions:

Frequently Asked Questions

How do I start competitive programming?

This entire article has been dedicated to the steps and methodologies one needs to follow, to begin with, competitive programming. Summarising, learn a programming language, understand all the programming concepts, practice on competitive programming platforms and be consistent with your practice and competing in contests.

Which competitive programming sites are good for beginners?

A few websites which are good to practice competitive programming include hackerrank, codechef and once you are comfortable with reading and understanding competitive programming problems, move on to codeforces.

Is it necessary to do competitive programming?

Necessary is relative. If you want to have fun solving puzzles with the help of math and coding, competitive programming is the best.

Can competitive programming get you a job?

Competitive programming helps you prove your mettle as a coder and displays your ability to work under pressure and against time therefore sometimes companies do contact the top performers and at times hiring contests also occur on competitive programming platforms.

How can I get a job at Google?

For getting a job at product-based companies such as Google, the first and foremost requirement is to have strong programming concepts which include data structures and algorithms but are not limited to it. In addition to this, you need to have a drive for technology and the heart to become a true ‘engineer’.

Is competitive programming secret to a job at Google?

Absolutely not. You might begin competitive programming with the mindset that you will get a job at a company but that won’t make you love the intricacies of competitive programming. It is an art, not a subject and it is imperative you do it because you like doing it and not because your senior introduced it to you as a ‘secret to a 6 figure job’.

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