Course · 6 lessons ~30 hr Intermediate

String Algorithms & Pattern Matching

Master string manipulation algorithms, pattern matching (beyond regex), string searching algorithms (KMP, Rabin-Karp, Boyer-Moore), and bit manipulation. These are the algorithms behind text editors, search engines, and compilers. Every Rails app does string processing constantly: URL routing uses regex matching, pg_trgm uses trigram similarity for fuzzy search, LIKE queries use naive string matching (which is why they are slow on unindexed columns). Catastrophic regex backtracking is a real security vulnerability — a carefully crafted input can make a regex-based validation take minutes, effectively DoSing your app (ReDoS attacks). Understanding string algorithms helps you write safe, efficient string processing. Bit manipulation appears in Rails permission systems (bitfield flags), feature toggles, and the Set operations that ActiveRecord's where clauses compile to at the SQL level.

reading · we frame, you read MIT or the canonical taught · we author, no canonical fits ↺ spirals back to earlier lessons
Course locked

Complete Trees, Heaps & Advanced Data Structures first.

This course unlocks once you've finished its prerequisite. Open prerequisite →

6 lessons. Read in order; spiral back when you need to. By the end you'll have used the core ideas twice — once on the abstract, once on something you'll meet at work next week.