Salesforce interview question

Linked list arrangement, water container problem