- What is Competitive programming
- How to practice Competitive Programming
WHAT IS COMPETITIVE PROGRAMMING ?
Choose a Programming Language
Firstly, you need to select a programming language with which your are most comfortable and then learn its syntax and rules. It can be any language C, C++, C++14, Java, Python, Python 3, Ruby etc. C, C++ and Java are faster programming languages with C being the fastest among all other available languages moreover they are allowed in almost every competition or interviews. So it’s good if you choose one out of these three still there is no restriction if you are comfortable with any other language.
Understanding Time and Space Complexity
In most of the cases there is more than one solution that exists to a problem so you need to come up with the best solution as we seen earlier in the post. So it’s really important to learn about these two concepts to write an optimal solution for the problem.
Learning Data Structures and Algorithms
DSA is the heart of programming and you can not ignore it while solving coding problems in competitive programming. Array, Linked List, Stack, Queue, Tree, Trie, Graph, Sorting, Recursion, Dynamic Programming all these basic building blocks of DSA will help you to become a good programmer. The most important thing you need to know where , what and when to apply them. It means which data structure is suitable for what type of problem to get the optimal solution. Practicing questions based on DSA will you in that.
Solve Coding Problems
Now you have cleared the beginner round and now its time to practice. You need to take part in coding challenges on different coding platforms. Before participating in contest it would be great if you practice for some challenges on your own and then participate there.
Start from the basic level and once you build the confidence, get out of your comfort zone and gradually try to solve the complex problems. Below are some points you need to keep in mind once you start solving problems.
- You need to understand the input, output and test cases on online coding platforms. Check the link Solving Problem on Codechef to get started on this platform.
- The online coding platforms run your code on a lot of inputs then take out the output and store it in one place. They also have the tester's code or author's code which is one of the correct code for the problem. They run the same set of input on correct code and create the outputs and after that, they match these two outputs. If these two outputs match then your solution is considered correct.
- You may freeze out in the beginning once you see the problems on these coding platforms and think that you are not made for it or your thinking ability is not much higher to solve these questions. The reason is as a beginner you just know the syntax of the language and some basic loops or function, so when you encounter these challenges you freeze out and start doubting on your capabilities which you should not do that. You need to understand that there is a process to learn competitive programming and you have to move gradually from level 0 to the top level 💪.
Practice and Do it Regularly
Your patience, dedication, and consistency are very important to become a good competitive programmer. Keep practicing the coding questions every single day on the online coding platforms or you can also take the help of whiteboard to solve coding questions but the important thing is to do it regularly. Do not make a mistake to take a break from it once you have started. Stick on it, no matter how difficult the problem is or how much time you take to solve a single coding problem. Participate in different coding competitions and learn from other programmers. As a beginner try to practice 100 different problems rather than solving 1000 same problems, because in your early stages you need to expand your critical thinking and problem solving skill. Your daily practice makes you a perfect coder, good problem solver and you will be able to find a suitable data structure for a specific problem and that matters a lot in software development.
Never Give Up!
Never say Never because limits like fears are often an illusion - Micheal Jordan
- Hacker-earth - Indian Platform
- Codechef - Indian Platform
- Codeforces - Russian Platform
- URI
- SPOJ
- Hacker-rank - Indian-American Platform
- Top-coder - American Platform
- At-coder - Japanese Platform
- Geeksforgeeks - Indian Platform