TikTok interview question

questions about array organizing and 1 SQL question.