Interview Questions Interview Questions and Answers (11) - Page 1

How does Garbage Collector works?

GC as we know that, it is used for removing unmanaged object or resources from the HEAP, those are no longer used in our code. Garbage Collector works in 3 phases:-

1). Generation Zero -> In this phase, once an OBJECT is created or initialized, it will come into generation 0 phase.

2). Generation One -> Once created object comes under GC process, then that object will be treated in Generation one phase.

3). Generation Two -> Once any NEW OBJECT is created and added into HEAP, they are added into Generation ) phase and the old objects in Generation 1 are considered to be in Generation 2.
How many ways we can break statements into new lines in Dot Net?

Hi, there are so many ways which are list below:-

1). Enviornment.NewLine
2). \r\n
3). vbCrLf
4). <br/>

In windows application:-

Enviornment.NewLine -> Will work in both VB.Net and C#.
\r\n -> Will work only in C#.
vbCrLf -> Will work only in VB.Net

In web application:-

<br/> -> Will work in both VB.Net and C#.
What is the difference between Finalize and Dispose method in Dot Net?

1). Finalize is a Non-Deterministic whereas Dispose is a Deterministic.

2). Finalize is called implicitly where Dispose is called explicitly.

3). Finalize method is called by Garbage Collector whereas Dispose is called by Programmer.

4). We do not have to create Interface or anything for Finalize whereas in case of Dispose,we have to implement IDispose Interface.
How to provide Tooltip text in Javascript?

With the help of Title property we can provide Tooltip on any controls,whether controls are Server side or Asp.Net controls or HTML controls,we will use Title property.We have to first find control id through document.getElementById method of Javascript.Then use title property as follows:-

document.getElementById('btn_save').title = "Save Record";

document.getElementById('btn_delete').title = "Delete Selected Record";
Where btn_save is our Asp.Net control and btn_delete is our HTML control.
Tell us about the differences between Webforms and Asp.Net MVC pattern?

Following are the differences between Webforms and Asp.Net MVC pattern:-
1. Asp.net Webform has User Controls for code re-usability whereas in Asp.net Mvc partial view is used.
2. Asp.net Webforms has state management techniques whereas Asp.net Mvc doesn't have automatic state management techniques.
3. Asp.net Webform has file-based Urls means file name exists in Url whereas Asp.net Mvc has route-based Url.
4. Asp.net Webform has Master page for consistent look and feel whereas in Asp.net Mvc layout is used.
5. Asp.net Webform has server controls whereas Asp.net Mvc has Html helpers for creating UI.
6. In Asp.net webform,Aspx pages are tightly coupled to code-behind (.cs/.vb) whereas in Asp.net Mvc,Views and logic are kept separately.
7. Asp.net Webform follows an event-driven development model whereas Asp.net Mvc follows Model,View and Controller design pattern.
How to Delete a Row in Table using jQuery.

<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>

<script type="text/javascript">
$(function() {
$('input[type="button"]').click(function(e) {
var row = $(this).closest('tr');
row.remove()
})
})
</script>

<div>
<table>
<tr>
<td><input type="button" value="Delete Row1"/></td>
</tr>
<tr>
<td><input type="button" value="Delete Row2" /></td>
</tr>
<tr>
<td><input type="button" value="Delete Row3"/></td>
</tr>
</table>
</div>

Figure out the benefits of Entity Framework from the below options

NOTE: This is objective type question, Please click question title for correct answer.
Find out benefits of using EF as opposed to Ado.net

NOTE: This is objective type question, Please click question title for correct answer.
What is ORM?

NOTE: This is objective type question, Please click question title for correct answer.
What is PluralizationService?

The "PluralizationService" is an abstract class and provides methods for constructing plural and singular forms of words.It is found in the System.Data.Entity.Design.dll under the System.Data.Entity.Design.PluralizationServices namespace.
In how many ways we can use EF?

NOTE: This is objective type question, Please click question title for correct answer.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories