XYZ interview question

One one step explaination of Code