Amazon Interview Question

tree and graph problem and a system design question