Low Level Design, Object Oriented, Graph Data Structure, Hashmap, Interview Questions.
"SELLER") not in self.nodes: self.addSeller(seller_id) # Create edges with seller node seller_node = self.nodes[(seller_id, "SELLER")] self.graph.addEdge(seller_node, prod_node) self.graph.addEdge(prod_node, seller_node) # Create edges with categories for cat_id in cat_ids: if (cat_id, "CATEGORY")