DEV Community

Shangguan Wang
Shangguan Wang

Posted on

A beginner's guide to study algorithms

Solving an algorithm challenge is like walking on ice; you never know when you will slip, but every moment of standing is a blessing. -- by me

What does the word "algorithm" even mean? Simply put, algorithm is a way to get things done; it's a way of solving problems in an elegant way.

Why should we study algorithms? They are the core components of technical interviews for developers and comprehensive tests on logical thinking, syntax familiarity, and strong work ethic. Even if your target company is not FAANG, practicing algorithms will build a solid foundation for your programming skills and prove to potential employers you are willing to devote time and effort to solve difficult problems.
Even traditional CS students find algorithms challenging, but for self-studying career transitioners and bootcampers, we have a significant advantage. We don't have to start with the textbook definitions of binary search or linked list. We can gamify the learning process, and dive right into solving interesting problems.


Instead of spending months on long lectures, let's begin with the easiest algorithm challenges. I highly recommend Codewars, their leaderboard ranking system and question lists are incredibly fun and approachable. I immediately got hooked and now am addicted to solve a few challenges each day. In just 15 days of using the platform, I've already solved 50 challenges, and my ranking has improved from the 99th percentile to the 55th percentile.

My Codewar Rank

At first, it would take me half an hour to solve the easiest challenge, and I would run my code on a local editor and console log every line to see where it went wrong. After some practice, I started to pick up certain patterns and could solve a problem in 5 minutes. Then I got more ambitious and not only wanted to solve the problem, but also solved it in an elegant way. You know the feeling when you wrote 30 lines of code, passed all the test, only to found out the most voted solution only has one line? Programming is truly an art more than science. The best programmers have taste, and through practicing algorithms I also get to improve my taste on code. One caveat is not to go too far on the shortest code to solve the problem. Readability is more important than showing off cleverness, and during an interview you don't want to fall into the trap of writing code that's hard to explain or understand.


Once you started grasping the common techniques of manipulating strings, arrays, and objects, consider taking a short crash course online to deepen your knowledge. I recommend Udemy's course The Coding Interview Bootcamp: Algorithms + Data Structures by Stephen Grider. I love how Stephen sets the tone that algorithms are learnable. You don't have to be good at advanced math to solve an algorithm challenge. His way of laying out the logic in a flow diagram also helped me become better at explaining my logic. Instead of vaguely knowing where to begin, now I can lay a 3-step outline in pseudocode, then execute it.

Writing down my own logic
While portfolios get you the first round of interview, algorithms determine whether you pass the second-round technical interview. The good news is you can still learn in public with algorithms. Create a folder on Github for every challenge you solved or struggled with, and write down study notes like I did. That's one piece of advice I got from a senior engineer interviewer. She prefers candidates whose Github has algorithms and data structure contents. Github commit is a great way to show consistent dedication.
I hope you find this post helpful. Let me know in the comment how you study algorithms, or any other topics you would like to see. Happy coding!

Top comments (0)