Pergunta de entrevista da empresa Walmart

Write a program which reads strings from a continuous input stream and keeps the track of dup words in a data structure that other applications can read (not in hashtable or sth).