Thursday, December 29, 2011

Explian metadata and Manifest of an Assembly

Manifest: Manifest describes assembly itself. Assembly Name, version number, culture, strong name, list of all files, Type references, and referenced assemblies.
Metadata: Metadata describes contents in an assembly classes, interfaces, enums, structs, etc., and their containing namespaces, the name of each type, its visibility/scope, its base class, the nterfaces it implemented, its methods and their scope, and each method?s parameters, type?s properties, and so on.

Saturday, December 17, 2011

How’s method overriding different from overloading?

When overriding, you change the method behavior for a derived class. Overloading simply involves having a method with the same name within the class.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Can you prevent your class from being inherited and becoming a base class for some other classes?

Yes, that’s what keyword sealed in the class definition is for. The developer trying to derive from your class will get a message: cannot inherit from Sealed class WhateverBaseClassName. It’s the same concept as final class in Java.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Where do the reference-type variables go in the RAM?

The references go on the stack, while the objects themselves go on the heap. However, in reality things are more elaborate.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is the difference between the value-type variables and reference-type variables in terms of garbage collection?

The value-type variables are not garbage-collected, they just fall off the stack when they fall out of scope, the reference-type objects are picked up by GC when their references go null.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

How do you convert a string into an integer in .NET?

Int32.Parse(string), Convert.ToInt32()

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What’s the difference between const and readonly?

You can initialize readonly variables to some runtime values. Let’s say your program uses current date and time as one of the values that won’t change. This way you declare

public readonly string DateT = new DateTime().ToString().

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is a yield in C#?

Another often overlooked C# statement that was introduced in .NET 2.0 is yield. This keyword is used to return items from a loop within a method and retain the state of the method through multiple calls.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is C#.NET Generics?

The classes and the methods can treat the values of different types uniformly with the use if generics.

The usage of generics is advantageous as:

  • They facilitate type safety
  • They facilitate improved performance
  • They facilitate reduced code
  • They promote the usage of parameterized types
  • The CLR compiles and stores information related to the generic types when they are instantiated. (The generic type instance refers to the location in memory of the reference type to which it is bound for all the instances of the generic type.)

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is the difference between const and readonly in C#.NET?

The read only can be modified by the class it is contained in. However, the const cannot be modified. It needs to be instantiated only at the compile time.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is Constructor Chaining?

We can chain the call of constructor from child class to base class depending on our requirement. This concept makes sure that the matching base class constructor must be called based on the parameter passed to the child class constructor.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is the difference between Finalize() and Dispose()?

Dispose() is called by as an indication for an object to release any unmanaged resources it has held.
Finalize() is used for the same purpose as dispose however finalize doesn’t assure the garbage collection of an object.
Dispose() operates determinalistically due to which it is generally preferred.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

How does the XmlSerializer work? What ACL permissions does a process using it require?

The XmlSerializer constructor generates a pair of classes derived from XmlSerializationReader and XmlSerializationWriter by analysis of the classes using reflection.

Temporary C# files are created and compiled into a temporary assembly and then loaded into a process.

The XmlSerializer caches the temporary assemblies on a per-type basis as the code generated like this is expensive. This cached assembly is used after a class is created. Therefore the XmlSerialize requires full permissions on the temporary directory which is a user profile temp directory for windows applications

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What are circular references? Explain how garbage collection deals with circular references.

A circular reference is a run-around wherein the 2 or more resources are interdependent on each other rendering the entire chain of references to be unusable.

There are quite a few ways of handling the problem of detecting and collecting cyclic references.

1. A system may explicitly forbid reference cycles.
2. Systems at times ignore cycles when they have short lives and a small amount of cyclic garbage. In this case a methodology of avoiding cyclic data structures is applied at the expense of efficiency.
3. Another solution is to periodically use a tracing garbage collector cycles.
Other types of methods to deal with cyclic references are:
•Weighted reference counting
•Indirect reference counting

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Explain the use of virtual, sealed, override, and abstract.

The virtual keyword enables a class to be overridden. If it has to be prevented from being overridden, then the sealed keyword needs to be used. If the keyword virtual is not used, members of the class can even then be overridden. However, its usage is advised for making the code meaningful.

The override keyword is used to override the virtual method in the base class. Abstract keyword is used to modify a class, method or property declaration. You cannot instantiate an abstract class or make calls to an abstract method directly.

An abstract virtual method means that the definition of the method needs to be given in the derived class.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Describe the accessibility modifier "protected internal" in C#.

The Protected Internal access modifier can be accessed by:
Members of the Assembly
The inheriting class
The class itself

Its access is limited to the types derived from the defining class in the current assembly or the assembly itself.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Explain the use of static members with example using C#.NET.

Static members are not associated with a particular instance of any class.
They need to be qualified with the class name to be called.
Since they are not associated with object instances, they do not have access to non-static members.
i.e.: "this" cannot be used, which represents the current object instance.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

How to achieve polymorphism in C#.NET?

Polymorphism is when a class can be used as more than one type through inheritance. It can be used as its own type, any base types, or any interface type if it implements interfaces.

It can be achieved in the following ways:
Derived class inherits from a base class and it gains all the methods, fields, properties and events of the base class.

To completely take over a class member from a base class, the base class has to declare that member as virtual.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is Constructor Chaining?

We can chain the call of constructor from child class to base class depending on our requirement. This concept makes sure that the matching base class constructor must be called based on the parameter passed to the child class constructor.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is ref parameter? What is out parameter?

Ref Parameter: Used to pass a parameter as a reference so that the function called will set the value. This could be used to return more than 1 value by a function.
e.g.
public int AddMuliply( int a , int b, ref int c)
{
c = a*b;
return ( a+b);
}
The above function, returns the addition of two numbers as well as computes the multiplication result and passes to the calling function.
Out Parameter: Used to pass values from the aspx Code-behind to the aspx page.
The difference is that for a ref parameter, you have to assign a value before you call the function, while for OUT parameter, you dont have to assign a value, the calling function assumes that the called function would assign some value.
A ref parameter must first be initialized before being passed from the calling function to the called function. but a out parameter need not be initialized, we can pass it directly when we pass a parameter as ref to a method, the method refers to the same variable and changes made will affect the actual variable.
even the variable passed as out parameter is same as ref parameter, but implementation in c# is different, Arguement passed as ref parameter must be initialized before it is passed to the method. But in case of out parameter it is not necessary. But after a call to a method as out parameter it is necessary to initialize.
When to use out and ref parameter, out parameter is used when we want to return more than one value from a method. Ref parameter can be used as both input and o/p parameter out parameter can be used as only output parameter

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Why multiple Inheritance is not possible in C#?

Multple inheritance is coneceptually wrong. It shouldn't be allowed in any language. Inheritance is the strongest relationship that can be expressed in OO languages.
It's used to express IS-A relationship. Aggregation is used to express IS CONSTRUCTED IN TERMS OF. If you're using multiple inheritance in C++ then you're design is wrong and you probably want to use aggregation. On the other hand it's plausible to want to use multiple interfaces. For instance you might have a class wheel and a class engine. You could say that your class car inherits from wheel and from engine but that's wrong. In fact car aggregates wheel and engine because it is built in terms of those classes. If wheel is an interface and engine is an interface then car must inherit both of these interfaces since it must implement the functionaity of wheel and engine .On this basis we can see that multiple inheritance for classes should not be allowed because it promotes mis-use of the strong IS-A relationship. C# enforces the correct concepts whilst C++ allows mis-use. multiple interface inheritance is permissible and C# allows this. It's all to do with properly understanding OO concepts.
Absolute Multiple Inheritance is not possible in c# but partially it supports multiple inheritance by the use of Interfaces. As interfaces force a class to implement same type of behaviour (as defined in interface) which classes implements that interface

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

How to prevent a class from being inherited in C#.NET?

 

The sealed modifier is used to prevent derivation from a class. An error occurs if a sealed class is specified as the base class of another class. A sealed class cannot also be an abstract class

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Difference between a Class and Component?

Class is a datatype that encloses data and function members.
It can be used for implementing the various OOPS features.
Component is a particular class that must implement the IComponent interface .It is the base class for all components in the common language runtime that marshal by reference. Component is remotable and derives from the MarshalByRefObject class.
IComponent interface belongs to System.ComponentModel namespace.
So, we can say Component is subclassification of a class

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What does the modifier protected internal in C# mean?

The Protected Internal can be accessed by Members of the Assembly or the inheriting class, and of course, within the class itself.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is polymorphism?

Polymorphism means allowing a single definition to be used with different types of data (specifically, different classes of objects). For example, a polymorphic function definition can replace several type-specific ones, and a single polymorphic operator can act in expressions of various types. Many programming languages implement some forms of polymorphism.
The concept of polymorphism applies to data types in addition to functions. A function that can evaluate to and be applied to values of different types is known as a polymorphic function. A data type that contains elements of different types is known as a polymorphic data type.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is a static constructor?

Static Constructor - It is a special type of constructor, introduced with C#. It gets called before the creation of the first object of a class(probably at the time of loading an assembly).

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is the difference between out and ref in C#?


1) out parameters return compiler error if they are not assigned a value in the method. Not such with ref parameters.
2) out parameters need not be initialized before passing to the method, whereas ref parameters need to have an initial value before they are passed to a method.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What's the difference between IEnumerable and List ?

