Skip to content

01 concurrency questions

serhij.zolotukhin edited this page Jun 29, 2026 · 1 revision

🔹 Multithreading & Concurrency Why String immutability improves thread safety What is the difference between Callable and Runnable? Difference between wait(), sleep(), and yield() What is the use of volatile keyword? Explain the Java Memory Model (JMM). What is double-checked locking? Explain difference between synchronized block and lock API. How do you prevent deadlock in Java? What is ThreadPoolExecutor? How do you configure it? What is Future and CompletableFuture? What is the difference between HashMap and ConcurrentHashMap? Why can double-checked locking still fail? How does the JVM identify deadlocks? What happens when a task throws an unchecked exception?

🔹 JVM and Multithreading Internals How does the JVM manage different types of locks? What happens when an exception occurs inside a synchronized block? What is the difference between visibility and happens-before guarantee? Why does double-checked locking need volatile? How can ThreadLocal cause memory leaks? What are safepoints and stop-the-world pauses? What is false sharing and how does it affect performance? How does ForkJoinPool distribute work between threads? What is the difference between wait/notify and park/unpark? Why do final fields behave differently in multithreading?

🔹 Async and Modern Java How does CompletableFuture hide exceptions? What is the difference between thenApply and thenCompose? How does the common ForkJoinPool affect async code? Why are blocking calls inside CompletableFuture dangerous?

🔹 JVM and Multithreading Internals Why is volatile not a complete thread-safety solution? When and why does synchronized start hurting performance? How can HashMap break in multi-threaded scenarios? Internal working: ConcurrentHashMap vs synchronized HashMap How does the Java Memory Model guarantee visibility and ordering? How instruction reordering affects concurrency How can thread pools quietly degrade performance? Correct ways to shut down an ExecutorService

My side bar

Clone this wiki locally