Oursky interview question

Data structure / Design pattern / Simple Algo question