Pergunta de entrevista da empresa Tulip

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