Google interview question

Finding repeating patterns in infinite string