Java Design Pattern Interview Questions

Java Design Pattern Interview Questions

Topic 1: Java Design Pattern Interview Questions on Decorator pattern

1. Give example of decorator design pattern in Java ? Does it operate on object level or class level ?
2. What is decorator pattern in Java? Can you give an example of Decorator pattern?
3. Difference between Decorator and Proxy pattern in Java?

Topic 2: Java Design Pattern Interview Questions on Factory pattern

1. What is main benefit of using factory pattern ? Where do you use it ?
2. What is difference between Factory and Abstract factory in Java
3. What is Factory pattern in Java? What is advantage of using static factory method to create object?

Topic 3: Java Design Pattern Interview Questions on Adapter pattern

1. What is Adapter design pattern ? Give examples of adapter design pattern in Java?
2. When to use Adapter pattern in Java? Have you used it before in your project?

Topic 4: Java Design Pattern Interview Questions on Observer pattern

1. What is Observer design pattern in Java? When do you use Observer pattern in Java?
2. What is observer design pattern in Java ?

Topic 5: Java Design Pattern Interview Questions on Aggregation and Composition

1. What is composition ?
2. What is difference between aggregation and composition ?

Topic 6: Java Design Pattern Interview Questions on Singleton pattern

1. What is singleton class ?
2. What is Singleton class how you create it ?
3. What is Singleton pattern in Java?
4. Can you write thread-safe Singleton in Java?
5. What is Singleton design pattern in Java ? write code for thread-safe singleton in Java ?

Topic 6: Java Design Pattern Interview Questions Miscellaneous

1. What is Value List Handler design pattern and what is use of it ?
2. What is Transfer Objects ?
3. What is Value Objects ?
4. What is Session Fa├žade design pattern ?
5. What is design patterns ? Have you used any design pattern in your code ?
6. Can you name few design patterns used in standard JDK library ?
7. When to use Setter and Constructor Injection in Dependency Injection pattern?
8. What is MVC design pattern ? Give one example of MVC design pattern ?
9. What is FrontController design pattern in Java ? Give an example of front controller pattern ?
10. What is Chain of Responsibility design pattern ?
11. When to use Strategy Design Pattern in Java?
12. Difference between Strategy and State design Pattern in Java?
13. When to use Composite design Pattern in Java? Have you used previously in your project?
14. When to use Template method design Pattern in Java?
15. Can you write code to implement producer consumer design pattern in Java?
16. What is Open closed design principle in Java?
17. What is Builder design pattern in Java? When do you use Builder pattern ?
18. Can you give an example of SOLID design principles in Java?
19. What is difference between Abstraction and Encapsulation in Java?
20. What is Service Activator design pattern. Can you explain it with practical examples ?

Leave a Reply

Your email address will not be published. Required fields are marked *