Skip to main content

The hairline difference between Competitive Coding and DSA

Competitive Coding and Data Structures and Algorithms, the go-to to ace Software Engineering interviews, are so close as to often be considered the same. And why not? Most Competitive Programming/Competitive Coding problems involve use of DSA, and thus, consider one as a subset of the other.

However, the difference lies not in the technicality, but in the approach and the constraints.

Competitive Coding is named that way for a reason. It means, that your ultimate aim is to get the answer, within limited time, with limited time and space complexity. Whatever you do it, however you do it. While efficient and correct use of DSA is often the most optimal solution, time, space constraints some times would not allow you to use that approach. Moreover, coding challenges, where Competitive Coding actually happens, have a number of questions, and most of the good coders prefer brute-forcing the solutions with more relaxed constraints, rather than working towards clean and optimal code.

For instance, where the time complexity constraints are around 10^3, most coders would prefer to brute force it upto O(n^3) and saving the time by thinking of an optimized solution, to spend on a question with more stringent constraints of, say, 10^6, where not even O(n^2) might be possible.

On the whole, it depends on the requirements that you pick out an approach : If you have to save time you work on a question, you try to just solve it, instead of optimizing it using the best Data Structure or Algorithm, however, if your method is taken into consideration, you are much better off using strong and optimal DSA concepts, rather than just getting the answer any how.

Comments

Popular posts from this blog

Internship Drive Preparation

Note: This blog is principally meant for students of DA-IICT, Gandhinagar for preparation for their internship drive. However, the methods and facts apply to most other colleges too and other students are equally welcome to go through this. Q1. What have I done to be qualified enough to write this? A1. I am Dushyant , BTech Third Year, DA-IICT, Gandhinagar. Most of the readers would have run into me during some sort of activity/event in the college, be it IEEE based, Dance, or Synapse or MUN. I did manage to get a Summer Internship offer at Deutsche Bank, though, and have worked with a few startups, too. But I have failed at many more attempts, and I will do my utmost to ensure that you don’t face the difficulties that I did. Q2. Why am I writing this? A2. The internship drive is one of the most challenging, mind numbing phases that you will have to brave throughout your college life. The grind starts April on, when seemingly the entire batch fights for the c...

When you feel like quitting (Compiled)

*Disclaimer : The entire content is not original; it has been taken from speeches of famous speakers, with some inclusions from the author's side. When you feel like quitting Remember all of those who said you'd fail When you feel like quitting, Remember why you started When you feel like quitting Remember what you are doing it all for When you feel like quitting Remember that pain is temporary and greatness lasts forever When you feel like quitting Remember that the pain you feel today would be replaced with the strength you need tomorrow Remember that every ounce of pain you feel is building A stronger you A stronger body A stronger mind And A stronger character So push through the pain Don't let it stop you Force it to grow you Don't back down from the pain Face it Feel no pain There is no pain That painful last rep? That's nothing!! Give me more!! Push harder!! Too tired? Too hard? Too busy? Too early? Too stressed? NO EXCUSES!!...