IPSY interview question

Simple algorithmic questions