🧵 Java Concurrency — interview questions
10 questions. Filter by what the role asks for; open one for the six layers of the answer. The course is where the answers come from.
10 of 10
01What is the Java Memory Model, and what does happens-before guarantee?Memory modelhard3-5y02When would you use synchronized, and when volatile?Memory modelmedium0-2y03Why would you choose ReentrantLock over synchronized?Locksmedium3-5y04Explain ThreadPoolExecutor's parameters and how a task moves through them.Executorshard3-5y05thenApply vs thenCompose — and which thread runs the callback?Executorsmedium3-5y06How is ConcurrentHashMap different from Collections.synchronizedMap, and what is still not atomic?Collectionsmedium3-5y07What are virtual threads, and what changes when you enable them in a Spring service?Virtual threadshard5-8y08Production requests are hanging. How do you tell a deadlock from thread-pool exhaustion?Diagnosishard5-8y09How does AtomicInteger work without a lock, and when does LongAdder win?Locksmedium3-5y10How do you cancel a thread, and what must you do when you catch InterruptedException?Memory modelmedium0-2y