I started my DSA journey pretty recently. It was like a passport to product based companies - solve 'n' number of problems and get 'n' number of offers.
However, between finding edge cases and debugging problems through brute force approach, I realised something. DSA is more than a checkbox for interviews. It shapes how one thinks, encounters complex problems and optimize their current solutions.
This blog is'nt just about DSA but my thought process about how one should approach DSA for a beneficial outcome.
1. Think patterns not topics
Before I started Leetcode, I had a good theoretical grasp of DSA concepts. However the deeper I went the more algorithms and complex data structures popped up. It was a never ending process from arrays to queues to trees to tries. When I started solving questions on leetcode I had realised 3 things:
- Most questions can be solved using a single pattern.
- You don't have to solve 3000 problems to master DSA but master the patterns to which 3000 problems can be solved.
For example in arrays and strings most questions were easily approachable using binary search, two pointers and sliding window.
2. You will look at solutions repeatedly. Don't worry happens to everyone
Initially, starting leetcode problems I had sought after solutions for the simplest problems as I couldn't solve them on my own. But it's not about looking at solutions but to understand the solution. Don't just look at solutions but find out the underlying problem the solution is trying to solve. See how it's approached and not just blindly copy paste. Mark those problems and come back later and test yourself if you are able to solve it on your own. Most solutions use a similar pattern that repeats itself for multiple problems. Find that out and it will help you in the long term. Soon you will be able to solve problems without the need of external help, with practise comes precision.
3. It improves project logic
DSA helped me optimize my approach in building scalable websites and much more. It helped question my naive approach into questions like :Should I use set for faster lookups?
Can I reduce the number of API calls by memoizing it?
DSA taught me that even product-based features have their space and time complexities.
4. DSA humbles you
In todays fast paced world we have artificial intelligence building codes for large scale websites or web applications. But can it be used to adapt as and how the site grows? Can it handle the traffic? Can it handle minor bugs or create more major bugs?
Well, DSA teaches you that there's more than one way to solve a problem. Some questions took 2 minutes and some 2 days. Even if I got the solution, it still lacked in some areas. More research, more brainstorming finally got me to find the best optimized approach towards a problem. It builds your brain in such a way where you look at multiple possiblities to solving one issue. Not only that but also teaches you patience and consistency. If a bug is'nt solved at one moment, a bit of research and a bit of help can help you find the solution easily. Sometimes the solution lies right infront of our eyes but we choose to ignore it as we believe AI can solve everything. But trust me, I have tried being a vibe coder and yes, it does work upto an extent. Once the website reaches production grade that's when AI fails and your problem solving skills come up. This problem solving mindset is built through solving DSA questions.
Conclusion
I'm not saying learning DSA will guarantee you a job at a top product based company. Just how learning ABCs is a fundamental unit before adapting to fluent english. DSA is a fundamental unit before adapting to project devlopment.
Mastering DSA is extremely beneficial, provided you do it the right way. Don't just solve problems but also try implementing that knowledge into your existing projects and see how can it be further optimized.
Your not just preparing for an interviews. You're training to be a problem solver- which is a superpower in any domain.
Top comments (0)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.