Salesforce interview question

Simple algorithm with LinkedLists