Multi-Threading Questions

Q- Explain the Life cycle of a Thread?

Q- You have Thread T1, T2, and T3. How will you ensure that Thread T2 is run after T1 and T3 run after T2?

Q- What is the difference between wait() and sleep() in Java?

Q- Write a program that will result in DeadLock.How will you fix DeadLock in Java?

Q-  What is Thread Pool? How can we create Thread Pool in Java?

Q- How to create Daemon Thread in Java?

Q- What is ThreadGroup? Why it is advised not to use it?

Q- What is the atomic operation? What are the atomic classes in Java Concurrency API?

Q- In how many ways Threads can be created in Java?

Q- Can we start a Thread twice?

Q- Is there any relation between Threads like Parent-child?

Q- How Exceptions are handles in case of MultiThreading scenario? Who will handle Exceptions if there is no handler?

Q- What is the advantage of a new Lock interface over a synchronized block in Java? You need to implement a High-performance cache which allows multiple readers but a single writer to keep the integrity how will you implement it?

Q- Write a code to solve Producer-Consumer problem in Java?

Q- Write code to implement blocking queue in Java?

Q- What is a race condition? How will you find and solve race condition?

Q- How will you take Thread dump in Java? How will you analyze Thread dump? 

Q- Why we call start() method which in turn calls run() method, why not we directly call run() method?

Q- How will you awake a blocked thread in Java?

Q- What is the difference between CyclicBarrier and CountdownLatch in Java?  

Q- What are some common problems you may face in Multi-threading environment? How will you resolve them?

Q- What is an immutable object? How does it help in writing a concurrent application?

Q- What is Thread-Scheduler in Java?

Q- Difference between Executor and Executors in Java?

Q- How to find which Thread is taking maximum CPU in Windows and Linux server?

Q- Difference between DeadLock, LiveLock, and Starvation?

Q- Difference between green thread and native thread in Java?

Q- In case of Exception what happens to the Lock which is acquired by Thread, will that be released?

Q- What is Callable and Future?

Q- What is Java timer class? How to schedule a task to run after specific interval? 

Q- What is FutureTask class?

Q- Difference between Thread and Process?

Q- Difference between Callable and Runnable interface?

Q- How do we stop a thread in Java?

Q- What is the purpose of wait(), notify() and notifyAll() methods of Object class?

Q- What is Java Memory Model? Describe its purpose and basic ideas?

Q- What are the available implementations of Executor service  the standard library?

Q- What is the Thread's interrupt flag? How can you set and check it? How does it related to InterruptedException?

Q- What properties does each java thread have?

Q- What is context-switching in Multi-Threading?

Q- What is the meaning of term Scalability?

Q- What do we understand by busy waiting? How to prevent it?

Q- What is Shutdown hook?
 
Q- What is a Semaphore?

Q- What intrinsic lock does a synchronized method acquire?

Q- What is reentrant lock?

Q- Example of reentrant lock?

Q- Different types of reentrant lock?

Q- Different types of locking mechanism in java?And its comparision?

Q- How to use signals and conditions using locks?

Q- New threading features of java 8?

Q- What is java profiler?

Q- How to achieve singleton using two face locking concept?

Q- What is class level lock and object level lock and their mechanism of working?Which one we should use?

Q- How to avoid excessive Synchronization?

Q- Don't depend on the Task Scheduler. Explain?

Q- Dcument Thread Safety?

Q- Prefer concurrency utilities to wait() an dnotify()?

Q- Prefer Executors, Streams, Tasks to Threads?

Q- Synchronize access to shared mutable data?

Q- Us elazy initialization judiciously?

Q- What are the benefits of threads? (Chapter-1)

Q- What are the risks of thread of thread in java? (chapter 1)

Q- What is Thread Safety in Java? (Chapter 2)

Q- What is the meaning of Sharing Objects in Java? (Chapter 3)

Q- What is the meaning of Composing Objects in Java? (Chapter 4)

Q- How to build blocks in Java? (Chapter 5)

Q- Explain task execution in java? (Chapter 6)

Q- How to apply Thread pools Java? (Chapter 8)

Q- What is Cancellation and Shutdown in Java (Chapter 7)

Q- How to build custom synchronizers in Java? (Chapter 14)

Q- What is the Java Memory Model? (Chapter 16)

Q- Explain Atomic variables and Non-blocking Synchronization? (Chapter 15)

Q- What are the explicit locks in Java? (Chapter 13)

Q- Testing Concurrent Programs? (Chapter 12)

Q- Avoiding liveness hazards? (Chapter 10)

Q- GUI Application? (Chapter 9)

Q- Performance and Scalability? (Chapter 11)


 

Comments

Popular posts from this blog

Serialization and Deserialization Questions

Java 8 Interview Questions

Java Collections Framework Questions