Tulip interview question

Given a string find the longest substring that passes a certain function they supply you.