Bloomberg Interview Question

Implement a data structure with sone condition.