Citi interview question

My experience, fixed some already implemented code