I'm looking for tips from seasoned developers on how to effectively study algorithms. I have a background in programming and have worked on real systems, but I struggle with algorithm questions during interviews. I've started reading a book on the topic and am attempting challenges on LeetCode. Despite my efforts, I often need to refer to online explanations and can't seem to implement solutions from scratch. I usually take notes on explanations, practice the problems multiple times, and explain the solutions to myself. Any strategies to enhance my computational thinking and really grasp these concepts would be appreciated!
6 Answers
I'd suggest pushing through the hard parts without looking at the solutions right away. Try to stick with a problem for at least 30 to 45 minutes before Googling. After that, implement it again from scratch, which will really help reinforce your understanding.
Tackling data structure problems is like using a toolkit—it’s about solving problems with available tools. If you’re not practicing solving problems, you’ll find it hard to improve. Keep working on it and focus on creativity in problem-solving instead of memorizing.
Here’s a short routine that worked for me: focus on around 4-6 core patterns like two pointers or dynamic programming. Solve a few problems for each pattern without checking solutions for at least 30 minutes. Afterward, analyze the solution and practice it again in a few days to really build retention. It’s more about recognizing when to use a particular technique than it is about memorizing specific problems.
In my computer science program, we had classes specifically on algorithms and data structures. Knowing your data structures well is key to tackling algorithm problems. Make sure you're comfortable with that foundational knowledge first before diving deep into algorithms.
This is a tricky area! Many developers don't dig into algorithms as deeply. They utilize them in libraries and frameworks instead. What’s your goal here? Are you looking to solve specific problems or just wanting to understand algorithms better? It can help to clarify what specific types of tasks you want to tackle.
When I was in college, I found that sitting with a few quality textbooks and sketching out algorithms helped a lot. Drawing diagrams and taking notes made the concepts stick. After that, I would try to code the algorithms from memory to see how well I understood them. Remember, it's not about recycling exact code from books; it's about understanding how to build it yourself without the reference.
Do you have any favorite textbooks you'd recommend? I'm teaching high school programming and want my students to grasp algorithms early on.

Totally agree! It's all about that read-try-fail cycle. You really learn from the struggle.