How to improve your algorithms and data structures skills

This article helps you with how to improve algorithms and ds skills

Person who learns

It's my first question when I started learning algorithms except for the central question: for what. This article helps you with how, not for what.

Basic knowledge

You'll need to start from fundamentals. The base can be learned from several ways: video-course, books, youTube videos. The primary approach for you "understanding depth", not breadth. Focus on one topic and complete it and create a mind-map inside your head. For example, coding interviews require deep knowledge for solving a problem. Also, you need the experience to code quickly and correctly. You only develop these skills focused on topics one by one.

Topics:

  1. Math. Learn about logarithm, set theories, bitwise operations, combinatorics, and other basic math concepts.
  2. Basic Data Structures. Learn about array, linked list, binary trees, hash maps, queue, stacks, and other fundamental data structures.

On every topic, you need to think about how to practice. Therefore, you need to analyze a problem in-depth. You have two options for it. The first one: implement every data structure. The second: you can find problems for every data structure on popular sites like LeetCode, HackerRank, CodeSignal, etc. (but not deep dive into algorithms - only think how to practice data structure and math knowledge on simple problems.)

Next Level

Deep dive to algorithms. Learn what big-O and how to analyze algorithms. You can find a lot of information about this topic: articles, courses, youTube videos.

Implement all basic algorithms:

  1. Euclid's Algorithm,
  2. Binary Search,
  3. DFS and BFS,
  4. Array sorts,
  5. String manipulation,
  6. Data Structure traversal,
  7. Hashing functions

Again, you need to implement all these algorithms and practice all algorithms using the same platform as for the data structure. It's the main idea for practicing.

Rule: how to not forget all these topics?

The best technique I’ve seen - using iteration. Solve the problem again in 3 days. Then in a week. Then in a month. It will become second nature to you.

Concepts

When you learn basic algorithms - you're ready for the next level: algorithm concepts. It's not easy, but you will need to understand if you want to get better at algorithms. Main concepts:

  1. Greedy algorithms. A greedy algorithm is a simple, intuitive algorithm that is used in optimization problems.
  2. Divide-and-conquer. How to divide problems and resolve them detached
  3. Backtracking. How to use recursion for resolving problems
  4. Dynamic Programming. Solves the problem by breaking it down into smaller sub-problems and storing the solution to each sub-problem so that each sub-problem is only solved once.

Last but not least level (or boss fight!)

This level has two steps. The first one - resolve problems on paper or whiteboard, without IDEA.

Benefits:

  1. you're planning before writing
  2. paper and pen(pencil) you can take anywhere

And after all these steps, you'll need to think about mock-interview. A mock interview mirrors an actual interview. It allows you to practice what to say and do during an interview and get feedback.

Further Reading (my recomendation)