How to start with Competitive Programming

Sumit Kumar Sahu
Nybles
Published in
4 min readJul 15, 2020
Photo by Emile Perron on Unsplash

There are plenty of answers out there on how to start competitive programming but what I found missing there were proper links to resources.

Here I will try to include all the steps and resources, I followed on my beginning days of programming.

Quick Links to most useful resources :

  • CC Handbook : Best Resource out there to learn CP !!! . It is highly organised and contains almost every STL, Data Structure and Algorithms one uses in CP.
  • Codechef DSA Learning series : Contains a variety of Standard questions on DS Algo. This is still under build and new topics get added every week.
  • Code Monk : Contains problems sorted on basis of the Algo used and toughness. Has a very friendly Hackerearth Environment.
  • CP Algorithms : Along with the tutorials it also has very efficiently written codes for every data structure and algorithm.

Step by Step guide :

  1. Learn a language : I opted C++ as a extra subject in class 12.So, my process of learning language was pretty easy and slow (2 years of school teaching) and I won’t be able to comment much on it.

I can suggest some approaches my friends used though.

  • Select a language : Most of my friends and I use C++ as it has lots of resources to learn. Some use java. You can go with anyone you like.
  • You don’t need to learn entire language : Input/Output, Operators, Conditional statements, Loops, functions, Arrays, Strings would be more than enough to start. Rest (very few things) you will gradually while doing CP.

Resources to learn C++ : Hackerrank Tutorial for C++ Learn only the above mentioned topics. You can skip OOPs part like classes, inheritance etc.

If you prefer video lectures(for Java) : Java + DS + Algorithms — YouTube

2. Start by solving basic Math and observation coding problems : I highly recommend it before jumping into learning Data Structures and algorithms. You will get a direction on how to think and implement it on code. These problems usually don’t require use of any Data Structures and algorithms, and thus are best for beginners.

Resources : Problemset — Codeforces Here you can sort the questions on basis of rating tag. Start from easy problems and when you get confident at that level, try higher[Rating tag] problems.

You can solve first 2–3 problems of past Codechef Div-2 Long contest. link

If you get struck NEVER LEAVE THE QUESTION UNSOLVED. Read the editorials get some hints, see others solutions.

3. Learning STLs : You can learn them from the above mention CP Handbook. But just knowing them won’t help if you have not implemented them in code. Here you need to do some work as I didn’t find a link covering all STLs at on place.

Google the STL on which you want to practice. Most probabaly you will open GeeksForGeeks search result. There you can solve some problems on a STL to get confident on them.

Some resources : Hakcerank STL Tutorial, Hackerearth STL Tutorial

Codeforces implementation Tag questions are also mostly solved by STLs but not all of them will require the need of STL. Some will require just Basic loops and conditional statements. Problemset — Codeforces

4. Data Structures and Algorithms : OK !! I discussed 1% of the process. Rest comes now.

You can learn them from CP Handbook or the resources given in Codechef DSA Learning Announcement sections or from CP Algorithms. But to really get the feel of them you need to

for(int i=1;i<100;)PRACTICE();

and PRACTICE!!!

Resources : Hackerearth CodeMonk: Contains problems sorted on basis of the Algo used and toughness.

While understanding some DS and Algorithms you may get really struck. You should opt for video lectures then. GeeksForGeeks and many other youtube channels have a plenty of them. Just google the Algo you want to learn.

No, I didn’t forget step value in the above loop. You will get better and confident on Data Structures and Algorithm every time you use them.

5. Start participating in contests : Here you will use your real problem solving skills. While learning DS Algo, you somewhat know that this Data Structure or Algo will be used here. So it gets a bit easy. But in contests you have to gather all the key points in question and approach the solution.

Real fun of coding comes in contests. BELIEVE Me.

That Adrenaline rush while solving the question, that increased Heart-beat when your solution is queued for submission and that big smile when You see Green Ticks all in the screen. You will surely love it.

The last part mentioning the green ticks occurs rarely Though :(

Contests : You will find links to them on their homepage.

  • Codeforces : Div3(for beginners) and Div2. They have started div4 also but only one contest has been conducted till now. Div2 and Div1 runs in parallel.
  • Atcoder Beginner contest : Good for beginners
  • CodeChef Long : You can’t miss it !!!
  • Codechef Cookoff : Get ready to cook some excitement.
  • Codechef Lunchtime : In India it is conducted at the time of Dinner though.

Errichto on how to start CP :

William Lin :

Do follow their youtube channel. They stream many contests and publish video tutorials for them. You will learn a lot from them.

At end, if you are starting to get nervous seeing so much to learn, COOL DOWN. Learning CP is really a fun process and you will surely enjoy it.

Please suggest any improvements or some other useful resources you feel worth adding.

If you find this helpful, do share among your friends.

About me-

I am Sumit Kumar, Member Competitive Coding Wing, Geekhaven IIIT Allahabad

--

--

Sumit Kumar Sahu
Nybles
Writer for

UnderGrad at IIIT Allahabad, Member Competitive Coding wing Geekhaven, IIIT Allahabad