Samsara interview question

How do you solve this problem