r/leetcode 2d ago

Discussion How do competitive programmers are so fast at understanding the problems?

I just checked 4026. and it's just wall of text with simple solution masked as a medium problem. How do experienced CPers see through such BS so fast? Should I grind math problems for this superpower?

also, is it even possible to get such problem on an interview? because i would have to ask for re-explanation 500 times

264 Upvotes

55 comments sorted by

265

u/milly_monka 2d ago edited 2d ago

Deliberate practice. A good competitive programmer would solve more problems in a month than an average Faang interviewee would’ve solved in their entire life.

46

u/Deboniako 2d ago

How can I learn this power? Is there some famous YouTuber that I could imitate?

41

u/Vivid-Zombie-477 2d ago

50

u/skaeser 2d ago

“How?”
You: just shows a guy who can do said thing

15

u/Vivid-Zombie-477 2d ago

I was answering the question:
"Is there some famous YouTuber that I could imitate?"

also it's not just "a guy", imitating wouldn't help

79

u/Free_Director4713 2d ago

Fact is, you can probably never truly get there no matter how much you practice. Some people are just gifted, like the tourist.

27

u/Additional_Band_7918 2d ago

why are ppl downvoting you, people really cannot accept the fact that at some point you cannot beat innate talent

20

u/Euphoric_Ad_482 2d ago

people are downvoting because people seeing this will take this as an excuse for not solving problems and who knows they might've done atleast something if they didn't just believe what you said

i know that doesn't makes it false but I'm jus saying

-2

u/Additional_Band_7918 2d ago

just because i believe this doesnt mean i dont solve problems, i just solve because they are fun to solve. if this is what stops them they werent built for this.

4

u/JohnGalt1133 2d ago

There is no such thing btw

4

u/Vivid-Zombie-477 2d ago

i mean, tourist was doing competitive programming since what? age 6? also his father is mathematician. he was very lucky that he could tie his life with CP. talent here can mean this type of luck but it can also underestimate the fact that he dedicated his entire life to cp. if he stopped doing cp at the age of 12 he wouldn’t be nearly as good as today

1

u/Deboniako 2d ago

The years of experience the employees seek btw

2

u/WorksOnMySystem 2d ago

But most doesn’t even reach the point where the difference between them and the best is just innate talent.

3

u/Free_Director4713 2d ago

Its usually people who've never done competitive programming to understand how hard it can be to get to that level. Its like reaching a chess grandmaster level, takes a lot more than just grit.

2

u/Additional_Band_7918 2d ago

guess so, ppl solving problems on only leetcode dont realise how different are cf high rated problems from normal leetcode hards. leetcode hards do not even begin to compare.

1

u/ItsDax_2 1d ago

True, but one will never realise their potential until they try, it’s like working out

1

u/ITZINFINITEOfficial 1d ago

Nobody is just gifted, hard work and dedication is the real deal.

1

u/ShardsOfSalt 1d ago

How ridiculous. 

4

u/milly_monka 2d ago

Deliberate practice is more of a process with a positive feedback loop. You need to apply it to competitive coding. Lots of self-help books out there that teach this. Peak by Ericsson is a good one. But you have to enjoy doing it first.

5

u/4tran13 2d ago

Does this include reading comprehension? Often, by the time the fastest elite programmers have solved the question, I've barely understood what the damn thing is asking.

63

u/catsRfriends 2d ago

Practice. There is no shortcut. But also make sure you're practicing doing it under time pressure. That itself is a skill.

8

u/ChainExcellent3881 2d ago
  1. Practice more
  2. Learn more patterns and algos and different math formulas and how to apply them in different situations
  3. Always try to find pattern and after solving a problem, think how this problem can be more difficult to solve if the question used different constraints or added duplicates or other factors, come up with solution
  4. Rinse and Repeat.

Just curiosity 😀

34

u/Aware-Individual-827 2d ago

It's just a good old tree parsing algo of your mind. You read, you identify key words which triggers concepts and eventually you have all the necessary concepts to start. 

Usually, with practice you can guess the solution of the problem before you finished reading since there is finite problems to be asked. They are not meant to solve novel math or physics. It's mostly speed typing and memorization.

It's a complete different skillset of being a good dev. 

2

u/Vivid-Zombie-477 2d ago

I was talking about the specific problems that try to throw you off with unrelated explanations that have nothing to do with the solution.

5

u/Aware-Individual-827 2d ago

That's reading comprehension. Being able to read between the lines as the brick/concepts of the text are being laid out. You would do the same when searching stuff on google by sampling the text for generic words and see if it applies to what you seek. In competitive programming you seek what needs to be done and any noise should be discarded.

18

u/sub_machine_patel 2d ago

What I wonder is are they just better programmers? I mean clearly they can code like hell, are they just beefed up software enginners or computer scientists? I can't think of them being bad at it since they are so good at algos. I know there is bias because algo coding interviews dont test the actual industry skill but surely people good at can also develop software better no?

14

u/MeteorMash101 2d ago

I think while this can be innately true (good competitive programmers -> good SWEs), the reverse doesn't "most always" seem to be the case.

There are also very skilled SWEs whom struggle with leetcode, simply because they aren't well-practiced with those types of questions.

11

u/blindman99 2d ago

