avatarMichael Bao

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2320

Abstract

/p><h2 id="41b3">Doing CP for Competitions</h2><p id="e762">If you are going to do competitions, then you can do the following. Do practice problems on a site (I would recommend <a href="https://codeforces.com/">Codeforces</a>). And do the problems that have editorials so that if you are stuck, then you will be able to look at the editorial and figure your problem out. Also, if the editorial uses a data structure or algorithms that you don’t know, then you can search it up and learn more about it so you understand it thoroughly. This is so that if you see the problem again, then you will know how to solve it.</p><p id="4aa7">Keep doing this and do competitions so that you can test your skills. When you get to a high enough level like being able to solve almost all if not all of the problems on a Div. 2 contest, you can probably qualify for IOI, and with more practice, you can get to ICPC.</p><h2 id="b71d">Doing CP for Interviews</h2><p id="2752">On the other hand, if you are going for interviews and don’t really care about competitions, then you can first learn some of the algorithms and data structures.</p><p id="2f7d">Then do some practice problems using the website, <a href="http://leetcode.com">Leetcode</a>, and the book “Cracking the Coding Interview.” Leetcode mainly has practice problems and some competitions, while the book is largely compiled of practice problems, data structures, and algorithms that are written in Java.</p><h2 id="8898">What NOT to do</h2><p id="71e5">There are many pitfalls that people fall into while trying to learn CP, and some people don’t even know about it.</p><p id="0c46">The following are a few of the many mistakes that people fall into.</p><p id="ab94"><b>Comparing yourself to others</b> is a horrible thing to do. You are probably told this by everyone no matter what you are doing, so I keep in short and sweet. Comparing yourself to others destroys your mentality that you are good at something and completely abolishes your motivation to learn, and could hurt your life dramatically. So, please don’t do this.</p><p id="375e"><b>Looking at ranking too much</b> will, like most sports/competitions, decrease your motivation to do contests and make your think of yourself as a person who is not good enough. Don’t do this, but you can look at the leader

Options

board and ranking to how much you improved and use that improvement to help drive your motivation.</p><p id="df81"><b>Copying and pasting code</b> is a horrible thing to do, and it can be tempting when you are just doing practice problems and being very confused. Don’t do this, because it won’t help you at all, and will only make you worse. Everyone is still learning, so please don’t do this even if you have been stuck for a few hours, it will do you no good.</p><p id="bfcc"><b>Inconsistency </b>is a grave danger for everyone, no matter what you do. You could practice for 5 hours, and then the next day you do only one problem (which usually takes around 20–30 min). This is horrible because eventually, you will get to a point where you don’t have the motivation to do it. We usually don’t actually great motivation every day, but consistency helps build a habit. If you still have trouble do CP consistently, then set a time for yourself to only do CP and nothing else. Once this becomes a habit you will most likely be set to do it for as long as you feel like it.</p><p id="02db"><b>Solving problems that aren’t challenging</b> is horrible because it doesn’t help you and wastes your time if you do it. It may make you feel better because at least you can solve some problems, but it does little good for you. Challenging problems help you; they don’t harm you. Everything you do will be challenging for as long as you do it because no one knows everything about a subject. So keep practicing the problems that are a little above your level but not too high.</p><p id="28c8">Doing these five things will greatly help your motivation and help you learn more quickly. But not doing these things may be more enjoyable but not beneficial.</p><h2 id="fb3f">Conclusion</h2><p id="34ce">Competitive programming is a great sport where people compete and learn new skills that will help their journey. Remember, everything takes time, consistently, and following the right steps. Going through the right steps and knowing your goals in CP will allow you to do well in coding interviews or competitions.</p><p id="490c">Enjoy the process of learning, embrace it, and do your best with the little amount of time you may have.</p><p id="26dd">Just remember to <b>keep practicing and keep learning</b>.</p></article></body>

Start Competitive Programming

Competitive programming is a great way to sharpen your data structures and algorithms, either for competitions or coding interviews.

