Google Cloud interview question

top-k elements and longest repeating substring