Explain the Java memory model?
What is main main memory, is it heap ?
What is the difference between “concurrency” and “parallelism”?
If i use ThreadPoolExecutor, may it be possible that tasks will be executed on different cores ?
if i use ForkJoin is it guaranteed to solve each task on different core ?
Is ForkJoin more effective than threadExecutor ?
Can i adjust ThreadPoolExeccutor to work on different cores ?
What is the difference between a process and a thread?
What are “green threads” and do they exist in Java?
What is the difference between Thread and Runnable?
What is the difference between start() and run() methods in Thread?
How can a thread be started forcibly?
Why do we need Synchronized (this) and Synchronized method if they give us the same result ?
if you say monitor is the mutex, tell me in terms of mutex how sync happens ?
Define the concept of “synchronization”.
What are the different types of synchronization in Java?
Example with consumer and producer
What states can a thread be in?
Can new instances of a class be created while a static synchronized method is executing?
Why might a private mutex be needed?
How do wait() and notify()/notifyAll() methods work?
What is the difference between notify() and notifyAll()?
Why are wait() and notify() methods called only in a synchronized block?
How can I check if a thread holds the monitor of a specific resource?
On which object does synchronization occur when calling a static synchronized method?
What is the use of the volatile, synchronized, transient, native keyword?
What is the difference between volatile and Atomic variables?
What does “thread priority” mean?
Can the main thread of a program be made a daemon?
What does it mean to put a thread to sleep?
What is the difference between the two interfaces Runnable and Callable?
What is the difference between CyclicBarrier and CountDownLatch?
Is there a way to solve a race condition?
How CAS works under the hood and how it helps in sychronization ?
In Counter class we dont use compareAndSet method, so how it works ?
Why is it not recommended to use Thread.stop()?
What happens when an exception is thrown in a thread?
What is the difference between interrupted() and isInterrupted()?
How big should a thread pool be?
What happens if the thread pool queue is already full but a new task is submitted?
What is the difference between submit() and execute() methods in a thread pool?
What is callable and future ? how are they connected ?
What is the difference between stack and heap in terms of multithreading?
How to share data between two threads?
What is the JVM startup parameter used to control the size of a thread stack?
What is a ThreadLocal variable?
When should i call threadLocal.remove()
What is the difference between synchronized and ReentrantLock?
What is starvation f threads in ReadWriteLock ?
What is a “Fork/Join framework”?
What is double checked locking Singleton?
How to create a thread-safe Singleton?
Explain Enum Singleton, why does it Protects against reflection & serialization attacks ?
Why enum singletone is it thread safe ?
Why are immutable objects useful?
List the principles you follow in multithreaded programming?
Given 3 threads T1, T2 and T3? How to implement execution in sequence T1, T2, T3?
Write a minimal non-blocking stack (only two methods – push() and pop()).
Write a minimal non-blocking stack (only two methods – push() and pop()) using Semaphore.
Write a minimal non-blocking ArrayList (only four methods – add(), get(), remove(), size()).
Write a simple multi-threaded bounded buffer using synchronized.
Write a simple multi-threaded bounded buffer using ReentrantLock.