ING Interview Question

How would you solve this coding problem