Google Interview Question

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