Jupiter Money interview question

Case study was given to solve