TikTok Interview Question

write optimum algorithm for sorting or finding something.