Spreadex interview question

Extend the code given with new features