r/leetcode • u/Additional_Reveal822 • 21h ago
Question How long does it take to master DSA?
I started grinding Leetcode seriously 2 weeks ago. I subscribed to Leetcode premium and also bought a crash course for more structured learning. However, it seemed like it took me forever just to pick up how to solve the simplest "String and Array" problems 😂 I think the course does help me to understand the basic concepts like two pointers, sliding window etc. But to really master and apply the same concept to different questions is quite difficult. It's been two weeks and I am still stuck at solving string and array problems, I feel like a joke. For all the experienced and smart people here, can you please point me to the right direction? Tell me how to master DSA quickly? Because I am afraid I am not fast enough to learn everything before my upcoming interview.
39
u/jyscao 19h ago
Depends on what level you consider mastering to be.
Being good enough to pass say at least half of the coding interviews given out there? Maybe 6mo to 2 years depending on your existing level and aptitude for picking up the DSA patterns.
Being a legitimately impressive CP problem solver? Much longer, and you'll probably be working towards it for the rest of your life.
14
u/tehfrod 20h ago edited 20h ago
To truly master it you would have to spend at least a few years working at a PhD level or industry equivalent, and not just playing leetcode.
To get good enough to pass a FAANG interview, assuming you already had the basics in a uni course, probably six months if you're just doing leetcode, less if you are actually studying it with intent from good source materials.
I failed my first FAANG interview, studied hard for about three or four months using good quality books and lectures, and made it on the second try.
5
u/Comfortable_Put6016 21h ago
my approach is do 2-3 exercises that teach a specific algo or data structure / are supposed to be solved with a specific algo or data structure and thats it
i then go around and search for different problems and try to reduce them towards these algos / datastructures ; but i suppose its based on intuition and problem decomposition
i suppose the last part the decomposition plays the most part aka breaking down a problem and tryting to make sense of behavior in data / restrictions/ intended goal and work around from there
dsa works more like a toolkit to reduce towards rather than memoization of sprecific solutions for specific problems
4
u/Material-Command-854 20h ago
It can take months. I would try to temper your expectations but not give up. Be patient with the process and yourself.
3
u/soft_abyss 20h ago
It takes a long time for it to stick long term imo.
2
u/maaKaBharosaa stole bananas from koko 20h ago
For me it took around 2.5 years to reach 1800 at leetcode
1
u/duluoz1 21h ago
You sure you want to be a SWE?