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.
This mind sport really need some reflexes like other physical sport games. This game is similar to other sport games. But we need more amount of practice and vast amount of knowledge.
How this would get me into the FAANG companies?
Every big tech companies conduct coding interviews at starting. Being a competitive programmer, you can crack it out easily.(Of course, if you have good knowledge in it.)
Now you would have got the idea about it! LET’S GET STARTED!!!
How to get started?
1. Pick A programming language
Some most used languages for Competitive Programming are C++, Java, Python. Although Python is simple and easy to learn, it is a relatively slow language. Even python is not allowed in some contests.
Java is also preferred by some people but the Java 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. C++ offers you a very powerful Library STL(Standard Template Library) which makes many things easy for Competitive Programmers. (Ex. Predefined Functions for sorting, searching; Vectors, Sets, Maps, Pairs, etc.)
I always use C++ and C mostly, if a problem can be solved in less time and not quite complex , mostly you would encounter these types of problems in ad-hoc tag in codeforces and codechef ,C programming language can be used. If a problem needs some Data Structure to solve within less time, then my preference is C++.
2. Learn DSA
This is the most important part 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.
Important Data Structures for Competitive Programming:
- Linked Lists
- Heaps (priority queue)
- Disjoint Set Union
- Segment Trees
- Binary Index Tree (Fen-wick tree)
- Trees (traversals, tree dynamic programming)
3. Participate, practice
Practice is the key to success in Competitive Programming.
There are many platforms out there where you can get to practice numerous problems. Now after getting some good knowledge of DSA, start participating in Short Contests.
Some of the most popular platforms are: