What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 25990 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > Pattern and Practices Interview Questions

Now you don't need go anywhere to get the best interview questions on Microsoft technology. We are trying to gather all real interview questions asked from MNCs and put them here. You can also assist us in doing so by submitting .net interview questions. These questions are generally different from certification questions however it may help you in that too.



Page copy protected against web site content infringement by Copyscape
Prototyping is the process of quickly putting together a working model in order to test various aspects of a design, illustrate ideas or features & gather early user feedback. It is believed to reduce project risks and cost.

TDD is a software development methodology involving repeatedly writing test cases for classes and then building the corresponding classes to implement only the code necessary to successful pass the tests.

For more terminology visit: http://www.headspringsystems.com/terminology.jsp

Domain-driven design (DDD) is an approach to the design of software, based on the two premises that complex domain designs should be based on a model, and that, for most software projects, the primary focus should be on the domain and domain logic (as opposed to being the particular technology used to implement the system).

For detail visit: http://en.wikipedia.org/wiki/Domain-driven_design

SRP stands for Single Responsibility Principle. This states that a class should have only one reason to change. If a class is doing too much (i.e. hitting the DB, writing files, doing business logic, calling a web service, etc, it’s violating SRP. It will be very difficult to change later should we need to change it, and it will likely be prone to have more defects.

SRP applies to the methods or in a class also. The two are inseparable. A class, or object, is the combination of its data and its behavior.

For more details read this document: Single Responsibility Principle
http://www.objectmentor.com/resources/articles/srp.pdf

Source: With input from Chad Myers

The IHttpHandler interface is implemented by all the handlers. The interface consists of one property called IsReusable. The IsReusable property gets a value indicating whether another request can use the IHttpHandler instance. The method ProcessRequest() allows you to process the current request. This is the core place where all your code goes. This method receives a parameter of type HttpContext using which you can access the intrinsic objects such as Request and Response. The IHttpHandlerFactory interface consists of two methods - GetHandler and ReleaseHandler. The GetHandler() method instantiates the required HTTP handler based on some condition and returns it back to ASP.NET. The ReleaseHandler() method allows the factory to reuse an existing handler.

Design patterns are recurring solution to recurring problems in software architecture

SOA is a logical encapsulation of self contained business functionality. To know completely about SOA visit http://www.dotnetfunda.com/articles/article204.aspx on this website.

--------------------
Answer Edited:

It can be achieved by a meta tag on the page the syntax is

<meta name="MSSmartTagsPreventParsing" content="TRUE">

According to Gang Of Four, there are three types of Design Pattern (Visit http://dofactory.com/Patterns/Patterns.aspx for more details)

1. Creational
2. Structural
3. Behavioral

Creational Design Pattern

Abstract Factory - Creates an instance of several families of classes
Builder - Separates object construction from its representation
Factory Method - Creates an instance of several derived classes
Prototype - A fully initialized instance to be copied or cloned
Singleton - A class of which only a single instance can exist

Structural Design Pattern

Adapter - Match interfaces of different classes
Bridge - Separates an object’s interface from its implementation
Composite - A tree structure of simple and composite objects
Decorator - Add responsibilities to objects dynamically
Facade - A single class that represents an entire subsystem
Flyweight - A fine-grained instance used for efficient sharing
Proxy - An object representing another object

Behavioral Design Pattern

Chain of Resp. - A way of passing a request between a chain of objects
Command - Encapsulate a command request as an object
Interpreter - A way to include language elements in a program
Iterator - Sequentially access the elements of a collection
Mediator - Defines simplified communication between classes
Memento - Capture and restore an object's internal state
Observer - A way of notifying change to a number of classes
State - Alter an object's behavior when its state changes
Strategy - Encapsulates an algorithm inside a class
Template Method - Defer the exact steps of an algorithm to a subclass
Visitor - Defines a new operation to a class without change

Above pattern and description has been copied from http://dofactory.com/Patterns/Patterns.aspx for information and knowledge purpose.

MVC:

Model View Controller. MVC pattern seperates the GUI from the Data.
It is commonly used in ADO.NET programming in ASP.NET(example)

MVC in context with ADO.NET/ASP.NET

MVC pattern separates objects in to three important sections:-

Model: - This section is specially for maintaining data. It is actually where we write
code for database connectivity, methods of DataReader, DataAdapter, properties
for passing data and writing validations
eg: Business Access Layer class, Data Access Layer class.

View: - Design of the .aspx page (The markup or the presentation layer)

Controller: - They are event handling section which affects either the model or the view. (eg: .aspx.cs)


Layer:
It refers to the separation of the logic (i.e the code and design) that is developed for an application in different files.

Tier:
It refers to the physical location of the Layer files.

example:
In an ASP.NET web site, we create GUI web forms, business logic , data access
logic, database all in one computer. In this case, we have 4 layers and 1 Tier.
if the GUI Web Forms,business logic, data access logic and database are all in
different computers, we have 4 layers and 4 Tiers.



We should not not use design patterns in following scenarios

• When the software is being designed and it would not change with time and new requirements.

• When the requirements of the source code of a particular application are unique and same.

Many new developers do not concentrate on prefixes of the variable declarations. But these initialization plays a major role because for large projects a single module will not be handled by a single individual so it must be generic that every one in the team should understand for what purpose a particular variable has been declared by just reading its name itself. So these are the generic steps to initialize variables.

------------------------------------------------------------------------------------------
Data Type---------------Example---------------Prefix
------------------------------------------------------------------------------------------
Boolean ------------------------ blnResult ------------------- bln
Byte ------------------------ bytYes ------------------- byt
Char ------------------------ chrSelect ------------------- chr
Date ------------------------ datStart ------------------- dat
Double ------------------------ dblSalary ------------------- dbl
Decimal ------------------------ decAverage ------------------- dec
Integer ------------------------ intStdid ------------------- int
Long ------------------------ lngValue ------------------- lng
Single ------------------------ sglStock ------------------- sql
Short ------------------------ shoShort ------------------- sho
String ------------------------ strEmpName ------------------- str
Object ------------------------ objSource ------------------- obj

The three test cases are :

1. Positive test cases - With this we need to provide correct data and test for correct output

2. Negative test cases - We need to check for broken or missing data

3. Exception test cases - Whether the exceptions which are thrown are handled properly or not

In Singleton Design Pattern , synchronization is essential only for the first time when the instance is to be created. When the instance is created then it becomes an overhead for each request.

public class Singleton

{
private static Singleton uniqueinstance;

private Singleton()
{
}

public static Singleton getinstance()
{
if(uniqueinstance == null)
{
uniqueinstance = new Singleton();
}
return uniqueinstance;
}
}


In the above code, when for the first time getinstance method is called, synchronization is needed. After the first instance is created, we no longer need synchronization.

Thanks and Regards
Akiii

Found this useful, bookmark this page link to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape
Navigate to Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 |

 More Exclusive Pattern and Practices Interview Questions and Answers here


Found interesting? Add this to:


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/23/2013 8:43:36 AM