Swivl Interview Question

General question and the task was given