I'm preparing for the salesforce pdi exam but finding it hard to apply theory to real world apex development. Trailhead feels too guided what hands on resources or platforms helped you truly understand apex and pass the exam?
What's the effective way to master apex for the pdi exam?

I felt the same during my pdi exam test trailhead is great for the structure but it doesn't fully prepare me with real world problem solving concepts. what helped me the most was combining trailhead with hands on mini projects in a developer edition org.
I'd pick a feature like triggers, batch apex and custom controllers and try to build something around it. This made the concepts stick a lot better.
I also used a couple of practice test platforms to get a feel for how the exam questions are framed. some communities recommend platforms like certshero for scenario based questions. I found that kind of exposure helpful for testing both my knowledge and how well i could apply it under pressure.
If you can stimulate some small business logics problems and build your own solutions, it bridges the theory to practice gap quite well.
Good luck you're on the right path!
Things that really helped me during the PDI exam preparation was exploring the real world use cases from salesforce developer documentation and try to rebuild them in my own way dev org. It gave context to how Apex is used in actual business scenarios. I also practiced writting test classes with proper coverage, since that's a big part of the exam. understanding the governor limits and SOQL best practices through trail and error really improved my confidence.
Don't just study build and break things to learn.

Hi there,
This might be a bit out of scope for this forum - we're mostly focusing on management consulting here. You might be better off asking on Reddit, though, who knows, perhaps somebody here accidentally happens to have the knowledge you're looking for.
Best,
Cristian