How to start Competitive Programming?

Mukul Kadyan on November 13, 2020

Introduction

Let’s be honest to ourselves:

What actually is Competitive Programming for you?

Well Wikipedia defines it as ”Competitive programming is a mind sport usually held over the Internet or a local network, involving participants trying to program according to provided specifications. Contestants are referred to as sport programmers. “

Competitive Programming is “life” for many,”fun” for others and a “motive” to earn or accelerate their careers for others.Competitive Programming is the best way to tackle all the interviews of Data Structures and Algorithms.

Here We will discuss what actually you gotta do to be a better competitive Programmer out there.

Following article will focus completely on beginners, all those novice and rookie programmers who don’t have an idea on how to start,where to start,What to start with?

Pre-requisites

Any Programming Language(C,C++,Java):

The most commonly used languages for the “sport” are C++,Java.Here We are more inclined towards C++ as:

  • It's Faster than Java.
  • Less Piece of Code.

The only advantage of Java is BigInteger.

To learn to code in C++, you can follow:

  • TutorialsPoint
  • GeeksForGeeks
  • Any MOOC(Udemy,Coursera,EdX,etc.)

The sites you must always prefer to practice just your coding skills in any language:

  • Hackerrank(Recommended)
  • HackerEarth
  • Spoj

Try to attain those “Badges” at Hackerrank to boost your morale.

Practice,Practice and Practice(the only Mantra..)

Once you are familiar with any programming Language, just be ready to give your everything because it’s not a game of hours or so called “Last Night Study”.

The best books for Data Structures and Algorithms are:

  • Cormen Data Structures And Algorithms
  • Lipschutz Data Structures
  • Competitive Programming,3rd Edition: Steven Halim
  • Data Structures Made Easy

Start Practicing Data Structures and Algorithms at :

  • Hackerrank (Problem Solving) ..(Most Recommended for beginners)
  • Spoj
  • LeetCode
  • Codeforces
  • Codechef Following tips and tricks might be highly beneficial for you;
  • Write before Coding -Implement all the algorithms or the approaches that you are thinking on pen and paper,Mathematics and writing yourself might be the best way to learn to code.
  • Solving Problems that are at the brink of your knowledge- This is a highly tried and tested method and recommended by most of the programmers.
  • Taste the HARD: No matter which site you choose for competitive Programming, make sure to do harder problems each passing day.
  • Be sure to check the memory limits and time limits
  • Check INT overflow
  • Start with Brute Force and keep on optimizing it.
  • Try involving any other geek like you (Believe me,it really helps)

Start solving the problems after sorting the problems based on maximum no. of submissions (in the case of Spoj,LeetCode,Codeforces and Codechef) and march forward.

And Just always remember that it takes about two-three months on an average to write clean and bugs free code and to solve those “tricky” questions. So don’t get stuck on any one question for the initial period,just google it and try to learn. Remember This is not “cheating” for rookie programmers.

The best sites to follow to get your doubts clarified :

  • GeeksForGeeks
  • StackOverFlow

These sites have an exhaustive material and that makes it highly likely to resolve your doubts.

Participate and Only Participate HereAfter..

Once you have attained a 6* in Problem Solving or have solved more than 50 problems at Spoj, you are all ready to test your coding skills in a real time contest.

Follow :

  • Codeforces(5-6 contests per month)
  • Codechef(3 contests per month)
  • TopCoder(only if you are able to type code fast)
  • AtCoder

SELF Motivation” is a MUST for the coding contests.

Convince yourself that you couldn’t solve all of those problems at the initial period of your journey.But make sure to read the editorials and try your best to be able to comprehend them(It’s Ok if you couldn’t).

Yes, dedication is important because you’re investing a large part of your time here! You have to get serious about your Competitive routine. You have to constantly analyze the problems which you couldn’t solve earlier or the ones which were taking a long time. Don’t get disheartened if you’re not getting a solution. Look out for help. Again solve until you become perfect. Soon you’ll realize it doesn’t take long enough to get to a Star Ranking on CodeChef.

Wait! Don’t get complacent! Solve tough problems. Remember during Engineering Exam preparation, some of us used to solve I.E Irodov problems in Physics. Why? Simple because we could differentiate ourselves from others and hence adopt the same here!

There are a lot of prestigious competitions and tournaments like ACM ICPC, Google’s Kickstart, HashCode, etc. Many of them are sponsored by big tech giants and there are absolutely big prizes!

Who knows you are the next Gennady Korotkevich..

HAPPY Journey Ahead :)......

Connect with me on LinkedIn
© 2021, Built by Harsh Vats