Review of ThePrimeagen's algorithms course
I just finished ThePrimeagen's algorithms course on Frontend Masters. The Last Algorithms Course You'll Need clocks in at roughly nine and a half hours and is completely free—all you need is a free Frontend Masters account.
ThePrimeagen is an experienced and popular (ex-Netflix) software engineer who streams on Twitch and has several YouTube channels. I recently discovered him on YouTube and have quickly become enamored with his content. When I found out he had published an algorithms course, I had to check it out!
The course uses TypeScript which should be approachable for most developers. The goal of the course is to teach enough data structures and algorithms (DSA) to prepare someone who, after some practice, could pass interviews at a large tech company.
Presentation Style
ThePrimeagen's presentation style is stellar. He's an excellent communicator and comes across as both down-to-earth and incredibly skilled and intelligent. He balances between talking over slides, whiteboarding, and live coding. Furthermore, he's very animated, engages with the audience, and makes frequent jokes just like he does when streaming. Ultimately, he turns a topic that many people find dense into something interesting and exciting. You can't help but catch some of his contagious excitement for the subject!
Pace
The pace of the course is admittedly on the quick end. He sets expectations at the beginning that he's essentially condensing a full semester college course into just under ten hours of content. As such, he blazes through many algorithms, but impressively implements many of them live. If you've studied algorithms before and are looking for a refresher like I was, this is a great fit. If you're completely new to the subject, you may have trouble following this course, especially the later parts. However, with the power of pausing and replaying, it still may work for you.
Supporting Materials
The primary supporting material for the course is a GitHub repository called kata-machine. Kata-machine essentially allows you to practice implementing the algorithms you learned in the course. The repository is set up such that you can generate a daily set of algorithms to drill yourself on. It's always the same set of algorithms, and the premise is that if you practice implementing them from scratch every day, you'll build muscle memory and essentially learn them by heart. There are around 23 algorithms or variations supported in total. I find the concept to be very empowering, and after practicing the algorithms for about a week now, I'm finding myself having much higher confidence in algorithmic problem solving.
I have found that the unit tests which test for correctness of your algorithmic implementations are not the best. For example, they don't always cover all the edge cases you might run into. The linked list suite allows you to completely skip implementing one of the methods and will still pass. There are several open issues on the repo (some with MRs to fix issues), but it doesn't seem like the project is actively accepting contributions anymore.
Regardless of the issues, it's still a great concept, and it's actually inspired me to write some of my algorithmic drilling tools.
Course Content
Lastly, and most importantly, there's the course content. The course is broken into several thematic sections.
Basics
In the basics section, we are introduced to the concept of asymptotic time and space complexity and big-oh notation. Furthermore, there's a basic introduction to arrays, a data structure that will be used extensively in the implementations of more complex data structures and algorithms.
Search
The search section covers linear and binary search. There's also a discussion and implementation of a search problem called Two Crystal Balls which has a very unusual optimal running time.
Sort
The sort section covers bubble sort, linked lists, queues, and stacks.
Arrays
The arrays section compares and contrasts arrays with linked lists as well as the interesting array list data structure that JavaScript uses under the hood. It finishes up with an implementation of a ring buffer.
Recursion
The recursion section introduces the concept of recursion with a fairly challenging maze path finding problem.
Quick Sort
Quick sort gets its own section, and rightfully so! A variation of quick sort is what a lot of programming languages use to implement their built-in sort methods.
Doubly Linked List
He didn't originally have time to implement the linked list structure when presenting it, but by this point in the course he does. So we get to see an implementation of a doubly linked list.
Trees
This section introduces trees and how one might traverse them.
Tree Search
The tree search section covers breadth first search (BFS), depth first search (DFS), and an algorithm for comparing two binary trees for equivalence in both value and structure.
Heap
The heap is a beautiful data structure commonly used to an implement a priority queue. This section is all about it. Tries get covered as well, but implementing one is left as an exercise.
Graphs
The graphs sections introduces graphs, shows how breadth first search and depth first search can be modified to traverse a general graph, discusses ways to represent graphs as adjacency lists or matrices, and introduces Dijkstra's algorithm for finding the shortest path.
Maps
The course wraps up with a discussion of hash maps and an implementation of a least recently used (LRU) cache.
Conclusion
In conclusion, I thoroughly enjoyed the course, and I've been having a lot of fun implementing the algorithms each day with kata-machine. This has totally sparked and renewed my interest in algorithms, and I highly recommend it!
Published September 6, 2024 by Jacob Chappell