Whenever you're ready, walk me through how you'd approach this.
How do you handle concurrency in high-availability services?
Discuss how you prevent race conditions, protect shared state, bound resource usage, and preserve correctness when multiple service instances process requests concurrently. Explain how your approach changes when a local in-memory lock is insufficient and failures, retries, or duplicate requests occur.
Keep the answer focused on JVM-based backend services and distributed systems fundamentals.