Pocket Gems interview question

Brain teaser