ASP.NET caching interview questions: – What are dependencies in cache and types of dependencies? What is Cache Callback in Cache?

Dependencies in cache: -

When you add an item to the cache, you can define dependency relationships that can force that item to be removed from the cache under specific activities of dependencies.Example if the cache object is dependent on file and when the file data changes you want the cache object to be update.

Types of dependencies: -

Following are the supported dependency:-

  • File dependency: - Allows you to invalidate a specific cache item when a disk based file or files change.
  • Time-based expiration: - Allows you to invalidate a specific cache item depending on predefined time.
  • Key dependency:- Allows you to invalidate a specific cache item depending when another cached item changes.

Cache Callback in Cache: -

Cache object is dependent on its dependencies example file based, time based etc…Cache items remove the object when cache dependencies change.ASP.NET provides capability to execute a callback method when that item is removed from cache

Also see following ASP.NET caching interview questions video on difference between Session VS Viewstate: -

Posted in Uncategorized | Tagged , , , , , | Leave a comment

ASP.NET interview questions: – What are the various modes of storing ASP.NET session? How can we do caching in ASP.NET?

These are the ASP.NET interview questions asked number of times by interviewer. If you are still not clear with it, read the following answer.

  • InProc: - In this mode Session, state is stored in the memory space of the Aspnet_wp.exe process. This is the default setting. If the IIS reboots or web application restarts then session state is lost.
  • StateServer:- In this mode Session state is serialized and stored in a separate process (Aspnet_state.exe); therefore, the state can be stored on a separate computer(a state server).
  • SQL SERVER: - In this mode Session, state is serialized and stored in a SQL Server database.

Session state can be specified in <sessionState> element of application configuration file. Using State Server and SQL SERVER session state can be shared across web farms but note this comes at speed cost as ASP.NET needs to serialize and deserialize data over network repeatedly.

Acheiving caching in ASP.NET -

There are two ways doing of caching: -

  • output cache directive and
  • using the cache objects.

Also see following ASP.NET interview questions video on Session VS Viewstate difference:-

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

ASP.NET interview questions: – Differences and who performs faster between Grid view, Data list, and repeater? How to use a checkbox in a data grid?

Comparison between is always most favorite ASP.NET interview questions of the interviewer in order to judge developer skills. So here we have attempted to bring in forward one comparison from ASP.NET.

So here goes the answer: -

Grid view and data grid by default display all the data in tabular format i.e. in table and rows. Developer has no control to change the table data display of datagrid.

Data list also displays data in a table but gives some flexibility in terms of displaying data row wise and column wise using the repeat direction property.

Repeater control is highly customizable. It does not display data in table by default. So you can customize from scratch the way you want to display data.

Performance wise: -

Repeater is fastest followed by Datalist/Gridview and finally data grid.

Using checkbox in a data grid: -

Following are the steps to be done:-

  • In ASPX page you have to add Item template tag in data grid.

<asp:CheckBox id=”CheckBox1″ runat=”server” AutoPostBack=”True”

If you look at the Item template, we have “OnCheckChanged” event. This “OnCheckChanged” event has “Check Clicked” subroutine is actually in behind code. Note this method, which is in behind code, should either be “protected” or “public”

  • Following below is the subroutine, which defines the method

Protected Sub Check Clicked (By Val sender As Object, By Val e As EventArgs)
‘Do something
End Sub


Posted in Uncategorized | Tagged , , , , , , | Leave a comment

ASP.NET interview questions: – Difference between Authentication and authorization? What are the various ways of authentication techniques in ASP.NET?

Difference between Authentication and authorization: -

This can be a tricky question. These two concepts seem altogether similar but there is wide range of difference.

Authentication is verifying the identity of a user and authorization is process where we check does this identity have access rights to the system. Authorization is the process of allowing an authenticated user access to resources.

Various ways of authentication techniques in ASP.NET: -

There are 3 major ways of doing authentication and authorization:-

  • Windows: – In this mode the users are stored in windows local user groups.
  • Forms: – In this mode we create a login screen and use the forms authentication class to do validations. It’s a ticket based authentication.
  • Passport: -In this mode the users are validated from Microsoft sites like hotmail , devhood , MSN etc , ticket is generated and that ticket can be used to do authentication and authorization in your web application.

Also see the other following ASP.NET interview questions video implement ASP.NET Forms Authentication: -

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

ADO.NET interview questions: – What is the use of data adapter? What are basic methods of Data adapter?

Data adapter object acts like a bridge it helps to load the dataset object. Below is a simple code snippet which shows how the data adapter object is created and then using the fill method the dataset object is loaded.

Basic methods of Data adapter: -

There are three most commonly used methods of Data adapter: -

Fill: - Executes the Select Command to fill the Dataset object with data from the data source. It can also be used to update (refresh) an existing table in a Dataset with changes made to the data in the original data source if there is a primary key in the table in the Dataset.

