Question
Which short-code generation strategy best guarantees uniqueness without collision checks for every generated code?
A
Atomic unique counter with Base62 encoding
B
First 8 characters of the long URL
C
Current timestamp only
D
Random 2-character string
Explanation
An atomic counter encoded with Base62 can generate unique compact short codes.
A globally unique counter produces a new number for each URL. Encoding that number in Base62 creates a compact URL-friendly code. This avoids random hash collisions. The tradeoff is that a global counter needs coordination, and sequential codes may be predictable unless an obfuscation technique is used.