Approach 2: Base-62 conversion ✅
Play this lessonThis lesson comes with an interactive animation you can break, a live-code challenge and a chapter quiz.Base conversion is another common approach. Give every URL a unique numeric ID (from a distributed ID generator, Chapter 7), then write that number in base 62, using 0–9 → 0–9, a–z → 10–35, A–Z → 36–61.
The rest of this lesson is part of Pro
Pro unlocks every lesson with its animation, code challenge and quiz, plus every interview problem. ₹299 a month or ₹1,999 a year.
See Pro