Lybrate interview question

Find the given number/strings in continuous input stream of number/string Optimised solution needed