Design pattern interview questions
- What is design patterns ? Have you used any design pattern in your code ?
- Can you name few design patterns used in standard JDK library?
- Decorator design pattern which is used in various Java IO classes,
- Singleton pattern which is used in Runtime ,Calendar and various other classes,
- Factory pattern which is used along with various Immutable classes likes Boolean e.g. Boolean.valueOf.
- Observer pattern which is used in Swing and many event listener frameworks.
- What is Singleton design pattern in Java ? write code for thread-safe singleton in Java.
- Singleton pattern focus on sharing of expensive object in whole system. Only one instance of a particular class is maintained in whole application which is shared by all modules. Java.lang.Runtime is a classical example of Singleton design pattern. From Java 5 onwards you can use enum to thread-safe singleton.
- What is MVC design pattern ? Give one example of MVC design pattern ?
- Model-view-controller (MVC) is a pattern used to isolate business logic from the user interface. Using MVC, the Model represents the information (the data) of the application and the business rules used to manipulate the data, the View corresponds to elements of the user interface such as text, checkbox items, and so forth, and the Controller manages details involving the communication between the model and view. The controller handles user actions such as keystrokes and mouse movements and pipes them into the model or view as required.
- MVC is often seen in web applications, where the view is the actual HTML page, and the controller is the code that gathers dynamic data and generates the content within the HTML. Finally, the model is represented by the actual content, usually stored in a database or XML files, and the business rules that transform that content based on user actions.
- Struts frame work follows MVC.
- caliculator design cane be one example of MVC.
- Adapter design pattern ? Give examples of adapter design pattern in Java?
- The Adapter Design Pattern allows you to make an existing class work with other existing class libraries without changing the code of the existing class.
- We often need to use the methods of an existing class to work with other existing libraries. The way to do this is by creating another class, named the Adapter, that inherits from the existing class while implementing the interface of the existing library. The end result is that the Adapter can call the method of the existing class (since the Adapter inherits from the existing class) and can work in the existing library (since the Adapter implements the interface of the existing library).
- Adaptee >Adapter > Interface.
0 comments to "Design pattern interview questions"
Powered by WidgetsForFree
- ▼ 2014 (11)
- ► 2013 (19)
- ► 2011 (18)
- ► 2010 (35)
- ► 2009 (73)
My Blog List
- Airtel and vodafone GPRS settings for pocket PC phones
- Andhra 2 America
- Ayyappa Deeksha required things
- Blogs I watch !
- Captions for your bike
- DB2 FAQs
- Deepavali Vs The Goddes of sleep
- ETV - Dhee D2 D3
- Evolution of smoking in India Women
- How to make credit card payments?
- Java-J2EE interview preparation
- My SQL FAQs
- My Travelogues
- Old is blod - New is italic
- Online pay methids for credit cards
- Oracle FAQs
- Smoking in Indian Women
- Technology Vs Humans
- Twitter feeds for all Telugu stars on single page.
- Unix FAQs
- Unix best practices
- init 0, init 1, init 2 ..
- mCheck Application jar or jad download