Why I Solved 400 Problems on LeetCode
Pramoda Vyasarao
Technology leader, coach, and author. Coached 600+ ICs and Managers to become leaders at Oracle and Meta.
Full disclosure first; I took 18 months for this milestone and many people have done this in less than 6 months. It’s all based on the motivation, need & purpose. In this article, I want to share 5 reasons for taking this initiative. Reason #1 was the impetus, whereas the other 4 listed below are purely serendipitous.
1. I was challenged to attempt solving problems on LeetCode platform (LC = LeetCode).
A friend of mine told me it’s not easy to solve problems on LC, especially if you are in leadership roles and not actively writing code on a daily basis. I was intrigued by his remark and wanted to get a firsthand experience on this platform. I created my account on LC on 27th October 2019. There are many other platforms like LC, but I picked LC because that’s the first one I was introduced to. Curiosity was the reason to start this journey, nothing more!
2. I wanted to become better at solving problems
After attempting 20 problems, I realized what my friend was talking about. While I was able to come up with brute force solutions, LC engine wouldn’t pass some test cases or show ‘time limit exceeded’ warnings. Many ‘easy’ problems were hard to grasp and harder to come up with optimized algorithms. I had forgotten many of the concepts from Data structures & algorithms University classes. I studied them way back in the year 2000. I decided to master the fundamentals one more time, this was a game-changer for me. This decision kept me going since I was interested in becoming a craftsman and not focused on remembering solutions or algorithms. My goal was clearly to master algorithm design strategies & leveraging data structures for solving LC problems. In short, I had a strong desire to become more adept at this task.
3. Problem solving as a medium for refreshing my coding skills
After 2010, I started managing teams and wasn’t writing code actively. I did write/review SQL queries and PL/SQL scripts (and Oracle database tools) when needed. Solving problems on LC was an effective way for me to learn a new programming language. Taking one problem a day and express my algorithmic thinking in Python language. Like public speaking, the more I did the better I became. Fluency follows consistency! I chose Python since it covers a wide range of use cases from general purpose scripting to Machine learning & data analytics. Almost every LC problem deals with data structures such as lists, dictionaries and abstract data types (trees, queue and stacks etc.). The choice of right data structure is of paramount importance. This reminds me of the quote “Representation is the essence of programming” by Fred Brooks
4. I started enjoying the process of solving problems on LC
After 3 months of disciplined work (30-60 minutes per day), I started enjoying the process. I solved the same problem with multiple approaches and understood the possible trade-offs in each solution. This is an important phase of my journey, I reached this after 6 months (some may reach sooner, it’s just a matter of disciplined practice & digesting the fundamentals).
5. Becoming an empathetic interviewer and testing algorithm design skills
I found this process as a way to become better technical interviewer. You can give an easy problem from LC (I prefer a modified version of a known problem or create new ones based on the role) and use the layering approach to elicit someone’s problem solving and algorithmic thinking (regardless of the programming language). I don’t think we need complex problems on dynamic programming, graphs or some math-heavy puzzle to understand a candidate’s problem-solving skill. If the role really demands these types of problems, of course you should ask; not otherwise. I learnt the art of tailoring the interview based on candidates’ strengths, interests and preparation. Empathy flows when you know and feel what candidates go through during preparation!
I wrote this article to spread hope to engineering managers / leaders who may be great in enterprise architecture, managing teams and developing solutions for business challenges but find coding problems daunting. If you’re keen to know more about the process you can comment on this article and I will write relevant posts in the coming months.
Sr. Software Engineering Manager | ex-Meta
2 年Your Leetcode statistic reflects a great dedication over long period of time. As being leader and staying closer to code is great achievement. Best luck!
Software Developer
2 年It was interesting how to save motivation during Leetcode's learning. Discipline, regularity, and impression of the new technologies are the existing basis to achieve real goals. Leetcode is the same helpful tool to build a mindset in Data Structures Analytics. I'm interested in other new articles. Thanks!
Senior Applications Engineer @ Oracle | Certified SAFe? 6 Practitioner | OFSS Analytical Applications
4 年Thank you for the post!
Sr. Executive Vice President, Head of Corporate Technology
4 年Way to go!!
Machine Learning MLOPS Lead - Commercial Bank at JPMorgan Chase & Co.
4 年Good read!!.