Getting started with Competitive Programming - Build your algorithm skills
Tags: programming, cp, sportprogramming, algorithms
Published: 2018-10-08 05:28:49

---
title: Getting started with Competitive Programming - Build your algorithm skills
published: true
description: A step by step guide on how to get start with competitive programming and building your algorithmic skills
tags: programming,cp,sport programming,algorithms
---

![cover](https://s3.us-east-2.amazonaws.com/devletters/covers/matrix.jpeg)

> First posted on [my email list](https://aviaryan.com/letters/getting-started-with-cp)


I started Competitive Programming as soon as I got into college, around 2014. 

And I seriously continued with CP till 2015. 

My career was only for a year. But I [learned a lot](https://devletters.com/letters/why-competitve-programming/) during that time since it was my #1 priority.

Before we go any further, you might be thinking why I left CP. 

This was because I got interested in open source back then, and creating cool GitHub projects became my new hobby.

Was that a good decision?

That only time with tell. But with the future plans I have, it seems to be a good decision.

So let's start this guide to Competitive Programming.

## Step 1

Learn C, C++ or Java. If you can learn C, you can learn C++ and I will highly recommend that.

Why? Because C++ has the STL which has Set, Map, Vectors etc. These can come very instrumental in solving certain kinds of problems.

I have never used Java but seeing that some pro coders ([uwi](https://codeforces.com/profile/uwi)) like to use it, I think it's a good choice too.

Again, don't use Python, Ruby, etc, for CP. These are very high-level languages that won't give you as much control over your code as is needed. 
And they are painfully slow.

## Step 2

Get on [Hackerrank](https://www.hackerrank.com/). 

I recommend Hackerrank because it has the best User Interface, combined with relative ease of getting started for the beginners.

Ease in the sense that anyone with zero CP/algorithms experience will be able to solve the [first few questions](https://www.hackerrank.com/domains/algorithms). 

You might get stuck after first 4-5 questions and that's normal. In that case, feel free to see the editorial or google to look for the solution.

When you find it, make sure to understand it, and then code it on your own. 

First, solve "Easy" questions of all sections, and then "Medium" questions. 

In fact, solving some "Medium" questions is good enough to call yourself a CP professional.

## Step 3

Get on [Codechef](https://codechef.com/) and [Codeforces](https://codeforces.com). 

Codechef long contests are the best in the business, and Codeforces is well known for its 2 hr rounds.

Try to give both and see where you are good at. 

Developing your Competitive Programming skills requires that you are both fast and are able to think deeply about a problem.

Codechef long challenges = Deep thinking AND Codeforces rounds = Fast coding

If you want to be good, you should try to be good in both these areas.

But it's fine if you are just good at long challenges (deep thinking) or just good with short contests (fast thinking), both will help you become a better programmer.

## Step 4

You can try Topcoder if you want. Or just let it be.

With CP, if your goal is to get offers from Google HQ and likes, you will have to do it regularly. That is, give contests, try to rank higher, and build your rating.

Otherwise, you can just do it on the side and focus on building other practical skills.

These practical skills combined with your decent competitive programming experience will go a long way in helping you secure those jobs and internships you dreamed about.

## Alternative Route

You might already have some CP experience and might be looking to learn some algorithms. In that case, go through this list of [algorithms by Codechef](https://discuss.codechef.com/questions/48877/data-structures-and-algorithms). Practicing even the top 20 of the lot will make you an above average Competitive Programmer.

You can also find a good list of algorithms at [GeeksForGeeks](https://www.geeksforgeeks.org/fundamentals-of-algorithms/). They are separated by topics and you can learn the ones at the top OR the ones you have heard about.