1. IEnumerable is an interface, where as List is one specific implementation of IEnumerable. List is a class.
2. FOR-EACH loop is the only possible way to iterate through a collection of IEnumerable, where as List can be iterated using several ways. List can also be indexed by an int index, element can be added to and removed from and have items inserted at a particular index.
3. IEnumerable doesn't allow random access, where as List does allow random access using integral index.
4. In general from a performance standpoint, iterating thru IEnumerable is much faster than iterating thru a List.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is the difference between LINQ to SQL and Entity framework?

Following is the LINQ interview questions asked in an interview: -

LINQ to SQL is good for rapid development with SQL Server. EF is for enterprise scenarios and works with SQL server as well as other databases.
• LINQ maps directly to tables. One LINQ entity class maps to one table. EF has a conceptual model and that conceptual model map to storage model via mappings. So one EF class can map to multiple tables or one table can map to multiple classes.
• LINQ is more targeted towards rapid development while EF is for enterprise level where the need is to develop loosely coupled framework.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Delegtes and Events

An interesting and useful property of a delegate is that it does not know or care about the class of the object that it references.
public delegate void SimpleDelegate ()
A delegate will allow us to specify what the function we'll be calling looks like without having to specify whichfunction to call.
Delegate and Event concepts are completely tied together. Delegates are just function pointers, That is, they hold references to functions.
A Delegate is a class. When you create an instance of it, you pass in the function name (as a parameter for the delegate's constructor) to which this delegate will refer.
Every delegate has a signature. For example:
Eg:
using System;
namespace Akadia.BasicDelegate
{
// Declaration
public delegate void SimpleDelegate();
class TestDelegate
{
public static void MyFunc()
{
Console.WriteLine("I was called by delegate ...");
}
   public static void Main()
{
// Instantiation
SimpleDelegate simpleDelegate = new SimpleDelegate(MyFunc);
// Invocation
simpleDelegate();
}
}
}

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is Connection Pool

multiple process agree to share same parameter to connect.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Compare Oledb and Odbc

oledb: for oracle, mysql but under microsoft layer so slow.

   odbc: backward compatability

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Expand ACID

     Atomicity, Consistency, Isolated, Durable

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Explain Normalization in brief

   1.  There shoudl be one-one relatiionship b/w instance of entity and row in a table

   2. A field should have same meaning in each row.

  3. Each table represents atmost one entity.

  4a. Multiple instance of entity represents by multiple rows in a table.

  4b. Multiple instance of entity  should not be represents as multiple table.

5. Joins should be based only on primary foreign key equality.

6. keys should links correctly.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Compare Clustered and Non-Clustered Index

 clustered index

    >  are unique and only one in a row. It is physically sorted index.

    >  clustered are the one which will not be changed often.

Non-clustered index

    >  logical sorted index

    > is logically stored a table can have 249 non clustred index.Non clustered index will be created automatically when u
create unique key on a column.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Explain Cursor

Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, its like recordset in the ASP and visual basic.

Fetch, open, close, scrollable.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

what is diffrence between Function Oriented Design and Obeject Oriented design

In fod the main program is divided into no.of small program
that program is called function.the FOD follows top to
bottom or bottom to top approach. Where as OOD pattern
follows OOP s concept. Every thing is being object
2. In FOD the function must retun a value. where as OOD an
object need not to be return a value

Design Patterns are categorized in 3 types

1. Creational

2. Structural

3. Behavioural

Creational

1.  Abstract Factory method

2. Factory method

3. Builder pattern

4. Lazy pattern

5. Prototype pattern

6. Singleton

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is the difference between Abstract Factory patternand Factory Pattern?

A framework is provided for creating sub-components that inherit from common-component.

In .Net, achieved by creating classes that implement a common interface or a set of interfaces,

where the interface comprises of the generic method declarations that are passed on the sub-components. Eg: GovtRules(), will have PoliceRules(), courtRules().

Factory pattern:  Objects are created without knowing the class of the object.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is structural design pattern

Establishes relations b/w entities. Making it easier for different components of an application to interact with each other.

Adapter Pattern : Interfaces of classes vary depending on requirement.

Bridge Pattern : class level abstraction is seperated from its implementations.

Composite : Individual and group objects are treated similarly.

Decorator : Functionality is assigned to an object.

Facade : common interface is shared b/w diff interface to have similarity.

Flyweight : sharing a group of small objects.

Proxy pattern : when objects are complex and need to be shared, its copies are made.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

what are different types of Proxy Pattern in C#

1. Remote :  A ref is given to a diff objects in a diff memory location.

2. Vitual: is created only when really required because of memory usage.

3 Cache : object behaves as temp storage so multiple applications may use it.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Explain Behavioural Design Pattern

focusses on improving the communication b/w diff objects.

Types:

  1. Chain/Responsibilities : objects communicate with each other depending on logical decisions made by class.

2. Command Pattern : objects encapsulate methods and the parameters passed to them.

3. Observer : objects created depending on the events results, for which there are event handlers created.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Comparison / Difference .net framework 2.0-3.5-4.0

NET framework 2.0:

--------------------------------------------------------------------------

2.0 = Framework that shipped with VS 2005 VB 8.0 / C# 2.0

It involves

1) Generics

2) Anonymous methods

3) Partial class

4) Nullable type

5) The new API gives a fine grain control on the behavior of the runtime with regards to multithreading, memory allocation, assembly loading and more

5) Full 64-bit support for both the x64 and the IA64 hardware platforms

6) New personalization features for ASP.NET, such as support for themes, skins and web parts.

7) .NET Micro Framework

8) Language support for Generics built directly into the .NET CLR.

9) Many additional and improved ASP.NET web controls.

10) New data controls with declarative data binding.

--------------------------------------------------------------------------

.NET framework 3.0:

--------------------------------------------------------------------------

3.0 = Framework as 2.0 + WCF + WPF + WF

1) It is called as WinFX, includes a new set of managed code APIs that are an integral part of Windows Vista and Windows Server 2008 operating systems and provides

2) Windows Communication Foundation (WCF), formerly called Indigo; a service-oriented messaging system which allows programs to interoperate locally or remotely similar to web services.

3) Windows Presentation Foundation (WPF), formerly called Avalon; a new user interface subsystem and API based on XML and vector graphics, which uses 3D computer graphics hardware and Direct3D technologies.

4) Windows Workflow Foundation (WF) allows for building of task automation and integrated transactions using workflows.

5) Windows CardSpace, formerly called InfoCard; a software component which securely stores a person's digital identities and provides a unified interface for choosing the identity for a particular transaction, such as logging in to a website

--------------------------------------------------------------------------

.NET framework 3.5:

--------------------------------------------------------------------------

3.5 = all the above + LINQ technologies and will ship with the next VS including VB 9.0 and C# 3.0

1) 3.5 will be shipped with the next Visual Studio and the most dominant change is the addition of LINQ (language integrated query) technologies. There will also be new framework classes (for example, new encryption classes designed to utilize CNG). The languages themselves will probably have more significant changes than the framework.

2) It implements Linq evolution in language. So we have the following evolution in class:

a) Linq for SQL, XML, Dataset, Object

b) Addin system

c) p2p base class

d) Active directory

3) ASP.NET Ajax

4) Anonymous types with static type inference

5) Paging support for ADO.NET

6) ADO.NET synchronization API to synchronize local caches and server side datastores

7) Asynchronous network I/O API

8) Support for HTTP pipelining and syndication feeds.

9) New System.CodeDom namespace.

Following are list of Major Changes in .Net 4.0

  1. ControlRenderingCompatabilityVersion Setting in the Web.config File
  2. ClientIDMode Changes
  3. HtmlEncode and UrlEncode Now Encode Single Quotation Marks
  4. ASP.NET Page (.aspx) Parser is Stricter
  5. Browser Definition Files Updated
  6. System.Web.Mobile.dll Removed from Root Web Configuration File
  7. ASP.NET Request Validation
  8. Default Hashing Algorithm Is Now HMACSHA256
  9. Configuration Errors Related to New ASP.NET 4 Root Configuration
  10. ASP.NET 4 Child Applications Fail to Start When Under ASP.NET 2.0 or ASP.NET 3.5 Applications
  11. ASP.NET 4 Web Sites Fail to Start on Computers Where SharePoint Is Installed
  12. The HttpRequest.FilePath Property No Longer Includes PathInfo Values
  13. ASP.NET 2.0 Applications Might Generate HttpException Errors that Reference eurl.axd
  14. Event Handlers Might Not Be Not Raised in a Default Document in IIS 7 or IIS 7.5 Integrated Mode Changes to the ASP.NET Code Access Security (CAS) Implementation
  15. MembershipUser and Other Types in the System.Web.Security Namespace Have Been Moved
  16. Output Caching Changes to Vary * HTTP Header
  17. System.Web.Security Types for Passport are Obsolete
  18. The MenuItem.PopOutImageUrl Property Fails to Render an Image in ASP.NET 4
  19. Menu.StaticPopOutImageUrl and Menu.DynamicPopOutImageUrl Fail to Render Images When Paths Contain Backslashes

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is prototype pattern in C#

relies on creation of clones rather than objects. Here , we avoid using keyword ‘new’ to prevent overheads

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is Lazy design pattern?

