Domanda di colloquio di Amazon

one graph question ,one backtracking question