Low Level Design, Object Oriented, Graph Data Structure, Hashmap, Interview Questions.
self.adj_list[srcNode.uid][dstNode.type].remove(dstNode) self.parents[dstNode.uid].remove(srcNode) if len(self.adj_list[srcNode.uid][dstNode.type]) == 0: self.adj_list[srcNode.uid].pop(dstNode.type) def getChildren(self, srcNode:Node, dstType:str): # Get all children of a node of speecific type if