The buzz word now a day is competitive programming. In the last article, we have described how anyone can start their journey in competitive programming. Do check that before you move forward with this article.
Well, in this article we will be making it simpler to achieve that level of confidence in you in the world of competitive programming. Although don’t worry, most of them are free resources, and we will just be organising them to get you started with.
Starting with a language:
- If you are a student, you must have a lot of time to explore various languages and the ones which will suit you. If you are comfortable with Java to get with it, if python, C++ anything just starts with it.
- I personally feel for a beginner python is easier to learn, although C++ can give slightly better performance in coding contests. Anyway, it’s up to you in which language you want to get comfortable with.
- Go into a bit depth, like studying some of the popular libraries like STL (Standard Template Library) in C++.
Once you have chosen your language get started with data structures. These will help you navigate your thoughts to implement a code.
Start with the simpler ones like:
- Array, List, LinkedList, stack, queue, priority queue, tree, Hash Map etc.
- Start playing around with these, implement some solutions using these.
Following are the links for necessary beginner data structures:
- Arrays – https://www.geeksforgeeks.org/introduction-to-arrays/
- Linked List – https://www.geeksforgeeks.org/data-structures/linked-list/
- Stack – https://www.geeksforgeeks.org/stack-data-structure/
- Queue – https://www.geeksforgeeks.org/queue-data-structure/
- Strings – https://www.tutorialspoint.com/cplusplus/cpp_strings.htm
- Tree (Not much necessary for the beginning) – https://www.geeksforgeeks.org/binary-tree-data-structure/
- Solve and practice at least 40-50 questions from these sites clearing out the basic fundamentals of the implementations.
- Along with this also start learning about the time complexities of your code. It will help you analyse your code much better.
Well, to be honest, this is the most vital part of competitive programming, and also one of the most dedicative part too. Algorithms are your way to the top of the leader board.
It decides how fast and efficient is your code than others. Initially, you might feel difficult to comprehend but be patient, gradually you will be soon designing your own algorithms once you have profound conceptual depth in this.
Start with the below-mentioned ones:
- Maths for Competitive Programming Beginners: As most of the beginners’ contests nowadays have a lot of maths-related problems.
- Euclid’s Algorithm
- Prime Number
- Greedy Algorithms
- Sorting Algorithms, specifically Quick Sort, Merge Sort, Heap Sort, Insertion Sort along with their time and space complexities
- Binary Search
- Dynamic Programming (a bit advanced topic)
A good practice I recommend is whenever you have solved a problem do analyse and write in your code itself as a comment, the time complexity of your code.
This will also help you to search for efficient solutions and analysing your algorithms.
Getting to know about various contests:
- Hackerrank: You can get a lot of beginner editorials and solving organised problems one after another. You can also get many companies which are hiring from here.
- Codechef: This site is good for having regular contests. Codechef has generally three contests that run along a month, the first one is a long challenge were in a window of 10 days you have to solve 8-10 questions.
This gives ample time to research a problem and come up with a solution. This immensely helps in concept building. I would personally recommend you to start with long challenges.
- Annual Snackdown is definitely an interesting competition from this organisation.Then comes the cook-offs which is a time-restricted contest where you compete with coders worldwide and also earn ladders along with CodeChef goodies for the achievers.
Another such contest that is organised if Lunchtime having the same concept, it tests your speed and problem-solving abilities.
- Codeforces: This site is quite similar to Codechef although here you can expect more exposure to worldwide participants as people from around the world participate in a contest organised by Codeforces.
Also, the good thing about Codeforces is that they also publish official editorials for learning purpose. Here contests are divided into three divisions according to the ratings, so when you rank higher in the leader board your ratings get improved.
Although as a beginner do not worry about ratings. Focus more on understanding and coming up with a solution first, later you can focus on optimising your solution.
- Top Coder: I recommend this platform for international exposure along with the higher difficulty of problems.
It also organises TCO open community competition where competitive programmers from around the world participate. Apart from these we also have Google code jam, hash code, ACM-ICPC (kinda Olympics of Competitive Programming).
These competitions have lucrative prizes along with the enthusiasm to win these competitions already should make you excited enough, right?
Also here goes the links –
Google CodeJam – https://codingcompetitions.withgoogle.com/codejam
Google Hash Code – https://codingcompetitions.withgoogle.com/hashcode/
ACM-ICPC – https://icpc.global/
Basic Problems for Competitive Programming to start with:
This link contains atcoder DP contest which has quite all the basic dynamic algorithm problems as the base for learning dynamic programming.
BFS and DFS – Breadth First Search and Depth First Search are very important algorithms based on stacks & queues finds it’s uses in quite a lot of other algorithms.
For further interesting problems, you can also follow my GitHub repository.
The main motive is to keep on coding as a passion. I would recommend not to continue this just for the sake of interviews, if you genuinely fall in love with programming, Competitive Programming will definitely enhance your interest.
Hope this gives you a perfect roadmap to start your journey with Competitive Coding and helps aspiring developers and programmers.
Do keep on following this for more on resources on coding your way out. You can also check out our in-house practice platform, CodeStudio.
By Aniruddha Guin