Schibsted interview question

Whiteboard-based programming question (without code)