is not to create object until specific requirement matches, and when it matches, object creation will be triggered.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

What is Builder Pattern

An object creation process is seperated from the object design construct. This is useful because the same method that deals with construction of the object, can be used to construct different design constructs.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

Explain SaaS

Software as a service (or SaaS) is a way of delivering applications over the Internet—as a service. Instead of installing and maintaining software, you simply access it via the Internet, freeing yourself from complex software and hardware management.

SaaS applications are sometimes called Web-based software, on-demand software, or hosted software. Whatever the name, SaaS applications run on a SaaS provider’s servers. The provider manages access to the application, including security, availability, and performance.

Disadvantages of Saas:

Powerful Internet Connection Required

Increased Security Risk

Load Balancing Feature 

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

what is the difference between the Adapter Pattern and Proxy Patterns?its seems both are almost similar?

Comparing Adapter Pattern with other Patterns:
1. Adapter converts one interface to another, Decorator doesn't alter interface but adds responsibility. Facade makes an interface simpler.
Decorator is thus more transparent to the application than an adapter is. As a consequence, Decorator supports recursive composition, which isn't possible with pure Adapters.
2. Adapters allows client to make use of libraries and subsets without changing any code. Decorators allow new behaviour to be added to the classes with out altering the existing code.
3. Adapter make things work after they're designed, Bridge makes them work before they are.
4. Bridge is designed up-front to let the abstraction and the implementation vary independently. Adapter is retrofitted to make unrelated classes work together.
5. Adapter provides a different interface to its subject. Proxy provides the same interface. Decorator provides an enhanced interface.
6. Facade defines a new interface, whereas Adapter reuses an old interface. Remember that Adapter makes two existing interfaces work together as opposed to defining an entirely new one.

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

How IIs process for the ASP.Net Requests?

Background:

"WebDev.webServer.exe" takes care of all requests and responses of web app.

Worker Process : w3wp.exe runs Asp.net application in IIS, which manages request/responses from client.

Application Pool: container of worker proces. used to seperate sets of IIS worker processes.

Application pools enables a better security, reliability, and availability for any web application.

IIS :

1.Kernel Mode

2. User Mode

Kernel mode is introduced with IIS 6.0, which contains the HTTP.SYS.  So whenever a request comes from Client to Server, it will hit HTTP.SYS First.

image19

Whenever we creates a new Application Pool, the ID of the Application Pool is being generated and it’s registered with the HTTP.SYS. So whenever HTTP.SYS Received the request from any web application, it checks for the Application Pool and based on the application pool it send the request.

image07

2. User Mode

we have Web Admin Services (WAS) which takes the request from HTTP.SYS and pass it to the respective application pool.

image16

When Application pool receive the request, it simply pass the request to worker process (w3wp.exe) . The worker process“w3wp.exe” looks up the URL of the request in order to load the correct ISAPI extension. ISAPI extensions are the IIS way to handle requests for different resources. Once ASP.NET is installed, it installs its own ISAPI extension (aspnet_isapi.dll)and adds the mapping into IIS.  

When Worker process loads the aspnet_isapi.dll, it start an HTTPRuntime, which is the entry point of an application.HTTPRuntime is a class which calls the ProcessRequest method to start Processing.

image01

When this methods called, a new instance of HTTPContext is been created.  Which is accessible usingHTTPContext.Current  Properties. This object still remains alive during life time of object request.  Using HttpContext.Current we can access some other objects like Request, Response, Session etc.

image12

After that HttpRuntime load an HttpApplication object with the help of  HttpApplicationFactory class.. Each and every request should pass through the corresponding HTTPModule to reach to HTTPHandler, this list of module are configured by the HTTPApplication.

Now, the concept comes called “HTTPPipeline”. It is called a pipeline because it contains a set of HttpModules ( For Both Web.config and Machine.config level) that intercept the request on its way to the HttpHandler. HTTPModules are classes that have access to the incoming request. We can also create our own HTTPModule if we need to handle anything during upcoming request and response.

image05

HTTP Handlers are the endpoints in the HTTP pipeline. All request that are passing through the HTTPModule should reached to HTTPHandler.  Then  HTTP Handler  generates the output for the requested resource. So, when we requesting for any aspx web pages,   it returns the corresponding HTML output.

All the request now passes from  httpModule to  respective HTTPHandler then method and the ASP.NET Page life cycle starts.  This ends the IIS Request processing and start the ASP.NET Page Lifecycle.

image08

 

 

List of Asked Interview Questions: C# .NET SQL MVC WCF Questions

C# MVC WCF .NET SQL Questions

  

Q. Explain Manifest and Metadata of an Assembly

[Answers]

Q.

What are Generics ?

[Answers]

 

Q.

Explain performance of Generics.

 

 

Q.

Difference between Arraylist and List?

 

 

Q.

Converting Arraylist to List.

 

 

Q.

Converting List to Arraylist

 

 

Q.

What is the CLR?

 

 

Q.

What is the CTS?

 

 

Q.

What is the CLS?

 

 

Q.

What is IL?

 

 

Q.

What does 'managed' mean in the .NET context?

 

 

Q.

What is reflection?

 

 

Q.

What is an assembly?

 

 

Q.

How can I produce an assembly?

 

 

Q. What are different types of assembly
Q.

What is the difference between a private assembly and a shared assembly?

Q.

How do assemblies find each other?

Q.

How does assembly versioning work?

Q.

What is an Application Domain?

Q.

How does an AppDomain get created?

Q.

What is garbage collection?

Q.

Is it true that objects don't always get destroyed immediately when the last reference goes away?

Q.

Why doesn't the .NET runtime offer deterministic destruction?

Q.

Does non-deterministic destruction affect the usage of COM objects from managed code?

Q.

Finalize methods should be avoided. Should I implement Finalize on my class?

Q.

Do I have any control over the garbage collection algorithm?

Q.

How can I find out what the garbage collector is doing?

Q.

What is serialization?

Q.

Does the .NET Framework have in-built support for serialization?

Q.

BinaryFormatter?

Q. Can I customise the serialization process?
Q.

Why is XmlSerializer so slow?

Q.

Why do I get errors when I try to serialize a Hashtable?

Q. XmlSerializer is throwing a generic "There was an error reflecting MyClass" error. How do I find out what the problem is?
Q.

What are attributes?

Q. How to do Attribute programming?
Q.

Can I create my own metadata attributes?

Q.

What is Code Access Security (CAS)?

Q.

How does CAS work?

Q.

Who defines the CAS code groups?

Q.

How do I define my own code group?

Q.

How do I change the permission set for a code group?

Q. Can I create my own permission set?
Q.

I can't be bothered with all this CAS stuff. Can I turn it off?

Q.

Can I look at the IL for an assembly?

Q.

Can source code be reverse-engineered from IL?

Q.

How can I stop my code being reverse-engineered from IL?

Q. Can I write IL programs directly?
Q.

Can I do things in IL that I can't do in C#?

Q.

Is COM dead?

Q. Is DCOM dead?
Q.

Can I use COM components from .NET programs?

Q.

Can I use .NET components from COM programs?

Q.

Is ATL redundant in the .NET world?

Q.

How does .NET remoting work?

Q. How can I get at the Win32 API from a .NET program?
Q. How do I read from a text file?
Q.

How do I write to a text file?

Q.

How do I read/write binary files?

Q.

How do I delete a file?

Q.

Are regular expressions supported?

Q.

How do I download a web page?

Q.

How do I use a proxy?

Q.

Is DOM supported?

Q.

Is SAX supported?

Q.

Is XPath supported?

Q. THREADING
Q.

Is multi-threading supported?

Q.

How do I spawn a thread?

Q.

How do I stop a thread?

Q.

How do I use the thread pool?

Q.

How do I know when my thread pool work item has completed?

Q.

How do I prevent concurrent access to my data?

Q.

Is there built-in support for tracing/logging?

Q.

Can I redirect tracing to a file?

Q.

Can I customise the trace output?

Q. What platforms support .NET?
Q.

What are the fundamental differences between value types and reference types?

Q.

Structs are largely redundant in C++. Why does C# have them?

Q.

How would you define an Anonymous Functions? What is the difference between Anonymous Methods and Lambda Expressions?

Q.

How does an Enumerator (IEnumerable & IEnumerator) work ? How does an Iterator work in C# 2.0 ?

Q.

What is Garbage Collection ? How does it work ? What are generations in GC ?

Q.

What is the role of an Extension Method ? When would you use it ?

Q.

What is a Lambda Expression ? Where would you use it ?

Q.

How would you define a new custom event ?

Q. Difference between Debug and Release
Q. How would you choose between a pure abstract base class and an interface
Q.

What is MVC how does it differ from MVP ?

Q.

1. What is Dependency Injection / Inversion of Control ?

Q.

1. What Design Patterns are you familiar with ?

