ServiceNow interview question

DSA based on Dijkstras LCA on Trees