TikTok interview question

How to get a sampler for arbitrary distribution from a uniform distribution sampler