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.
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
Post a Comment