When you will synchronize a piece of your code?
When you expect your code will be accessed by different threads and these threads may change a particular data causing data corruption.
Explore posts in the same categories: Java Interview Questions, Operating System Interview Questions