Sorting, Explained Like You're Five: Radix Sort
Here's a sorting trick that feels like cheating: you never compare two numbers to each other. Not once. Instead you sort by one digit at a time, using ten labeled boxes. It's how old machines sorted stacks of punch cards, and it still smokes everything else for the right kind of data.
The whole idea in one sentence
Drop every number into a bucket based on its last digit (0–9), scoop the buckets back up in order, then do it again for the next digit, and the next — until you run out of digits.
The wild part: after the final digit pass, the list is perfectly sorted, and you never once asked "is this number bigger than that one?"
Watch it happen
Hit Play. Watch each number fall into a bucket by its ones digit, get scooped back into the tray, then repeat for the tens and hundreds. Step through it slowly the first time — the "aha" is seeing order appear without a single comparison.
Why it's worth knowing
Radix sort breaks the rule that sorting "can't beat O(n log n)" — because that rule only applies to comparison sorts, and radix doesn't compare. For fixed-width keys like numbers or short strings, it can run in linear time. In an interview, knowing when a non-comparison sort applies is exactly the kind of insight that makes you look like you actually understand the trade-offs, not just the textbook list.
No comparisons, ever. Radix sort orders the list purely by looking at one digit at a time — which is how it can outrun the famous O(n log n) limit.