TIAA interview question

basic code to write