Everpure interview question

how do you synchronize efficiently Unique Id generation, focus was the code was thread-safe and fast.