Nikura interview question

How would you do to solve this problem? (in reference to a described problem)