My name is Akezhan, I am 25 years old, and I am currently pursuing a Master’s in Computer Science at San Francisco Bay University. With six years of experience in software development at EPAM Systems, Azimut Labs, Bitspace, and 021 Labs, I most recently served as a Senior Software Engineer. In this article, I would like to share my journey of becoming a problem solver and the best practices I have learned over time. Total problems I’ve solved is 1700 and the contest rating is 2035 which is top 2.27%.
But before diving in, let me share my story and why I decided to start leetcoding.
In 2019, I started my Bachelor’s degree in Computer Science at Nazarbayev University. Over time, I noticed that many of my friends and fellow students were deeply passionate about competitive programming. They were energized by the process of brainstorming, developing algorithms, and discussing their solutions. It looked like they were solving puzzles and brainteasers. The harder the challenge, the more determined they became, and by the end, you could see how proud they were of what they’d accomplished. What was even more impressive was that these same people were easily acing interviews focused on algorithms and data structures with various tech companies like Citadel, Google, Meta, Amazon and others. This was a strong motivation for me to dive into the field.
At first, I decided to tackle problems on Codeforces because others were using this platform. I was trying to learn everything in practice by solving problems. However, I soon realized that even the easy problems were quite challenging, often requiring intermediate or advanced math knowledge. Another major problem was that I was not good at any algorithms and data structures. This left me feeling like an impostor, growing more frustrated with each setback. Eventually, I lost interest.
However, in December, 2020, I came across a post that made me reconsider my previous experiences and motivated me to try again. This post was written by Ruslan Rakhmedov and gave me the push to try problem solving again. You can find the post here: One Year at LeetCode: My Story. I highly recommend reading it. Another serious drive was that all of us need to learn that problem solving anyway, because almost all large companies would require you to solve the coding problems on interview or online assessments.
So, let me share 7 tips.
Tips:
Solve problems during your best focus time. After having a great drive for solving problems, I started doing it every morning as soon as I woke up. After doing it for a month, it became a habit as I was doing it automatically. I realized that, like me, many people find the early morning to be the time when their focus and performance are at their peak. But it's also possible that you might be highly focused at any other time of the day. So, dedicate the time when you have the most energy and concentration to solving problems.
Make it a habit to have a green box every day. Try it yourself for 2-3 weeks straight and you will realize how addictive this is. Even if you have other important tasks throughout the day, dedicate 10-15 minutes to solve a LeetCode challenge or any other problem. Can you spare 5-10 minutes during the day to brush your teeth? Treat this as equally important. Even if the problem is too tough, just submit a brute-force solution that might result in a TLE (Time Limit Exceeded). Any submission, whether accepted or not, counts, and your box will turn green. All of my boxes were green in 2021 and 2022 because solving a problem or submitting a solution each day was my top priority.
Change your mindset when struggling. When you encounter a difficult problem, avoid saying, “I'm not smart enough for this” or “It's too hard for me.” Instead, try 'This problem is challenging, but it will be a great learning opportunity in this field”. Of course, beginner-level LeetCode users should focus more on easy and medium tasks. However, intermediate-level coders should not hesitate to tackle hard problems as well. When facing a hard problem, I also used to feel not smart enough to handle it. One trick that I was doing in such cases was changing the HTML problem tag to 'Medium' and setting the background color to yellow (click on watch video). This helped me feel more relaxed.
Be ready to struggle and feel stupid when reading explanations or learning new material. We all think and take in information differently. For some people, one explanation would be enough. For another you need to repeat 3 times to deliver an idea. If you're having a hard time understanding a solution or concept, try debugging the code locally in an IDE (VSCode, CLion for C++, IntelliJ IDEA for Java, etc.). Pay attention to patterns, like how data changes over time. Once you've done that, challenge yourself to rewrite the entire code from scratch without referring to the solution. This will deepen your understanding.
Always use Paper and Pen first: After reading the problem description, don’t start coding unless it's too obvious. Spend some time on sketching out the problem statement, your thoughts and potential solutions. Draw different scenarios and try to solve them. It would really help you understand the problem better, identify key properties and find out possible pitfalls (aka edge cases). Even if you can’t see the full solution yet, think about the properties - how can you leverage them? Many top programmers won’t even touch the keyboard until they’ve worked out most of the algorithm on paper.
Participate in Contests: Contests are a great way to enhance your skills and track your progress. Besides problem solving skills, the contests will make you think much faster, improve your focus time, reading speed and intuition. By intuition I mean you would be able to quickly identify the algorithmic topics around the problem. During the software engineering interviews, you usually need to think fast. Contests can give you this skill and confidence since they are timed. The most important thing after a contest—regardless of your rank or score—is to do a follow-up review. If you can't solve the 3rd or 4th problems, take time to study others' solutions and try to solve them yourself.
Find a community and make friends. Joining a coding club or partnering with a friend to solve problems gives numerous advantages in the learning process. Discussing problems with someone is a great opportunity to enhance your knowledge and thought process. Try to prove your ideas and understand the ideas of others. When you explain something to someone, the information will stay with you for a long time.
Another great thing is that you can compete with friends during contests. Track their performances and compare them with yours. In my experience, this kept me much more engaged and competitive. You will do your best to get a higher contest rating than your friends. When you lose, it will give you strong motivation to work hard and perform better. You can track the progress of other participants through clist.by website. Go to "https://clist.by/standings/". Enter the name of the contest. After that, you can search for the participants' usernames, or you can filter the participants by a country. This website also tracks the time for all upcoming coding contests from different sources - codeforces, leetcode, atcoder, codechief and others.
To conclude, my advice is - be consistent, persistent, engaged and patient. Everyone is capable of developing problem solving skills. You can do it!
What are your secrets when it comes to improving problem-solving skills?