I'm an apprentice in Germany and want to keep expanding my programming knowledge. Is building projects the most effective way to improve, or should I spend more time studying theory and language documentation?
I recently started solving LeetCode problems to improve my Java skills and learn concepts such as HashMaps and HashSets, but I often struggle to find solutions. That made me wonder whether I should study algorithms and data structures more systematically. However, I'm not sure whether reading an algorithms book mainly to solve coding challenges would actually make me a better developer.
So far, I've built a Swing note-taking application with text-file persistence, a Swing Snake game that stores high scores in a database and supports multiple players, and a Spring Boot todo application to learn about REST APIs. The web app was difficult, but it helped me understand asynchronous requests, await, and fetch, and it can now add and remove tasks.
Should I continue building projects and learn new concepts as problems arise? Would it also be useful to regularly read Java documentation or study specific topics for a few hours? I'd appreciate advice on balancing projects, theory, coding exercises, testing, and other skills that help someone become a stronger developer.
3 Answers
Keep some algorithm practice in your routine, but understand what it is for. It can help with data-structure familiarity, reasoning under pressure, and technical interviews, especially when you work without an IDE providing suggestions. It usually has little resemblance to day-to-day application development, though, so don’t judge your progress as a developer by LeetCode performance alone.
You don’t need to choose between projects and theory. Projects expose gaps in your knowledge, while books and documentation give you the tools to fill those gaps. Learn about a data structure or algorithm when you encounter a problem that calls for it, then apply it in code. LeetCode is useful for practicing pattern recognition and interview-style problem solving, but it is a fairly narrow skill and is not a substitute for learning software design or building complete applications.
Projects should probably be your main learning method, especially when each project introduces something new. Your progression from a desktop app to database work and then a Spring Boot API is a good example of practical learning. When you get stuck, study the specific concept you need instead of trying to read an entire algorithms book from cover to cover. Also try to complete projects rather than constantly starting new ones: add tests, improve the architecture, handle invalid or corrupted data, use SQLite, and package or deploy the result.

That makes sense. I’ll keep using projects as the main focus and treat algorithms as targeted study instead of trying to memorize everything upfront.