Low Level Design, Object Oriented, Graph Data Structure, Hashmap, Interview Questions.
print("Error: ", e) def setProductCategory(self, prod_id, cat_id): # Add existing category to a product try: n1 = self.nodes[(prod_id, "PRODUCT")] n2 = self.nodes[(cat_id, "CATEGORY")] # Add edges self.graph.addEdge(n1, n2) self.graph.addEdge(n2, n1, sortKey="price") except Exception as e: