A Beginner's Guide to Competitive Coding
Tags: beginners, computerscience, cpp, java
Published: 2022-08-12 14:39:00


### By Samrat Chakraborty
Competitive programming teaches the art of breaking a problem into small pieces and making working solutions for them. Besides, for development one needs to learn a whole new language or framework (JS, CSS, Django etc.).

One can get started into competitive programming with basic languages taught in school like C++, JAVA, and Python.


## Getting Started:

### 1) Learn a Programming Language :

![Programing languages for Competitive Programming](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8xw0t05j9rs6i1w1nkmj.png)
 
Some of the most used languages for Competitive Programming are:
- C++ 
- Java 
- Python 

Although Python is simple and easy to learn, it is a relatively slow language. In fact, it is not even allowed in a few competitions. 

Java is preferred by some people but its codes are longer to write. Also, you may get TLE(Time Limit Exceeded) in some cases due to being slow on the time limit side.

C++ is fastest among Python and Java and is comparable to C. It offers you a very powerful Library(Standard Template Library) which makes many things easy for Competitive Programmers.(Eg: Predefined Functions for sorting, searching, Vectors, Sets, Maps, Pairs, etc.)

### 2) Start practicing and take part in Contests :

![Sites for competitions](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t11ngekxc114c3wquy09.png)
 
As a beginner, start solving the Problem Solving section on Hacker rank. Cover Topics like:
- Implementation 
- Strings 
- Sorting 
- Searching 
- Greedy
- Bit Manipulation 

Proceed in order of Easy-Medium-Hard. 

Try to get 6 stars in it and you will begin to feel that you have learned a lot of new things. Your code length will decrease and you will begin to write more efficient code.

Meanwhile, take part in contests on sites like CodeChef and Codeforces as they are a great way to learn some new concepts. In the beginning, you may find the language of problems a bit hard to understand but after some contests, you will get used to it.

Also, don’t forget to up-solve the problems which you were unable to solve in the contest.

### 3) Learn Data Structures and Algorithms:

![DSA for Competitive coding](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nk6255bp0kzdkscxyeuy.png)
 

While practicing and taking part in contests, get your hands dirty in Data Structures and Algorithms.

It is the most important part of coding where you learn how to make your program more efficient. Having good knowledge of Data Structures will help you in selecting the optimal Data Structure for a problem.

## Some Do’s and Don’ts that you should keep in mind:

- **While practicing on any platform, do not look into the solution/editorial without giving your best.** Peeking into the solution will not do any good for you. Always give your best to find a solution to a problem.

- **After the contest gets over, always try to up-solve the problems which you were unable to solve in the contest.** This is where the real learning starts. Look at Editorials and discussions.

- **Do not hesitate to look at the solution of other people/friends after the contest.** Maybe your friend’s approach could be better than yours.

- **Do read Blogs on Codeforces written by High Rated Coders.** You will get to learn a lot from them for sure.

- **Do not stick just too easy problems.** Get out of your comfort zone and challenge yourself. Start solving problems that push you.

- **Do not worry about ratings on various Coding Platforms.** Rather focus on your growth. Your ratings will automatically increase if you focus on learning.

- **Do not get demotivated or disheartened if you cannot perform well in a contest** or cannot solve solve a problem. It happens, just learn from your mistakes and try not to repeat them.

- **Competitive Coding is much more about practice.** It takes time to become a master in it. So never give up unless you don’t enjoy doing it and never have self-doubt upon yourself.

## Wrapping up:

Over this blog you have learnt how can you start your Competitive Coding journey and what Do’s and Don’t you should follow.

Also if you are a newbie to the world of coding you can join the Crazy Codigo’s community as its weekly _COW (Coder Of the Week)_ competition will help you gain a lot of knowledge and experience and will help you start your journey. 
![Crazy COW competitive coding contest](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a51l15g9z6pryyyboz3l.png)
 
For any further help u can join our [Discord Server](https://discord.gg/XgDDB7BwPa) and we can grow together as a community!

Bbye :)

~ Sam