Salesforce Interview Question

Linked list arrangement, water container problem