Pergunta de entrevista da empresa Meta

Nothing difficult for someone who would be clear on data structures I guess.