TikTok interview question

write optimum algorithm for sorting or finding something.