FIS Interview Question

Had to code for a scenario.