Accenture interview question

Water tank question in Java