Google interview question

Data structure algorithm - Implement a data structure with constraints on insert/remove and a magic method.