Axi interview question

1. Fixing the given code