Hopper Interview Question

Some HackerRank question about messaging data structure