Company: Wipro_9july
Difficulty: medium
Product Migration Service Happy Time Inc. keeps its catalogue as two kinds of being : a product , such as puzzle_1 or ball_1 ; a category , such as puzzle or balls . A product may belong to any number of categories, and a category may hold any number of products. Every being also sits in exactly one group , such as logic or sport . You must implement the migration service. It is handed one being, one target group and one migration type , and it changes the catalogue accordingly: COPY_SINGLE — create a copy of the being in the target group, and nothing else. MOVE_SINGLE — move the being itself into the target group, and nothing else. COPY_MANY — copy the being together with everything it depends on . MOVE_MANY — move the being together with everything it depends on . Dependencies The products and the categories form a graph: a product is joined to each category it belongs to. The dependency set of a being is its whole connected component of that graph — the being itself, everything reac