Caterpillar interview question

If problem A, How do you solve?