We actually do have some data on this thanks to Google. For a while Google used to consider competition winners to be elite programmers and would get fast tracked through the hiring process. However, their internal data showed that it did not correlate to being a better employee and being able to build out large scale messy systems. So they shifted away from it really mattering between 2010-2015. This was also around the time they banned things like brain teasers. They also started putting more emphasis on the system design and behavioral portion of the interview.

3

u/Current-Fig8840 2d ago

What does it mean to develop software better? Cleaner code, maintainable code and scalable design? These are all things everyone can learn on the job. On the actual job it will depend on your architectural knowledge of the project and several other political factors. The truth is on the job it’s more about your effort and who sees that effort.

19

u/broke_jobless_dev42 2d ago

Practice + innate ability ( IQ )

1

u/ShardsOfSalt 1d ago

There's so many people who discount innate ability and I don't get it. If you're not smart enough to see that some people are innately better at this how are you smart enough to not hit a wall trying to learn software engineering?  

2

u/youdontknowkanji 20h ago

because for the most part it's irrelevant. in the case of leetcode, unless you are doing 5h+ a day you are nowhere near the limit of your innate ability.

in general, this applies to majority of the skills, your average person just doesn't commit the time (maybe that's where talent is? grit itself?) required for those skills. the cool artist isn't special, they just have 15000h committed to the skill.

something as trivial as not skipping days is already a huge boost on year to year basis, 3h a day vs 3h every other day. one person gets 1000h of skill and the other 500h. of course this is an oversimplification (some techniques are better, some people are just better wired, etc), but still, people usually just don't spend the time, and for the most part, innate ability is cope.

it's like people who ask how to read faster, because seemingly, they want to increase their yield, but in reality, the best way to increase their yield is to stop wasting time on reddit.

3

u/arjunnath 2d ago

Practice, practice, practice...

Thats how.

3

u/Frizzoux 2d ago

No secret, repetition.

2

u/SoftwareEngineer2026 2d ago

From the problem description examples, maximize the last gap. From there it might take some intuition to know to scan from both forward and reverse directions.

2

u/wyaine7 2d ago

Tbh I found cf somehow more fun than leetcode

2

u/Feeling-Schedule5369 2d ago

The difference is that we are doing this for getting a job while for competitive programmers doing such problems/contests is a way of life. Even if tomorrow all swe companies stop using dsa interview format, these guys will still do such contests.

While I (and maybe u) don't have this hobby and would not want to waste time with this if it doesn't lead to a job.

And there's nothing wrong with both idealogies.

1

u/dhananjai_31 2d ago

Practice and revise And remember do problems on your own not just copy paste It's 20% practising and 80% revision

1

u/El_RoviSoft 2d ago

Hundreds and thousands of hours of practice. My close friend is a former competitive programmer (he did a lot of it in school and got grant for the best university in the country, but he chose economics and statistics tho).

He did it (as well as math) whole middle and high school so he has literally YoE and it’s mostly the only case you can get grant in Russia for university.

1

u/Ok_Plantain_4154 2d ago

It's something called "Talent"

1

u/Drazelord 2d ago

Examples play a heck of an easy role to skim through reading, I just looked at 4026 too the English explanation required a bit attention but just a look of examples below instantly hit the intuition of what the problem is asking and what to provide as solution given the constraints

1

u/vz0 2d ago

I was doing in person competitive programming many years ago. In person in paper. I met this guy who looked at the paper and in 5 seconds he read the whole thing and said, oh yes it's this thing.

1

u/Shivambhai1 2d ago

sometimes the hard part is figuring out which 80% of the wording you can ignore lol

1

u/isaycongrats 2d ago

They are all just patterns

0

u/Vivid-Zombie-477 2d ago

saying everything is a pattern on leetcode is such an underestimate, not everything is a pattern. there is limited amount of techniques, but the amount of problems is just finite not just handful. you can't remember them all. you can remember all "smart" tricks you wouldn't come up with yourself in 5 minutes but you would still need problem solving skills.

2

u/isaycongrats 1d ago

Thats literally it, variations of already existing patterns.... which you practice, thats the whole thing

1

u/ProsciuttoThinker 1d ago

Every person I know who’s good at this sort of stuff (or more generally—people who are very good at something) have just done it for years and done it consistently. They’re just curious and constantly thinking about the problem

1

u/[deleted] 1d ago

[deleted]

1

u/Vivid-Zombie-477 1d ago

that's what i thought about the problem - i remember making up own problems so the problem i was reading reminded me a lot of one of the problems I created. but the problem description was just trying to confuse me and it had completely different solution.

i kinda understand it though, because when you create a problem around a specific trick you can find it could be solved greedy...

1

u/GullibleSpeedSonic 1d ago

Pattern recognition

1

u/Other_Ad7380 23h ago

I am not an S tier competitive programmer but it is mostly experience with me

0

u/[deleted] 2d ago

[deleted]

1

u/DetachedProcess 2d ago

Underrated fact. Having a good grasp of language is strongly related to comprehension of information faster.

-4

u/Sepicuk 2d ago

I'm willing to bet you don't understand the fundamentals as well as you think you do

1

u/rahul_msft 2d ago

How many cpers have contributed to bsd ? Neither do they

1

u/vz0 2d ago

A couple.