Tory Burch interview question

How to solve a programming problem on the spot