Data Axle interview question

Code : maximum repeating substring in string. Ex: abcdefabcd answer must be abcd.