# Get Started with Competitive Coding!!

*Competitive programming is a mind sport usually held over the Internet or a local network, involving participants trying to program according to provided specifications.*

Competitive Programming is an interesting activity which mixes problem solving with programming. It is not only enjoyable but also very demanded in placements. A lot of big tech companies like Facebook and Google hire through Competitive programming contests.Competitive programming will make you very good at writing efficient programs quickly. If you get really serious with competitive programming, it will make you an expert in data structures and algorithms.

So how to get started???

**Step #1: Choose a Programming Language**

Choose a programming language you’re most comfortable with. Most problems are set with C/C++ and Java programmers in mind, so knowing any one of them will be really helpful.

If you know only C, you can easily start. But at some point of time (especially when you reach advanced stages), you’ll need features which most languages have but C does not. Learning C++ is very easy if you know C. I’ll suggest that you start out with C and learn C++ in parallel with competitive programming.

Even if you are not confident of your skills in a programming language, you should still start.

**Step #2: Make your first step**

Most websites will give you a specification and ask you to write a program implementing that. You will then have to submit your code. Your program will be automatically compiled and run and you’ll be told whether it ran correctly or not. Such websites are known as online judges.

Here is a small list of the most popular ones:

Apart from that, there is also a website called Project Euler. Project Euler does not ask you to submit code. It has direct problems. For example, their problem 19 asks you to count the number of Sundays on the first of the month during the twentieth century. You’ll need to write code to find this out (since you can’t solve this by hand). But once you have written the code, you just need to run it, find out the answer, and submit the answer (not the code). Project Euler can help you easily start.

But I recommend that if you choose to solve problems on Project Euler, do it only when starting out. It has advanced problems as well, but I think solving problems on online judges will help you learn faster and is a better use of your time.

You should stick to just one (or maybe two) online judges when you start.

**Step #3: Learn Basic Data Structures and Algorithm Concepts**

Nearly every coding problem will require the usage of a specific data structure or algorithm for an optimal solution. Knowing basic data structures and algorithmic techniques before you start is a must.

Here is a list of data structures to learn:

- Array
- Linked List
- Stack
- Queue
- Tree — For programming competitions the most used tree variations are Binary tree, Binary Search Tree, N-ary Tree, Segment Tree, Red Black Tree and Heaps
- Trie
- Graph

Some important Algorithmic approaches:

- Sorting — Bubble sort, quick sort, merge sort being the most famous ones.
- Dynamic Programming (DP)
- Greedy Approach
- Recursion
- Divide and Conquer (D & C)

**Step #4: Practice**

Try to solve at least one or two questions everyday. Practice day and night. Participate in online competitions.

Often while practicing, you will not be able to solve some problems. Do not give up easily! Keep trying! But sometimes even after trying for hours, we are not able to solve it. In those cases, it is advisable to look at the editorials. Editorials are step-by-step explanations on how to solve a problem. Often you’ll find new innovative ways of solving problems on reading them. So sometimes you should read editorials even if you have been able to solve a problem.

You should occasionally take part in programming contests. Many websites host contests regularly. You should not be disheartened if you are able to solve only one or two questions. This is natural when starting out. With regular practice, you should become pretty good.

Hope this helps.