Bloomberg interview question

Implement a data structure with sone condition.