Pergunta de entrevista da empresa Hopper

Some HackerRank question about messaging data structure