Gjirafa interview question

How to solve a certain problem?