Q. What’s the implicit name of the parameter that gets passed into the class’ set method?
Q. How do you inherit from a class in C#?
Q. Does C# support multiple inheritance?  HOW ?
Q. When you inherit a protected class-level variable, who is it available to?
Q. Are private class-level variables inherited?
Q. Describe the accessibility modifier protected internal.
Q. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
Q. What’s the top .NET class that everything is derived from?
Q. How’s method overriding different from overloading?
Q. What does the keyword virtual mean in the method definition?
Q. Can you declare the override method static while the original method is non-static?
Q. Can you override private virtual methods?
Q. Can you prevent your class from being inherited and becoming a base class for some other classes?
Q. Can you allow class to be inherited, but prevent the method from being over-ridden?
Q. What’s an abstract class?
Q. When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?
Q. What’s an interface class?
Q. Why can’t you specify the accessibility modifier for methods inside the interface?
Q. Can you inherit multiple interfaces?
Q. And if they have conflicting method names?
Q. What’s the difference between an interface and abstract class?
Q. How can you overload a method?
Q. If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor?
Q. What’s the difference between System.String and System.StringBuilder classes?
Q. What’s the advantage of using System.Text.StringBuilder over System.String?
Q. Can you store multiple data types in System.Array?
Q. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
Q. How can you sort the elements of the array in descending order?
Q. What’s the .NET datatype that allows the retrieval of data by a unique key?
Q. What’s class SortedList underneath?
Q. Will finally block get executed if the exception had not occurred?
Q. What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?
Q. Can multiple catch blocks be executed?
Q. Why is it a bad idea to throw your own exceptions?
Q. What’s a delegate?
Q. What’s a multicast delegate?
Q. How’s the DLL Hell problem solved in .NET?
Q. What are the ways to deploy an assembly?
Q. What’s a satellite assembly?
Q. What namespaces are necessary to create a localized application?
Q. What’s the difference between // comments, /* */ comments and /// comments?
Q. How do you generate documentation from the C# file commented properly with a command-line compiler?
Q. What’s the difference between <c> and <code> XML documentation tag?
Q. Is XML case-sensitive?
Q. What debugging tools come with the .NET SDK?
Q. What does the This window show in the debugger?
Q. What does assert() do?
Q. What’s the difference between the Debug class and Trace class?
Q. Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
Q. Where is the output of TextWriterTraceListener redirected?
Q. How do you debug an ASP.NET Web application?
Q. What are three test cases you should go through in unit testing?
Q. Can you change the value of a variable while debugging a C# application?
Q. Explain the three services model (three-tier application).
Q. What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET?
Q. What’s the role of the DataReader class in ADO.NET connections?
Q. What is the wildcard character in SQL? Let’s say you want to query database with LIKE for all employees whose name starts with La.
Q. What does Dispose method do with the connection object
Q. What connections does Microsoft SQL Server support?
Q. Which one is trusted and which one is untrusted?
Q. Why would you use untrusted verificaion?
Q. What does the parameter Initial Catalog define inside Connection String
Q. What’s the data provider name to connect to Access database?
Q. What is a pre-requisite for connection pooling?
Q. What’s the implicit name of the parameter that gets passed into the class’ set method?
Q. How do you inherit from a class in C#?
Q. Does C# support multiple inheritance?
Q. When you inherit a protected class-level variable, who is it available to?
Q. Are private class-level variables inherited?
Q. Describe the accessibility modifier protected internal.
Q. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?
Q. What’s the top .NET class that everything is derived from?
Q. How’s method overriding different from overloading?
Q. What does the keyword virtual mean in the method definition?
Q. Can you declare the override method static while the original method is non-static?
Q. Can you override private virtual methods?
Q. Can you prevent your class from being inherited and becoming a base class for some other classes?
Q. Can you allow class to be inherited, but prevent the method from being over-ridden?
Q. What’s an abstract class?
Q. When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)?
Q. What’s an interface class?
Q. Why can’t you specify the accessibility modifier for methods inside the interface?
Q. Can you inherit multiple interfaces?
Q. And if they have conflicting method names?
Q. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
Q. What’s the difference between Response.Write() andResponse.Output.Write()?
Q. What methods are fired during the page load?
Q. Where does the Web page belong in the .NET Framework class hierarchy?
Q. Where do you store the information about the user’s locale?
Q. What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
Q. What’s a bubbled event?
Q. Suppose you want a certain ASP.NET function executed on MouseOver overa certain button. Where do you add an event handler?
Q. What data type does the RangeValidator control support?
Q. Explain the differences between Server-side and Client-side code?
Q. What type of code (server or client) is found in a Code-Behind class?
Q. Should validation (did the user enter a real date) occur server-side or client-side? Why?
Q.
What does the "EnableViewState" property do? Why would I want it on or off?
Q. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
Q.

Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?

