TikTok Interview Question

Common data structure base code.