Photo by Emile Perron on Unsplash

Competitions for CP (competitive programming) include IOI (International Olympiad in Informatics for high schools), ICPC (International Collegiate Programming Contest for college students), and other online contests which some you can get paid but are more real-world problems.

Where to get started

The place where you should first get is being able to do basic math, around algebra 1 or 2, and some linear algebra. After learning math, you can now learn a programming language, I would recommend C++ if you don’t know any other programming language, but if you do, then you can probably use that. Here is a great video on Youtube which I personally used, but there are also other great videos out there:

You won’t need to go through the entire video, but I would recommend going through around the first 6 hours of it. This will give you a foundation to learn more of the language while practicing. After you learn C++ so that you don’t need to search most of the things up, you can move on to learning Data Structure and Algorithms.

Doing CP for Competitions

If you are going to do competitions, then you can do the following. Do practice problems on a site (I would recommend Codeforces). And do the problems that have editorials so that if you are stuck, then you will be able to look at the editorial and figure your problem out. Also, if the editorial uses a data structure or algorithms that you don’t know, then you can search it up and learn more about it so you understand it thoroughly. This is so that if you see the problem again, then you will know how to solve it.

Keep doing this and do competitions so that you can test your skills. When you get to a high enough level like being able to solve almost all if not all of the problems on a Div. 2 contest, you can probably qualify for IOI, and with more practice, you can get to ICPC.

Doing CP for Interviews

On the other hand, if you are going for interviews and don’t really care about competitions, then you can first learn some of the algorithms and data structures.

Then do some practice problems using the website, Leetcode, and the book “Cracking the Coding Interview.” Leetcode mainly has practice problems and some competitions, while the book is largely compiled of practice problems, data structures, and algorithms that are written in Java.

What NOT to do

There are many pitfalls that people fall into while trying to learn CP, and some people don’t even know about it.

The following are a few of the many mistakes that people fall into.

Comparing yourself to others is a horrible thing to do. You are probably told this by everyone no matter what you are doing, so I keep in short and sweet. Comparing yourself to others destroys your mentality that you are good at something and completely abolishes your motivation to learn, and could hurt your life dramatically. So, please don’t do this.

Looking at ranking too much will, like most sports/competitions, decrease your motivation to do contests and make your think of yourself as a person who is not good enough. Don’t do this, but you can look at the leaderboard and ranking to how much you improved and use that improvement to help drive your motivation.

Copying and pasting code is a horrible thing to do, and it can be tempting when you are just doing practice problems and being very confused. Don’t do this, because it won’t help you at all, and will only make you worse. Everyone is still learning, so please don’t do this even if you have been stuck for a few hours, it will do you no good.

Inconsistency is a grave danger for everyone, no matter what you do. You could practice for 5 hours, and then the next day you do only one problem (which usually takes around 20–30 min). This is horrible because eventually, you will get to a point where you don’t have the motivation to do it. We usually don’t actually great motivation every day, but consistency helps build a habit. If you still have trouble do CP consistently, then set a time for yourself to only do CP and nothing else. Once this becomes a habit you will most likely be set to do it for as long as you feel like it.

Solving problems that aren’t challenging is horrible because it doesn’t help you and wastes your time if you do it. It may make you feel better because at least you can solve some problems, but it does little good for you. Challenging problems help you; they don’t harm you. Everything you do will be challenging for as long as you do it because no one knows everything about a subject. So keep practicing the problems that are a little above your level but not too high.

Doing these five things will greatly help your motivation and help you learn more quickly. But not doing these things may be more enjoyable but not beneficial.

Conclusion

Competitive programming is a great sport where people compete and learn new skills that will help their journey. Remember, everything takes time, consistently, and following the right steps. Going through the right steps and knowing your goals in CP will allow you to do well in coding interviews or competitions.

Enjoy the process of learning, embrace it, and do your best with the little amount of time you may have.

Just remember to keep practicing and keep learning.

Competitive Programming
Cpp
Interview
Recommended from ReadMedium