BT Group interview question

Core java: occurrence of characters in a string, reverse a string