Some of my classmate are good at competitive coding but the 'software' they create is just horrible (nested if/for/while blocks which are 5 levels deep, overly complicated code, stuff which can be simplified by just throwing in some POJO's).
Is the fact that I'm bad at competitive coding a symptom of something serious (weak foundations in algorithms/data structures)? Am I missing out on something?
You're a classical programmer, down to the book. Hit the keyboards just like you learned. It's sometimes good and very desirable.
However, when there's a party going on, and one is needed to freestyle, come up with new sounds and styles on the go, the preference is for a Jazzy programmer.
You can be both, and being one and the other is missing out. Sounds like you will thrive at an enterprise, but suffer at a start up. Now here's the crazy thing, even jazzy types can thrive at enterprise, they are usually the super heroes that wire up the core plumbing of the system. If they get into the ears of one of the high level Cs, they will be paid more than everyone else, they will come in fast with their cohorts, wire up the new system, and no matter how messy, the rest of the classical types get to play only on top of what they built.
Given the choice between being one or another. I rather be the competitive messy code, at least they can solve the problem. The worst thing I've seen is the classical clean programmer, who has "designed an amazing system, UML, nice code/directory layout" tons of clean code, comments, and the dang thing doesn't work.
You can “jazzily” improvise your way through higher levels of abstraction just as much as you can immediate control flow. The folks OP describes aren’t really exhibiting a skill that’s useful in production at all. They’re just venturing out into the creative arts of coding. They break rules to do interesting things. Which is cool, and might sometimes correlate with commercially useful boldness or cleverness, but isn’t a particularly well-tuned signal.
The pressures of competitive coding can open up new ways of thinking about code and about problem solving. But there’s still a big leap from there to any kind of good engineering, startup or enterprise or other.
Idolizing the OP’s coders is only helpful if what they’re doing (competitive coding) is what you want to do. It doesn’f speak to commercial value.
I remember once I found a series of if statements that were so convoluted I needed boolean logic to make sense out of it. In the end, it turned out that half of it was duplication. Nobody could make sense out of it so they simply added on to it each time they had to edit the file.
I'm not convinced that buggy clean code would be worse in that situation: the buggy code would have gotten fixed long ago because it would have been easy to see what was wrong and then fix it.
Maybe. Assuming equal practice/preparation time, they're smarter than you.
No big deal.
All it means is that they're better at what competitive coding tests for. There's nothing about being "smart."
If you are bad at competitive programming, it most likely means you don't truly understand algorithms/data structures, and you have a weak problem solving foundation. It's harsh, but it's most likely true. The good thing is that you can improve your problem solving skills depending on the time you spend.
Does this affect you? If you want to work at FB/Google/Microsoft or any Big 4/FAANG company, you will need to be at competitive coding to some degree since all the interviews are based on these types of questions. If you want to excel in your job/get promoted quickly/go into management, then obviously other qualities and skills, especially networking, are 10x as important. But at the same time you will need to jump ship periodically to advance quickly in your career, which will require staying sharp and constant interviewing.
Overall, if you're an ambitious person that wants to excel in SV, competitive coding skills are paramount for interviewing. Of course, there are other ways to "make it": start-ups -> getting acquired/IPO/becoming a VC. So you don't need to go to FAANG. For those things, skills like people selection/business prioritization are 10x more important. If you don't give a shit about status/money, then you don't need to care about competitive programming because lower-tier companies won't care too much about that.
The bottom line is that it's not hard to learn OOP concepts/structure/abstraction or fucking whatever other coding guidelines there are. It's just a bunch of best practices. If I had to say it in one line, it would be that if someone is good at competitive programming, they can get good at designing software. The opposite is not necessarily true, because problem solving isn't something you learn in a day. So there will be more demand for people that are good at problem solving, who will be valued higher. Hope this helps.
Coding professionally is a long game with lots of human elements. Competitive coding is a short game where you only need to worry about the machine that's judging you.
I would say competitive programming is much more about math than software engineering.
I would say all these skills are useful to be good SE but you also need: * good code organisation * very good semantics skills (domain modeling, naming) * debugging skills (correlated to problem solving) * conversation skills (posing precise questions and answers) * beeing comfortable with ambiguity and change of requirements (especially startups) * being able to work with/fix shitty abstractions that less(sometimes "more") skilled people come up with
For average job even CS degree is overskill.
Also competitive programming is tons of fun so I would say you're missing out by dismissing it.
I was somewhat involved in the programming Olympiads in high school and to a lesser degree icpc style programming in college.
And later when I founded my own startup - I thought these competitive programmer types would be great hires. But in reality it’s been a bit of a mixed bag. Real world software engineering is about readabiliy, maintenance, extensibility, etc - the actual data structure and algorithm work is typically minimal (which these competitive programmers relish on) and even then you’d probably want to delegate to some battle tested open source library.
Of course I don’t want to hold having a competitive programming background against the candidate but no longer prioritize that skill set.
As a metaphor, think of programming competitions as something like fencing. The best fencers have a good athletic ability.
There are jobs like fire/rescue which require a base level of athletic ability.
But that doesn't meant that a good fencer will be a good firefighter, or vice versa.
More specifically, there are ways to practice to be good at code competitions. You can get old tests and practice them. You can drill at writing some of the basic data structures so you can just crank them out. Some schools have programming teams where they do this sort of practice every week.
But these aren't part of the standard CS curriculum, almost certainly because it isn't that relevant to what most people want from a CS education - neither for students nor for potential employers.
In general, I would say while there might be some useful concepts there, you are not missing out. It's an interesting form of programming but not the same as what you would expect to do at work.
Terrible analogy but I'll go with it: just like how you'd probably never be expected to Iron Chef your way in a formal restaurant. You don't have a bunch of random ingredients and present what you can as long as it fits the theme. The customer asks what they want and if you don't have it or can't have it, making something else isn't acceptable most likely so the proper way to handle it is to ask the customer what they want instead and you give them your sincerest apologies.
If you weren't good at sprinting and running, would you be worried that you were a bad walker? Would you see it as a symptom of something serious? Of course not.
I'm not sure how relevant it is for work, but its fun. I think people generally grow to the level of competency their environment demands of them. If you need to work on your problem solving at work, you can just work hard at trying to solve more problems at work and self-study in whatever way you like.
One angle though: its fun to work on this stuff. If you want a job where you can do more fancy problem solving and less plumbing, who knows, maybe somebody would hire you for winning one of these?
The number 1 is not that essential. But the number 2 is somewhat essential for day to day work.
Being able to code faster for programmers is like being able to run faster for footballers. It's not everything obviously. But if you can code much faster, you will be a better programmer.
Being obsessed with coding speed is also like being obsessed with running faster. After a certain threshold, it's probably not that helpful.
Anyway, at first, I didn't believe that there would be anyone who could code like 5x-10x faster than me. From practicing a div-1 level-3 problem in topcoder.com, even if I read up the answer, it still takes me like 1-5 hours to implement a solution. A champion would take like 30 minutes including finding the solution.
It was like WTF moment. How could people be that different?
Be aware that somebody can code 10x much faster than you is probably what you might miss out. Once you are aware of that, you know you probably can practice, at least, to be 2x or 3x faster.
Reminds me of competitive math contests in school, it didn't mean that the smartest people knew how to apply it to real life to solve problems for people that were valuable.
You absolutely have lots of value to learn, become, and add. Programming is about practice, practice, practice, so build, build, build.
Put in your time, never think you've arrived and you'll never stop arriving at cool things along the way.
My colleague is good at both of them. And somewhere I feel, being good at competitive coding helps you develop an approach towards solving a problem. It also comes in quite handy when you have to make performance optimisation. Atleast that is what I observed with my colleague.
You should try to develop the logic by solving these questions!
Cheers
However, note that people who are good at competition literally trained writing common algorithms fast - there is zero value in that. I knew people who could write graph search with closed eyes in various vatiations and that made them save time in competition. That is irrelevant anywhere else. They also learn and train a lot more and harder algorithms - there is some but still little value in that unless you like it.
Tldr; if you struggle with algorithms 101 (binary tree, graph search, minimal path, etc), then it is good to learn them. If you are very slow, it is good to practice to become faster. Anything else is hobby/interest - do it if you like it, do it if you want to do it in the future.
Ability to write readable code actually valuable.