Open In App

What is Competitive Programming/Coding and How to Prepare for It?

Programming… Competitive Programming… It teaches you how to think?. If you are a programmer, you might have understood the deep meaning of these lines quoted by Steve Jobs and you might have also experienced that even after shutting down your computer you keep on thinking about programming stuff or code you have written in your project. Once you enter in programming you just don’t learn how to code but you also learn the “art of thinking”, by breaking your code into smaller chunks and then using your logic-based creativity to solve a problem from different angles. Programming is fun, programming is an exercise for your brain, programming is a mental sport and when this sport is held on the internet involving sports programmer as a contestant, then it is called Competitive Programming. Check what Wikipedia says about Competitive Programming. 



Why you should prepare yourself for this game and participate in it?

Programming is a challenging role and once you enter this field you will encounter new challenges and you may have to solve some problems which no one has solved before or their solution doesn’t exist anywhere. At that time, you are expected to come up with a solution in the least possible time using your problem-solving and logical ability. So the one and clear goal behind this competitive programming is To prepare a programmer such that his/her logical ability increases and he/she is able to write code for the challenging situation.Another reason is that a lot of big companies, like Google, Facebook. Microsoft, Amazon hires through competitive programming, so if you want to get into these companies, then you really need to get your hands dirty in competitive programming. It doesn’t matter if you are a newbie programmer or you have written some code before, we will tell you some steps, approaches, and tips to prepare yourself for competitive programming. Let’s discuss that in detail. Keep in mind that you need to be proficient in the following:

https://www.youtube.com/watch?v=qZNRKB0uR5o



How to prepare yourself for Competitive Programming?

1. Choose a Programming Language: Firstly, you need to choose a programming language that you are most comfortable with and learn its syntax. It can be anything C, C++, Java, Python, or any programming language. Programming languages are a tool through which you can communicate with the computer and instruct what to do. C++, C or Java is a faster programming language in comparison to any other language. Also it is allowed to, use in any coding challenge or interviews. So it’s good if you choose one out of these three, still there is no restriction if you are comfortable with another language. If you are a beginner, you can go with python because it’s easy to learn and syntax is user-friendly. If you have at least an intermediate hold on any of the programming language, you won’t face difficulty in writing the code using the syntax of it. 

2. Understand the Concept of Time and Space Complexity: In most cases there is more than one solution that exists to a problem, so you need to come up with the best solution, i.e an optimal one, and that’s decided by how much time and space an algorithm takes to solve a problem. So it’s really important to learn about these two concepts to write an optimal solution to the problem. 

3. Learning the Fundamentals of 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 what, when and where to apply them. It means which data structure is suitable for what type of problem to get the optimal solution. You should know how to apply a perfect combination of both in the coding problem. 

4. Take the Challenge and Solve Coding Problems: You have learned a programming language, you have learned time and space complexity and you have also covered the fundamentals of DSA, now it’s time to take the knife in your hand and kill the lion in the jungle. Yes…you need to take part in coding challenges on different coding platforms. Before participating in a contest it would be great if you practiced for some challenges on your own and then participate there. If you are looking for the resources of these coding platforms, so a lot of sites are there, such as Geeksforgeeks, Codeforces, Codechef, Topcoder, SPOJ. Start from the basic level on these sites 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 on these sites…

5. Practice and Do it Regularly: Your patience, dedication, and consistency are very important for becoming a good competitive programmer. Keep practicing the coding questions every single day on these platforms or you can also take the help of a whiteboard to solve coding questions, but the important thing is to do it regularly. Do not make a mistake of taking a break from it once you start. 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. Your daily practice makes you a perfect coder, a 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. Tips:

Some Tips for Improving Speed in Programming Contests.

Remember, improving your speed in competitive programming takes time and practice. Be patient with yourself and keep practicing consistently.

Programming really needs a lot of patience, so don’t get discouraged or DO NOT GIVE UP IF YOU GET WRONG ANSWERS. This is the point where most of the people lose interest in programming. Keep trying for a day, week, months if a voice inside your head says that your method is right. If you can’t find a solution google it, ask for help if you don’t get the topic, read the various approaches that coders took to solve the problem but don’t quit. Also, you can read the solution only if you are completely sure that you have made a lot of effort and now you can’t do anything. But make sure to code again the same problem. You will start improving day by day only and only if you maintain your consistency and don’t stop.

I am Attaching this article  https://www.geeksforgeeks.org/competitive-programming-a-complete-guide/amp/ as it covers the necessary resources and must do questions which is an essential part of your CP journey.

I Hope it helps. Best of Luck And Happy Coding.

The biggest mistake programmers make is probably getting discouraged and not practicing enough. Or practicing only on problems they feel they’re good at. – Derek Kisman, aka SnapDragon


Article Tags :