Q. you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines? 
Q. Can you explain what inheritance is and an example of when you might use it?
Q. Whats an assembly? 
Q. Describe the difference between inline and code behind
Q. Explain what a diffgram is, and a good use for one?
Q. . Whats MSIL, and why should my developers need an appreciation of it if at all?
Q. Which method do you invoke on the DataAdapter control to load your generated dataset with data?
Q. Can you edit data in the Repeater control?
Q. Which template must you provide, in order to display data in a Repeater control?
Q. How can you provide an alternating color scheme in a Repeater control?
Q. What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?
Q. What base class do all Web Forms inherit from?
Q. Name two properties common in every validation control?
Q. . What tags do you need to add within the asp:datagrid tags to bind columns manually?
Q. What tag do you use to add a hyperlink column to the DataGrid?
Q. What is the transport protocol you use to call a Web service?
Q. What does WSDL stand for?
Q. What is UDDI
Q. What is SOAP
Q. To test a Web service you must create a windows application or Web application to consume this service?
Q. How many classes can a single .NET DLL contain?
Q. Can you write a class without specifying namespace? Which namespace does it belong to by default??
Q. You are designing a GUI application with a window and several widgets on it. The user then resizes the app window and sees a lot of grey space, while the widgets stay in place. What’s the problem?
Q. How can you save the desired properties of Windows Forms application?
Q. So how do you retrieve the customized properties of a .NET application from XML .config file?
Q. Can you automate this process?
Q. My progress bar freezes up and dialog window shows blank, when an intensive background process takes over.
Q. What’s the safest way to deploy a Windows Forms app?
Q. Why is it not a good idea to insert code into InitializeComponent method when working with Visual Studio?
Q. What’s the difference between WindowsDefaultLocation and WindowsDefaultBounds?
Q. What’s the difference between Move and LocationChanged? Resize and SizeChanged?
Q. How would you create a non-rectangular window, let’s say an ellipse?
Q. How do you create a separator in the Menu Designer?
Q. How’s anchoring different from docking? page 16
Q. What is Code Refactoring?
Q. What does the term immutable mean?
Q. ASP.Net Web Matrix ?
Q. IIS port number? How We get it ?
Q. Diffrence between Abstract and Interface ?
Q. Explain State management in Asp.net
Q. Diffrence between Viewstate and Session ?
Q. How to Write to XML File?
Q. What is Boxing & Unboxing ?
Q. Define three test cases you should go through in unit testing ?
Q. What debugging tools come with the .NET SDK ?
Q. What does assert() method do ?
Q. What is DiffGram ?
Q. Diffrence Between ServerSide and ClientSideCode ?
Q. Something about Session ?
Q. What is Server.Transfer and Response.Redirect ?
Q. Server Control and User Control ?
Q. ACID in transactions ?
Q. what is Connection pool ? What is the default value and can we change the value
Q. What is correlated sub-query?
Q. What is PostBack & Callback?
Q. What is Cursor ?
Q. What is AUTOEVENTWIREUP?
Q. Diffrence between Code Directory and Bin Directory ?
Q. Diffrence between DataReader and DataAdapter ?
Q. Does SQLClient and OLEdb class share the same function ?
Q. Difference between Data reader and Dataset ?
Q. Diffrence between function and StoreProcedure ?
Q.

How to do direct csv importing in SQL Stored procedure only

Q. How to do SQL table to CSV file using only stored procedure
Q.

Getting list of files in a folder using SQL SP

REMOTING
Q. What’s a Windows process?
Q. What’s typical about a Windows process in regards to memory allocation?
Q. Why do you call it a process? What’s different between process and application in .NET, not common computer usage, terminology?
Q. What distributed process frameworks outside .NET do you know?
Q. What are possible implementations of distributed applications in .NET?
Q. When would you use .NET Remoting and when Web services?
Q. What’s a proxy of the server object in .NET Remoting?
Q. What are remotable objects in .NET Remoting?
Q. What are channels in .NET Remoting?
Q. What security measures exist for .NET Remoting in System.Runtime.Remoting?
Q. What is a formatter?
Q. Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters, what are the trade-offs?
Q. What’s SingleCall activation mode used for?
Q. What’s Singleton activation mode? A
Q. How do you define the lease of the object?
Q. Can you configure a .NET Remoting object via XML file?
Q. How can you automatically generate interface for the remotable object in .NET with Microsoft tools?
Q.
How IIs process for the ASP.Net Requests?
Answer ...
Q.

what is the difference between the Adapter Pattern and Proxy Patterns?its seems both are almost similar?

Answer...
Q. Explain SaaS Answer ...
Q.
What is Builder Pattern
Answer..
Q.
What is Lazy design pattern?
Answer...
Q.
What is prototype pattern in C#
Answer...
Q.
Comparison / Difference .net framework 2.0-3.5-4.0
Answer...
Q.
Explain Behavioural Design Pattern
Answer...
Q.
what are different types of Proxy Pattern in C#
Answers
Q.
What is structural design pattern
Answers