Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Interview Questions
You are having a printer class which the user has to call the following methods to get printing done
Which design pattern you prefer for the above scenario?
Posted By :
Posted Date :
February 24, 2011
You can also find related Interview Question to
You are having a printer class which the user has to call the following methods to get printing done - OpenToner() - CheckColor() - IsColorValid() - SetMargin() - DoPrint() Which design pattern you prefer for the above scenario? -
You have got a base robot with all methods in steps of Start(), Perform(), Stop(). There are different kind of robots for creating Cookies, Sauce, Breads in a bakery. Only the Perform() method differs. Which design pattern should be appropriate for the scenario?
Template Method design pattern.
Real software is developing a speech-based user interface for blind people. However, speech based interface are difficult to design and time given by the client is short. To develop a functional interface without any errors, the company wants to first evaluate the prototype. They used the storyboard technique to demonstrate the functionality of the application. However, this technique was unable to demonstrate the interactive feature of the application. Analyze and provide solution for the above scenario?
1, The design team of Real software should have used the Sketching technique because storyboard technique would only provide the flow and features of the interface.
2, The design team of Real software should have used the Horizontal Prototyping because storyboard technique would only provide the flow of the interface.
3, The design team of Real software should have used the Wizard of Oz technique because storyboard technique would only provide the flow and features of the interface
4, The design team of Real software should have used the Vertical Prototyping because storyboard technique would only provide the flow of the interface.
Answer : 3
Can we call a base class method without creating instance?
Its possible If its a static method.
Its possible by inheriting from that class also.
Its possible from derived classes using base keyword.
Given the following methods of the ASP .Net Page class, in which of them would you attach an event handler to an event published by a control on the web page?
Which design pattern should have private or protected constructor?
singleton design pattern should have private or protected constructor
Which class of the WPF is the base class of all the user-interactive elements?
Control class is the base class of all the user-interactive elements in WPF.
Which of the following methods is used to collect and interpret data from end users to design an application. ?
2, Contextual design
3, Participatory design
Answer : 2
Which of the following methods is used to collect and interpret data from end users to design an application?
2, Contextual design
3, Participatory design
Answer : 1
suppose two interfaces have same method, so how will you implement these methods in derive class?
by using interface name
You are designing a single person shooter game application. The player can choose between multiple guns.
1) Pistol with 5 bullets
2) Shotgun with 100 bullets
3) Grenade Launcher with 20 grenades
Each gun will have different sound effects and graphics.
Pressing Ctrl+Space should rotate between guns.
Which design pattern should you employ for this?
Use Strategy Pattern.
Explanation: Each gun having different performance and graphics.
So this can be accomodated in the algorithm.
Strategy pattern is best suited for shifting the guns/algorithms
There will be a IGun interface implemented by 3 classes
Pistol : IGun
Shotgun : IGun
GrenadeLauncher : IGun
Why struct is not used to hold entity instead of class?
(eventhough struct provides us properties, methods and interface support)
Struct is a value type and
Class is a reference type.
Struct is stored in Stack - so if you pass a struct as argument to method - a new struct will be created on stack and values will be copied - this is a time consumingp process in the order of n.
Class is stored in Heap - so the same reference can be passed to various methods without duplication.
What is design pattern?
Design pattern are recurring solution to the recurring problem.
There are basically classified in to three categories. They are,
1. Creational pattern
2. Structural pattern
3. Behavioural pattern.
Which design pattern to use if i needed to add additional responsibilities at runtime?
Decorator Pattern design pattern is use if i needed to add additional responsibilities at runtime
You have got an App.exe and Lib.dll.
A class in App.exe is calling class in Lib.dll.
How can the class in Lib.dll call another class in App.exe without circular reference?
- Use interfaces
- Use delegate methods
- Use events
Quick Links For Interview Questions Categories:
Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.
So, Start looking our
section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.
Hall of Fame
Terms of Service
Tell A Friend