Jardox interview question

Question 1 - Leetcode style data structure.