Google Interview Question

Finding repeating patterns in infinite string