J.P. Morgan Interview Question

how does pivot table work?