Domeyard interview question

Simple algorithm questions, OO design.