XYZ Interview Question

One one step explaination of Code