Skip to Content
InterviewJava Multithreading

Java Multithreading and Thread Pool Interview Questions

Multithreading Basics

1. What are the ways to create threads?

2. What are the thread lifecycle and state transitions?

3. How to start a thread? What’s the difference between start() and run()?

4. What’s the difference between sleep(), wait(), yield() and join()?

5. How to interrupt a thread?

6. What is a daemon thread?

7. What is ThreadLocal?

8. How does ThreadLocal work internally?

9. What is the ThreadLocal memory leak issue?

10. What is InheritableThreadLocal?

Thread Pool

11. Why use thread pools?

12. What are the core parameters of a thread pool?

13. What is the execution flow of a thread pool?

14. What are the rejection policies of thread pools?

15. What are the common thread pools?

16. What’s the difference between FixedThreadPool and CachedThreadPool?

17. How to set thread pool size reasonably?

18. How to gracefully shutdown a thread pool? What’s the difference between shutdown() and shutdownNow()?

19. What’s the difference between execute() and submit()?

20. How to monitor thread pool status?

Future and CompletableFuture

21. What is the purpose of Future?

22. What are the limitations of Future?

23. What is CompletableFuture?

24. What are the common methods of CompletableFuture?

25. How does CompletableFuture handle exceptions?

Other Questions

26. What is ForkJoinPool?

27. What’s the difference between ForkJoinPool and ThreadPoolExecutor?

28. What is the work-stealing algorithm?

29. How to implement a simple thread pool?

30. What are the considerations when using thread pools?

Last updated on