Robert Bosch interview question

Written test: Frequency of a substring in a string