Boston Byte interview question

explain the code which you have written?