Pergunta de entrevista da empresa ArcTouch

They asked me about an algorithm to solve an hypothetical problem. It was a simple but tricky problem. It the end, I found it interesting.