Course · 6 lessons ~43 hr Intermediate

Sorting, Searching & Fundamental Algorithms

Master the canonical sorting algorithms (insertion sort through quicksort and mergesort), binary search and its variations, and the fundamental algorithmic techniques that appear in every technical interview. Ruby's Array#sort uses Timsort (since Ruby 2.7) — a hybrid of merge sort and insertion sort optimized for real-world data with natural runs. Understanding why Timsort beats pure mergesort on practical data teaches you that theoretical optimality and practical performance are different things. In Rails, order(:created_at) pushes sorting to the database (which uses its own optimized sort algorithms on indexed B-trees). Understanding when to sort in Ruby vs. in SQL is a production performance decision: sort in SQL when the data is indexed, sort in Ruby when you need custom comparison logic or when data is already in memory.

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

Complete Core 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.