Dot Net Interview Questions – Set 10

What is the Diamond of Death?

It is an ambiguity that arises due to multiple inheritances in C#. Two classes B and C inherit from A, and D inherits from both B and C but doesn’t override the method defined in A. The Diamond Problem arises when class B or C has overridden the method differently and D cannot decide to inherit from either B or C.

How is a Managed code executed?

The steps for executing a managed code are as follows:

  • Choose a language compiler depending on the language of the code.
  • Convert the code into Intermediate language using its own compiler.
  • The IL is then targeted to CLR which converts the code into native code using JIT.
  • Execution of Native code.

Explain the boxing and unboxing concept in .Net?

Boxing: Boxing is a process of converting value type into reference type.

Unboxing: Unboxing is a process of converting reference type to value type.

How do you implement a generic action in WebAPI?

It’s not possible, as the WebAPI runtime needs to know the method signatures in advance.

Name design patterns in the .NET Framework.

There are 23 design patterns classified into 3 categories:

1. Creational Design Pattern

i. Factory Method

ii. Abstract Factory

iii. Builder

iv. Prototype

v. Singleton

2. Structural Design Patterns

i. Adapter

ii. Bridge

iii. Composite

iv. Decorator

v. Façade

vi. Flyweight

vii. Proxy

3. Behavioral Design Patterns

i. Chain of Responsibility

ii. Command

iii. Interpreter

iv. Iterator

v. Mediator

vi. Memento

vii. Observer

viii. State

ix. Strategy

x. Visitor

xi. Template Method

What are the parameters that control most of connection pooling behaviors?

The following parameters control the connection pooling behavior:

  • Connect Timeout
  • Max Pool Size
  • Min Pool Size
  • Pooling

What do you mean by AutoPostBack?

AutoPostBack is a property which is used to postback automatically when an event is raised. You have to set the AutoPostBack property of the control to True.

What is the difference between Response.Redirect and Server.Transfer?

Response.Redirect basically redirects the user’s browser to another page or site. The history of the user’s browser is updated to reflect the new address as well. It also performs a trip back to the client where the client’s browser is redirected to the new page.

Whereas, Server.Transfer transfers from one page to the other without making any round-trip back to the client’s browser. The history does not get updated in the case of Server.Transfer.

What is the difference between DLL and EXE?

EXE files are single outbound files that cannot be shared with other applications. DLL files are multiple inbound files that are shareable.

What is HTTP Handler?

Every request into an ASP.NET application is handled by a specialized component called HTTP handler. It is the most important component for handling ASP.NET application requests.

It uses different handlers to serve different files. The handler for web page creates the page and control objects, runs your code and then renders the final HTML.

Following are the default HTTP handlers for ASP.NET:

  • Page Handler(.aspx): Handles web pages
  • User Control Handler(.ascx): It handles web user control pages
  • Web Service Handler(.asmx): Handles web service pages
  • Trace Handler(trace.axd): It handles trace functionality