Frage im Vorstellungsgespräch bei Grant Street Group

Given a string, return all possible substrings along with each substring's frequency/count.