Amazon interview question

tree and graph problem and a system design question