Practice this topic in a realistic system design interview
Every entity in a system needs an identifier: a user, an order, a message, a shortened URL. On a single database, an auto-incrementing column handles this well. The database owns one counter and hands out the next value on each insert.
The problem appears with multiple independent writers. If each writer keeps its own local counter and the ID space is not partitioned, two writers can produce the same value. The IDs are no longer unique.
At interview scale, ID generation is about more than uniqueness. You also need to think about ordering, length, predictability, database index locality, clock behavior, and operational failure modes.
A good interview answer compares the trade-offs instead of naming one universal best ID scheme.
In an interview, choose the ID scheme from requirements: