IBM interview question

I was asked a question on text algorithm