Compass interview question

Background