from Hacker News

Competitive programming is useless

by pbrw on 8/23/21, 11:25 AM with 150 comments

  • by jcranmer on 8/23/21, 1:41 PM

    I'd disagree with this assessment. In my own experience, I've found that competitive programming is useful in teaching a few skills. However, the apparent point of competitive programming--building up a good repertoire of advanced algorithms and data structures--is pretty close to useless. In my professional career, the most complex algorithm I've ever had to code myself is ... union-find (on like two occasions), with a custom BFS/DFS being the most common algorithm I reach for. Almost everything you will ever need is already implemented in a library for you to reuse, and even reaching for that library is pretty rare.

    No, the most useful impacts of competitive programming has to do with actually teaching you how to program effectively. The most important advice I got for competitive programming was walk away from the computer. The biggest trap when programming is to write code before you know how to solve a problem, as this will tend to encourage you to spend all of your time making no progress towards actually getting a solution. The tale of the Sudoku solver [1] is salutatory here.

    Another useful skill is how to debug algorithms. Debugging a competitive programming problem usually amounts to taking an input that fails and trying to understand where in the algorithm (as expressed in poorly written and commented code!) the mistake is. Doing so under the time pressures of a competition also requires being able to rapidly decide if the algorithm is wrong, or it is the implementation is wrong, as well as figuring out where the most likely places for errors are likely to creep in. This kind of experience translates very usefully into professional programming, and debugging is a skill that seems to be poorly acquired by most young programmers.

    When competitive programming hits the tier where you need to memorize all of the advanced data structures and algorithms to do better, that's where further improvement in the leaderboards no longer translates to better programmers IMHO. But there's still a lot of skills that need to be acquired to move up competitive leaderboards before you reach that point.

    [1] https://ravimohan.blogspot.com/2007/04/learning-from-sudoku-...

  • by commandlinefan on 8/23/21, 2:46 PM

    Reminds me of a comic I saw:

    Interviewer: How do you swap two variables without using a temporary variable?

    Candidate: x = x + y; y = x - y; x = x - y!

    Interviewer: You're hired!

    ... two months later ...

    Boss: What the hell is this code you wrote?

    Programmer: I swapped two variables without using a temporary variable!

    Boss: You're fired!

  • by kwertyoowiyop on 8/23/21, 12:59 PM

    > Assuming for a minute that students from lesser tier colleges are less smart (possibly untrue but again a discussion for another day)

    Let’s discuss it now: they are NOT ‘less smart.’

  • by eat_veggies on 8/23/21, 2:08 PM

    Competitive programming is useless, but most things are useless! And here "useful" only means useful in the context of building and evaluating skills for industry. But my friends who do competitive programming do it because it's fun, and some of them don't even want to work in tech when they graduate!

    There is a kind of pleasure in connecting the pipes and optimizing the loops and building a sick dynamic programming recurrence relation or whatever; we desire these flows. Who cares what skills they build?

  • by cush on 8/23/21, 3:47 PM

    Hot takes like this suck all the life (and not to mention diversity) out of our profession. Every competitive coder I've ever met does it because they think it's fun.
  • by hvocode on 8/23/21, 4:19 PM

    Competitive programming is fun. It’s amazing that some people seem to think everything is about career path optimization.

    Are we not allowed to do things for fun or just to pass the time anymore without someone writing that we’re wasting our time since it isn’t boosting our career?

  • by stevesimmons on 8/23/21, 6:20 PM

    The article leaves out one very important skill: teamwork.

    Teamwork is tested very well by contests like the ACM ICPC programming competition: teams of 3 people, one computer, and 7 or so problems to solve in 5 hours.

    Speaking from first hand experience, my team won the ICPC (many years ago...) based totally on coaching on our teamwork. Essentially, we arrived in the competition city 5 days early and somehow got adopted by the coach of another country's team (which said they didn't need her help). She spent those 5 days observing us approach each phase of the contest, and gave feedback on every aspect on how we worked together: triaging the problems in the first minutes of the contest, who to allocate which problems to, optimising sharing the single computer, when to switch when stuck, helping each other debug, etc, etc. Right down to how to lay out our stationery and stack our working notes on the table.

    After doing 2-3 prior competition problem sets a day for 5 days, we became an amazingly efficient machine. Not because we were individually better problem solvers (thought there was some improvement there). But because we all instinctively did the right things in the right order, there was no dead time, no miscommunication, and no stress about our performance versus others.

    Thanks to Raewyn's coaching, we converted probably a 5th place into a convincing 1st place. And she'd already won 1st place with her own country's team two years earlier.

    So the focus on teamwork paid off. Both in our contest, and in work situations subsequently...

  • by nikita on 8/23/21, 2:50 PM

    I'm been following competitive programming for years and know multiple extremely successful "grads" of IOI and ACM ICPC. I have an ICPC bronze medal myself.

    The HN crowd will know Adam D'Angelo (IOI Gold) - cofounder of Quora and Nikolay Durov (IOI ICPC Gold) - cofounder of Telegram. My personal examples are Singlestore (billion dollar company) which I cofounded and Near Protocol - 5Bln market cap crypto company cofoundered by Alex (ICPC Gold). There are also numerous fantastic engineers that have competitive programming under their belt working for tech primes and startups.

    People who win are usually very very smart. AND they learn to work hard - you can't win without great work ethics. Skills wise you learn many algorithms and data structures cold. Plus you learn how to write small program with very few bugs from the the first try. Do they come out as complete package of a well rounded engineer - no, but there are years ahead to learn and they are trained to learn fast.

    Bottom line is I can't disagree more. People familiar with the subject are often lucky to have the team and come with great network of nerd friend. Of course you will find people from this world who don't succeed, but more plenty become fantastic engineers.

  • by Mikios on 8/23/21, 12:49 PM

    Technology can change after few years, but strong foundations can be helpful for many years.
  • by oenetan on 8/23/21, 1:17 PM

    Algorithms are important, competitive programming isn't in my opinion
  • by fatjokes on 8/23/21, 1:31 PM

    This post really is a rant as the author forewarns, with barely any cohesion and no evidence to back up anything. I fear it has gotten upvotes simply because it's a popular opinion.

    I don't think it's worth a detailed response so I'll just respond to the reductio ad absurdum in their tl;dr, that competitive programming has been taken to extremes (implicitly by employers).

    This is plain untrue. Sure a lot of interviews I've been through ask for a coding exam, but in this day and age that's just a wise precaution and no company that I've heard of would hire based purely on that outcome.

    I've met (interviewed) too many candidates who can sweet talk their way through any technical matter but barely know how to use a couple of for-loops. This isn't a surprise---the push toward driving down the cost of software engineering labor means that there's a massive volume of people churning through the bootcamp machine.

  • by exdsq on 8/23/21, 2:00 PM

    I find it fun to do, like chess or video games. But people on these sites grind challenges for hours a day over months purely to game interviews, which is sad but probably not pointless.
  • by andreygrehov on 8/23/21, 2:12 PM

    Competitive programming is just like a sport, as in every sport some people may like it, some may not. When it comes to programming interviews, companies do not try to check how good your competitive programming skills are, but they measure your will power, eg whether you were able to commit time to learn and understand DS&A in such a way that you can easily juggle them.
  • by BrandoElFollito on 8/23/21, 2:52 PM

    I like the coding challenges we have at the office.

    The ones who want come to solve a few riddles (this is a nation-wide competition), food and drinks are provided, we have the opportunity to chat a bit and I can claim my last place, live every year.

    This allows people who like these kind of things to get together in a relaxed environment.

  • by hey31212 on 9/6/21, 10:12 AM

    hmm. how so? before we rationalize this statement, ask yourself. what is your current skill level in competitive programming? how good is your C++/Python/Java/etc. and understanding of DS/Algo? If all the answers to these two questions are great then congrats, you're great! otherwise... just think about that question, ever felt passionate or enthusiastic about something? competitive programming can be a passion, competition, both of them. if you think it is useless, then passion is useless, solving is useless, problems are useless... competition is a way to keep improving ourselves! improvement sure isn't useless at all isn't it?
  • by decebalus1 on 8/23/21, 4:00 PM

    > Competitive programming is a good tool for building the programming muscle. An extreme pursuit of competitive programming is worse than useless. Unfortunately, companies and students are both headed in that direction at the moment instead

    So if both companies and students are heading in that direction then it's not that useless, isn't it?

    This is a low effort anti programming interview difficulty inflation rant.

    But anyway, competitive programming is one thing, tech interviews are another thing if you want to get technical about it. Mostly different set of skills are cultivated by each.

    Finally, saying competitive programming is useless is equivalent to saying golf is useless (for example). Some people really enjoy competitive programming.

  • by tester756 on 8/23/21, 2:42 PM

    Time to start asking more about security and OOP on interviews

    OOP is kind of topic that everybody is expected to know, yet for some reasons there are huge gaps between people when it comes to proficency at it, at modeling systems and domains correctly.

  • by forkLding on 8/23/21, 2:17 PM

    I think competitive programming is useful as an interview style if you want to learn a language and gain that development intuition of stop, think, clarify, design, code and test. But do I think people are taking it too far? Definitely.

    A typical comment or interview experience on Leetcode is that they take 3 months to prepare and do algorithms questions for FAANG interviews to pass the interview. In the process, some individuals skip class or other things. I don't think that is right personally.

  • by deltasixeight on 8/23/21, 2:34 PM

    There needs to be science on this. Some way to quantitatively measure the performance of programmers who do competitive programming and to measure ones that don't.

    Until then everyone will agree or disagree but some science will prove a definitive answer. It is very much worth doing such science given the prevalence of testing a programmer for such competitive skills and the fact that many consider such skills useless against the actual daily tasks of a programmer.

  • by mvanaltvorst on 8/23/21, 3:56 PM

    Competitive programming is fun and trains quick and accurate problem solving. You can critique the fact that modern programming interviews seem to be too focused on short leetcode problems, but that is an entirely different field than competitive programming.

    "Mathematical textbook problems are useless, because scribbling mathematics in a notebook is not best practice! Real mathematicians exclusively spend their time writing academic papers."

  • by makapuf on 8/23/21, 1:08 PM

    From my point of view, the correlation is definitely not 1, but while competitive code is not good code, and therefore the skills and discipline differ, there is a strong correlation between good competitive programmer and good programmers. Just like sprinters and marathonians, sure best sprinters are not necessarily the best runners for long distance, but they are definitely better than me.
  • by backprop1993 on 8/23/21, 1:54 PM

    I did competitive programming. I believe you need to push yourself to your limits to understand what your limits are and why you may have some. It helps with self-understanding. One can then figure out how to go further, faster.

    On a side node, it was in competitive coding that I first ran into students using Ritalin for performance enhancement. Until then I had never run into it before.

  • by sage76 on 8/23/21, 2:25 PM

    Years ago I managed to clear super competitive algo/DS rounds for a big firm and then failed spectacularly at the job, because I had no idea what they were talking about half the time the projects were being discussed.

    I wish they had just asked more pertinent questions and saved everyone some time and me the humiliation.

  • by low-rank on 8/23/21, 3:11 PM

    well, it's kinda funny that taking leetcode as an example of competitive programming, my man...
  • by levmiseri on 8/23/21, 2:31 PM

    Just a tiny bit offtopic, but for a different kind of competitive programming, I made https://yare.io (1v1 StarCraft-like RTS, but you control units by writing javascript).
  • by wilmer05 on 8/24/21, 9:27 AM

    I never get offended by any news. But this one is on the limit. On my case I wish I would have started before with competitive programming. I learnt skills that almost no one has and I think is one of the skills that makes me unique.
  • by bayonetz on 8/23/21, 3:12 PM

    Obviously it’s not useless if people find it useful such as the people who compete. By some metric you care about it may be “useless”, but who made you the arbiter of metrics? Competitive programming may or may not correlate with success at say software engineering, but that isn’t grounds to say it’s useless. An Olympic archer may or may not be a terrible bow hunter in the wilderness but they still have a clear skill that is useful by metrics such as people want to watch it, practice it, and compete in it. Dualist thinking like this where things are strictly good/bad, useful/useless, etc. is a really limiting thought pattern. How about instead of “is this thing useful OR useless?” we ask “in what ways is this thing useful? In what ways is this thing not useful? How can we best leverage these properties?”
  • by 8589934591 on 8/23/21, 2:03 PM

    EDIT: TLDR: There are bigger issues at play at the country's economic level that students take up skills (CP) to get the best paying job possible. This in turn drives companies to make interviews harder to separate rote memorizers from the crowd. I don't see this going away anytime soon and although I agree that leetcode questions aren't the best measure, there is no better alternative as an interviewer to quickly filter out candidates.

    ---

    > As a response, college students now pursue competitive programming obsessively to stay on top. In this weird arms race against prospective hires, companies keep asking harder and harder questions in a misguided attempt to raise the bar.

    You should understand that more students pick it up because of the higher salary offered in the tech industry in your country (India) and this is one of the best bets to lift themselves and their families economically. To be fair, I don't blame them, majority would pick up ~CP~ <job/skill> because it has the highest returns for the effort put in. It's a fault in the system, not the students.

    Personally I would be wary of anyone who says only competitive programming excites them. I feel that testing algorithms and data structures in some slightly realistic situation is the only way to weed out the pretenders.

    Anecdotally, I have interviewed screening rounds from junior to senior. The juniors who pretend to like programming are usually filtered out when I change the application of the data structure slightly as compared to a leetcode/geeksforgeeks question. Something as simple as "reverse a paragraph/sentence" as opposed to "reverse a string".

    Mid level candidates are the most difficult to filter out and this is exactly where the leetcode type questions come into the picture. They are able to talk about their projects as if they designed the entire stack. I have seen them draw the system design diagrams, tell me pros and cons of the stack/tech chosen, but they would usually fail in easy/medium level leetcode questions.

    Seniors are the easiest to filter. We give them the easiest question possible and ask them to solve it. This is done with a huge disclaimer that this is a screening round and that the intention is to see you can actually write code and answer questions about it in real time. Questions are easy array/string leetcode setting them up for success. The good ones just finish it up in hardly 10 mins and move on the the design round following immediately. The bad ones just beat around the bush saying they wont code despite the disclaimer. The really bad ones are ones who cite N yoe so they shouldn't be tested on coding (this is when the senior dev steps in and recommends not to proceed with the interview anymore).

    Coming back to the article, unless you have candidates/people who are actually interested in building software, and only when other jobs around you on avg pay a decent amount of salary for the place you live in, I am positive people will do everything they can to get the best ROI to become more sustainable in life. This is evident in > 5 yoe hires when people are in a more stable posn in tech economically and as interviewees they realise what they like/dislike and as interviewers you can discern whether they can actually do the job properly.

  • by ovebepari on 8/23/21, 12:57 PM

    I understand the rant but I would like to hire someone who are good at solving problems (of any kind) and can detect the edge cases very well and without deep math or competitive programming knowledge, it's not possible at all these days.

    However, I am an undergrad myself and sometimes I take pride in being a generalist, spent my fair share of time on every abstraction layers of CS possible. Now that I'm in my final year, I'm concentrating to know more about *nix system internals, doing a thesis on Computer File Systems and occasionally doing Competitive Programming to be a better problem solver.

    I understand the rant.

  • by da39a3ee on 8/23/21, 4:29 PM

    There's a lot of complaining about algorithms/data structures interview questions. But at the end of the day it is up to the hiring companies how they want to triage and select candidates. Rather than complaining, what would be more compelling is evidence that companies using these sorts of interviews are actually damaging themselves. At the moment, the most successful tech companies in human history are using those sorts of interviews, so the burden of proof seems to fall on the complainers.
  • by kadoban on 8/24/21, 1:23 AM

    Who cares? It's fun.

    Oh you're using it to pick who to hire to write mostly CRUD apps? Yeah, don't do that.

  • by hey31212 on 9/6/21, 10:15 AM

    here's the thing, it all comes to attitude. most people who like to solve problems would think otherwise. i think it's healthier in the long term to be more optimistic about this field rather than be realistic.
  • by naveen99 on 8/24/21, 3:40 PM

    Typing speed contest in the Olympics ? Sounds like fun.
  • by thallukrish on 8/24/21, 7:48 AM

    Anything competitive is useless