Pregunta de entrevista de IBM

How would you remove duplicates from an infinitely long string?