Noom interview question

write a data structure for this hypothetical functionality