Fill Schema: – Extracts just the schema for a table from the data source, and creates an empty table in the DataSet object with all the corresponding constraints.

Update: - Updates the original datasource with the changes made to the content of the DataSet.

Also see the following ADO.NET interview questions video on dataset and datareader: –

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

Can you explain Normalization and Denormalization?

Both are database designing techniques.

In Normalization we make sure that there will not be any redundant data in database.


  • Easy data management because there will not be any redundant data
  • Database size will be less
  • More reliable data


  • Same data is referred whenever required instead of repetition. It may leads to multiple join conditions and leads to slow performance.

DeNormalization is the process of database design where instead of relation we believe in data repetition.


  • Better select query performance and best choice for data warehouse


  • Because of redundant data management becomes difficult.

What you prefer Normalized Database or Denormalized database?

For day to day transactions Normalized database is best and for Reporting denormalized one is better.

How you make sure database is normalized?

If database is in Normal Forms (1NF, 2NF…) we call it normalized database

You can also see our video on SQL Server normalization ( 1st normal form , second normal form and third normal form) prepared by team.

Hope you liked it and enjoyed it.

For technical training on MVC, WCF, Design Patterns, BI, WPF, TFS and various JavaScript frameworks visit or contact

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

Explain XML,DTD and XSL?(XML interview questions with answers)

XML stands for extensible markup language. XML describes data. The main purpose of XML was to structure , store and transport data. For example below is a simple XML example which shows a order with order number 1001 and with product shoes of size 9.

<order ordernumber=”1001”>
<product name=”shoes” size=”9” material=”leather”/>
<product name=”shirts” size=”large” material=”cotton”/>

The best thing about XML is you can create your own tags which best describes your data. For example in the above XML we created our own “order” , “product” tag. These tags are termed as elements. Elements describe data of the XML.

If we want to describe more about the elements we need to use XML attributes. For example in the above example to describe the order element we have used the order number.
DTD stands for document type definitions. DTD defines structure and rules for the XML documents. DTD is like a rule book that your XML document has to follow. DTD validates your XML document.

XSL stands for XML style sheet.XSL describes how a XML document should be displayed. Using XSL we can convert the XML document to a HTML or some other format. XSL means XML data plus presentation. In short XML defines what is the data , DTD defines how to validate the data and XSL defines how to display the data.

Do visit the largest collection of .NET and C# interview question video series created by  

Posted in Uncategorized | Tagged , , , , , | Leave a comment

What is the difference between MVVM and 3 layer architecture? ( WPF MVVM Interview questions with answers)

MVVM has an extra layer as compared to 3 layer architecture. In 3 layer architecture we have UI (view) , business logic ( model) and Data access layer ( DAL). In MVVM we have an extra layer in between view and model i.e. the view model class.

3 layer architecture complements MVVM architecture.

In case you are completely new to WPF start from the below video created by team.

Posted in Uncategorized | Tagged , , , , , | Leave a comment

.NET testing interview questions: – How can we UNIT test private methods using VSTS? Is it good to practice to UNIT test Private methods?

In order to invoke private methods in VSTS unit test we have a class called as “privateobject”. Create the object of “PrivateObject” class and pass the class whose private method needs to be invoked. In our case “IsNegative” is the private method which has a integer input parameter.You can then use the “PrivateObject” object to invoke the private methods / functions as shown in the below code.

Is it good to practice to UNIT test Private methods: -

No is the answer.

When we say UNIT it’s a class. So if we test the public methods the private methods get tested internally as well. If you are testing private methods of a class that means there is something seriously wrong with the class design.

For instance in the above “maths” class there is a private function “isNegative” , if you are testing this method that means “Maths” class is overloaded with responsibility. “Maths” class should only be doing arithmetic operations (Add, Subtract etc), but it is also loaded with responsibility of doing validation.

So probably it’s a good idea to move the validation to a separate class called as “Validator” who will do the numeric checks and then use this class inside the “Maths” class.

You can then write test cases on the “Validator” class separately which is a cleaner approach than the previous approach of using “PrivateObject” and invoking them via reflection.

Also see following .NET testing interview questions video on Simple Unit Testing: -

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

.NET interview questions: – What are the advantages /disadvantages of lazy loading?

Advantages of Lazy Loading are far more than its disadvantages. Following are points we have figure it out.

Advantages of Lazy Loading:-

  • Minimizes start up time of the application.
  • Application consumes less memory because of on-demand loading.
  • Unnecessary database SQL execution is avoided.

Disadvantages of Lazy Loading:-

Is that the code becomes complicated. As we need to do checks if the loading is needed or not. So must be there is a slight decrease in performance.

Also see following .NET interview questions video on Lazy Loading Design Pattern: -

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment