Pregunta de entrevista de AnaVation

Given a string, how would you check for duplicates efficiently.