Prefer synchronized for compound actions. Frame the concept in practical terms so you can explain it during interview discussion.
Use synchronized when multiple operations need to be treated atomically, such as incrementing a counter or updating multiple related variables. While volatile ensures visibility, it does not protect compound actions from race conditions. For instance, incrementing a shared 'totalSales' counter during a flash sale requires synchronized to ensure accurate updates by multiple threads.
Additional Notes
When should you prefer synchronized over volatile?