M2P Fintech interview question

In Java, how would you diagnose and optimize a high-CPU issue caused by many threads contending for a shared resource