Glencore Interview Question

a graph and tree question