Constructor interview question

code interview: write a code that can search for texts which contain given words.