You may want to check out https://www.hackerrank.com/dashboard. Alongside a brush up or new learning in languages like Python, C, Java and many functional programming languages, solving problems and code optimization through unit tests are very easy with already constructed test cases. It is a fairly easy online platform to work with and totally free. Add to this if you are new to OpenAi, I suggest a quick browsing of chatGpt or Google Bard as a code learning tutoring aid. You can easily furnish code snippets for a breakdown of code, or add this as supplement in working alongside learning materials especially to working problems.