MAERSK interview question

mechanics