If you are in college, irrespective of the stream, and are interested in programming and related kinds of stuff, I can bet my last penny that you have heard the word “Competitive Programming” at least once. Thanks to its massive popularity, competitive programming is becoming one of the prerequisites to grab attention during internship and placement interviews. Although many have the required knowledge and experience, what about the newbies who are yet to explore this domain?
Here we go:
What is Competitive Programming?
Competitive programming is a contest for the programmers who grind their brains trying to find solutions to a given set of problems in minimum time and space complexity. Held for a certain amount of time, the final rankings are based on how many correct and partially correct solutions a coder has figured out for the problems.
The questions usually revolve around real-world problems and the solutions to be submitted has a maximum space and time limit. It compels the programmers to find out the most optimal solution, passing all the hidden test cases, similar to the scenario in the corporate world.
How to Start and Explore Competitive Programming?
To try our hands-on and explore our chances to excel in these contests, we need to follow a few steps:
Step 1: Get to the depth of a suitable programming language.
If you are starting, I would recommend you have a firm grip over any programming language. You can pick any language of your choice like C++, Java, Python, and learn all the basics till the intermediate level, if not advanced.
Step 2: Have a clear understanding of Data Structures and Algorithms.
Given a set of 10 problems, like that of Long Challenge in CodeChef, the easiest one or a couple of questions can be solved using basic coding knowledge. But to solve the rest, you need to understand the data structures and ponder over how to write efficient algorithms. In some problems, particular data structures form the basis, without sufficient knowledge of which all those lines of question will appear Greek to you.
Step 3: Pick out suitable websites.
There are tons of websites online which provide you with a base for competitive programming. The most renowned of them are CodeChef, Codeforcs, HackerRank, and Topcoder, to name a few. Although the skeletal structure is similar for all these websites, there are some minor alterations in each of them. Try to go through the most popular websites, solve problems, get acquainted with the scenario, and choose the best 2-3 websites to continue further.
Step 4: Participate in every contest that comes your way
This step is where most newbie competitive programmers lag. If you aren’t in a dire situation, never miss the coding events. Turn on notifications or mail updates from the websites of your choice that will remind you of the upcoming contests.
Step 5: Take special care of the unsolved questions
Take all credits for solving the problems during the contest. But unless you are a pro at competitive programming, there will be questions that you couldn’t solve during the event. Those are the questions that will offer something new to learn. In most cases, editorials containing the tricks and the solutions get published by the websites soon after the contest. Have a look and understand where you missed the shot. In the opinion of the experts, the best tactic would be to jot down the explained tricks for future reference.