<?xml version="1.0" encoding="UTF-8"?><rss version="0.92">
<channel>
	<title>Interview</title>
	<link>http://interview.msdotnetheaven.com</link>
	<description>Best place for interview preparation</description>
	<lastBuildDate>Sat, 21 May 2011 21:43:04 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	<!-- generator="WordPress/3.1.2" -->

	<item>
		<title>Define interface in own words.</title>
		<description><![CDATA[We have many books around, anyone can get a definition of interface which is nothing but bookish. In these days we are more interested to know what you know about interfaces rather than what you read for interfaces?
Here, I tried to cover interfaces in my own words:
Interface
An interface is simply a collection of function prototypes. An Interface is a reference type like a class, but interface can contain only abstract members. In other words, Interface is a contract that defines the signature of the functionality.
An interface looks like a class ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/what-are-classes-and-structures.html' rel='bookmark' title='Permanent Link: What are Classes and structures'>What are Classes and structures</a></li>
<li><a href='http://interview.msdotnetheaven.com/oops-questions-and-answers/what-is-differance-between-abstract-and-interface.html' rel='bookmark' title='Permanent Link: What is differance between Abstract and Interface'>What is differance between Abstract and Interface</a></li>
<li><a href='http://interview.msdotnetheaven.com/uml-interview-questions-and-answers/what-are-the-good-practices-to-use-while-designing-for-reuse.html' rel='bookmark' title='Permanent Link: What are the good practices to use while designing for reuse'>What are the good practices to use while designing for reuse</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/define-interface-in-own-words.html</link>
			</item>
	<item>
		<title>What are Classes and structures</title>
		<description><![CDATA[A very basic and common questions asked many time to freshers, novoice or intermediate level interviews. I got many emails for the same questions, hereunder I try to answer in a simpler way.
Structures
A structure in C# is simply a composite data type [you are well aware from composite data type, refer to data types for more details], which consists number of members of other types. The structure define simply by using the struct keyword.
eg. struct enroll
{
   public string name, fname, mname;
   public string char sex;
   Public int age;
   public string address;
}
Classes
It is cleared from ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/asp-net-interview-questions/can-i-inherit-two-difference-classes-to-partial-classes.html' rel='bookmark' title='Permanent Link: Can I inherit two difference classes to partial classes?'>Can I inherit two difference classes to partial classes?</a></li>
<li><a href='http://interview.msdotnetheaven.com/general-interview-stuffs/is-it-possible-to-create-constructor-for-an-abstract-class.html' rel='bookmark' title='Permanent Link: Is it possible to create constructor for an Abstract class?'>Is it possible to create constructor for an Abstract class?</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/how-can-i-create-a-singleton-class-by-using-public-constructor.html' rel='bookmark' title='Permanent Link: How can I create a Singleton class by using public constructor?'>How can I create a Singleton class by using public constructor?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/what-are-classes-and-structures.html</link>
			</item>
	<item>
		<title>Is it possible to create constructor for an Abstract class?</title>
		<description><![CDATA[Yes, its possible to create constructors for Abstract classes.  We can create Private, Public and Protected constructors for Abstract classes
Example:
Abstract class  myAbstClass
{
public  myAbstClass()
{          }
private myAbstClass(int x)
{       //some implementation      }
protected myAbstClass(string strX, string strY, int x)
{    //some implementation }
}
  Tweet This Post

Related posts:How can I create a Singleton class by using public constructor?
What is differance between Abstract and Interface
What are Classes and structures



Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/how-can-i-create-a-singleton-class-by-using-public-constructor.html' rel='bookmark' title='Permanent Link: How can I create a Singleton class by using public constructor?'>How can I create a Singleton class by using public constructor?</a></li>
<li><a href='http://interview.msdotnetheaven.com/oops-questions-and-answers/what-is-differance-between-abstract-and-interface.html' rel='bookmark' title='Permanent Link: What is differance between Abstract and Interface'>What is differance between Abstract and Interface</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/what-are-classes-and-structures.html' rel='bookmark' title='Permanent Link: What are Classes and structures'>What are Classes and structures</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/general-interview-stuffs/is-it-possible-to-create-constructor-for-an-abstract-class.html</link>
			</item>
	<item>
		<title>Write query to get custom results</title>
		<description><![CDATA[This question is asked in recent interview, following is the scenario:
Q. I have a following table :



University
UtoTal
Status
StatusCnt


U1
100
Pending
20


U1
100
Active
20


U1
100
Deferred
60


U2
60
Pending
20


U2
60
Active
20


U2
60
Deferred
20



I want results as :



University
UtoTal
Status
StatusCnt


U1
100
Pending
20




Active
20




Deferred
60


U2
60
Pending
20




Active
20




Deferred
20



Ans: At the time of interview I wasn&#8217;t easy with the answer but I wrote a query, but interviewer not satisfied.
I got the following proper query/solution from one of my colleagues Mr. sandeep Walia:
declare @tbl table(university varchar(100),Utotals int, status varchar(100),statuscnt int)
insert into @tbl(university,Utotals,status,statuscnt)
select &#8216;u1&#8242;,100,&#8217;pending&#8217;,20
union all
select &#8216;u1&#8242;,100,&#8217;Active&#8217;,20
union all
select &#8216;u1&#8242;,100,&#8217;Deferred&#8217;,60
union all
select &#8216;u2&#8242;,60,&#8217;pending&#8217;,20
union all
select &#8216;u2&#8242;,60,&#8217;Active&#8217;,20
union all
select &#8216;u2&#8242;,60,&#8217;Deferred&#8217;,20
select * from @tbl;
with cte as (
SELECT ROW_NUMBER() OVER(PARTITION BY university ORDER BY university DESC) AS RowID,
*
FROM ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/database-question-answer/create-dynamic-query-with-dynamic-joins.html' rel='bookmark' title='Permanent Link: Create dynamic query with dynamic joins'>Create dynamic query with dynamic joins</a></li>
<li><a href='http://interview.msdotnetheaven.com/database-question-answer/mssql-question-answer/change-date-format-mmddyy-to-ddmmyy-using-query.html' rel='bookmark' title='Permanent Link: Change date format mm/dd/yy to dd/mm/yy using query?'>Change date format mm/dd/yy to dd/mm/yy using query?</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-vsam-question-answer/what-is-file-status-in-vsam.html' rel='bookmark' title='Permanent Link: What is File Status in VSAM?'>What is File Status in VSAM?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/database-question-answer/write-query-to-get-custom-results.html</link>
			</item>
	<item>
		<title>Create dynamic query with dynamic joins</title>
		<description><![CDATA[Q. Here is the scenario:

declare @tt table(col1 varchar(10), joinexp varchar(100))
insert into @tt
select &#8216;c1&#8242;,&#8217;join table2 on table1.id = table1.id&#8217;
union all
select &#8216;c2&#8242;,&#8217;join table3 on table2.id = table1.id&#8217;
union all
select &#8216;c3&#8242;,&#8217;join table4 on table3.id = table1.id&#8217;
union all
select &#8216;c4&#8242;,&#8217;join table5 on table5.id = table1.id&#8217;
union all
select &#8216;c5&#8242;,NULL
union all
select &#8216;c6&#8242;,NULL
declare @str varchar(1000)
set @str = &#8216;Select c1,c4,c5,c8,c9 from table1&#8242;
declare @tt table(col1 varchar(10), joinexp varchar(100))insert into @ttselect &#8216;c1&#8242;,&#8217;join table2 on table1.id = table1.id&#8217;union allselect &#8216;c2&#8242;,&#8217;join table3 on table2.id = table1.id&#8217;union allselect &#8216;c3&#8242;,&#8217;join table4 on table3.id = table1.id&#8217;union allselect &#8216;c4&#8242;,&#8217;join table5 on table5.id = table1.id&#8217;union allselect &#8216;c5&#8242;,NULLunion allselect &#8216;c6&#8242;,NULL
declare @str ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/database-question-answer/write-query-to-get-custom-results.html' rel='bookmark' title='Permanent Link: Write query to get custom results'>Write query to get custom results</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-db2-question-answer/what-is-the-syntax-required-for-the-creation-of-a-cursor.html' rel='bookmark' title='Permanent Link: What is the syntax required for the creation of a cursor?'>What is the syntax required for the creation of a cursor?</a></li>
<li><a href='http://interview.msdotnetheaven.com/database-question-answer/mssql-question-answer/change-date-format-mmddyy-to-ddmmyy-using-query.html' rel='bookmark' title='Permanent Link: Change date format mm/dd/yy to dd/mm/yy using query?'>Change date format mm/dd/yy to dd/mm/yy using query?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/database-question-answer/create-dynamic-query-with-dynamic-joins.html</link>
			</item>
	<item>
		<title>Can I inherit two difference classes to partial classes?</title>
		<description><![CDATA[Q. Can I inherit two difference classes to partial classes? Following is the whole scenario of this question:
I have two classes XYZ and ABC and two partial classes  of class myClass now is it possible:
partial class myClass : XYZ
{
}
partial class myClass : ABC
{
}
Ans:  This question I have asked in RSystems, Noida and I am sharing hereunder with you :
We can&#8217;t inherit two difference classes to partial class because in C# multiple inheritance is not possible using classes.
The main reason is in C# we cant do the following:
class myClass : XYZ, ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/what-are-classes-and-structures.html' rel='bookmark' title='Permanent Link: What are Classes and structures'>What are Classes and structures</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/csharp-interview-questions/when-you-inherit-a-protected-class-level-variablewho-is-it-available-to.html' rel='bookmark' title='Permanent Link: When you inherit a protected-class-level variable,who is it available to?'>When you inherit a protected-class-level variable,who is it available to?</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/can-we-store-filtered-dataview-in-viewstate.html' rel='bookmark' title='Permanent Link: Can we store filtered DataView in ViewState?'>Can we store filtered DataView in ViewState?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/asp-net-interview-questions/can-i-inherit-two-difference-classes-to-partial-classes.html</link>
			</item>
	<item>
		<title>Can we store filtered DataView in ViewState?</title>
		<description><![CDATA[The question is asked in RSystems, Noida and I am sharing the same with you, my asnwer is as follows, if anyone have idea or more depth in answer please share where:
We can store only objects of the following types:
1. string
2. integers
3. boolean
4. Array
5. ArrayList
6. Hash tables
7. Custom types etc.
Apart from above we can share some other types too but the class must be serialized.
In view of above theory, we can say &#8216;yes, we can store DataView in ViewState for serialized class.
  Tweet This Post

Related posts:What is a view?
What ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-db2-question-answer/what-is-a-view.html' rel='bookmark' title='Permanent Link: What is a view?'>What is a view?</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-db2-question-answer/what-is-a-tablespace.html' rel='bookmark' title='Permanent Link: What is a tablespace?'>What is a tablespace?</a></li>
<li><a href='http://interview.msdotnetheaven.com/mainframe-question-and-answers/mainframe-db2-question-answer/what-is-a-declarations-generator-dclgen.html' rel='bookmark' title='Permanent Link: What is a Declarations Generator (DCLGEN)?'>What is a Declarations Generator (DCLGEN)?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/can-we-store-filtered-dataview-in-viewstate.html</link>
			</item>
	<item>
		<title>How can I get the date of Last Monday of specified week?</title>
		<description><![CDATA[The query is asked in my recent interview and the same I want to share with you. If anyone has better solution(corrected by Sandeep Walia)  please share here:
declare @dt datetime
set @dt=&#8217;1/1/2010&#8242; &#8211;Want to know January&#8217;s Last Monday Date
SELECT dateadd(d,-datepart(dw,DATEADD(d, -datepart(d,dateadd(mm,1,@dt)),dateadd(mm,1,@dt))-1)+1,DATEADD(d, -datepart(d,dateadd(mm,1,@dt)),dateadd(mm,1,@dt)))
  Tweet This Post

Related posts:Write query to get custom results
Change date format mm/dd/yy to dd/mm/yy using query?
Create dynamic query with dynamic joins



Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/database-question-answer/write-query-to-get-custom-results.html' rel='bookmark' title='Permanent Link: Write query to get custom results'>Write query to get custom results</a></li>
<li><a href='http://interview.msdotnetheaven.com/database-question-answer/mssql-question-answer/change-date-format-mmddyy-to-ddmmyy-using-query.html' rel='bookmark' title='Permanent Link: Change date format mm/dd/yy to dd/mm/yy using query?'>Change date format mm/dd/yy to dd/mm/yy using query?</a></li>
<li><a href='http://interview.msdotnetheaven.com/database-question-answer/create-dynamic-query-with-dynamic-joins.html' rel='bookmark' title='Permanent Link: Create dynamic query with dynamic joins'>Create dynamic query with dynamic joins</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/database-question-answer/how-can-i-get-the-date-of-last-monday-of-specified-week.html</link>
			</item>
	<item>
		<title>How can I create a Singleton class by using public constructor?</title>
		<description><![CDATA[I have also asked a tricky question like this:
Can we create a singleton class using public constructor?
Simply answer is yes.
Practically, many of us aware that we can create a singleton class by using private constructor an creating a property, but we can create a singleton class by using public constructor as folows:
static void Main(string[] args)
{
try
{
Singleton obj3 = new Singleton2();
Singleton obj4 = new Singleton2();
Console.Read();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
Console.Read();
}
}
static void Main(string[] args)
{
try
{
Singleton obj3 = new Singleton2();
Singleton obj4 = new Singleton2();
Console.Read();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
Console.Read();
}
}
  Tweet This Post

Related posts:Is it possible to create constructor for an ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/general-interview-stuffs/is-it-possible-to-create-constructor-for-an-abstract-class.html' rel='bookmark' title='Permanent Link: Is it possible to create constructor for an Abstract class?'>Is it possible to create constructor for an Abstract class?</a></li>
<li><a href='http://interview.msdotnetheaven.com/crystal-report/difference-between-clone-close-and-dispose-methods-of-crystal-report.html' rel='bookmark' title='Permanent Link: Difference between Clone, Close and Dispose methods of Crystal Report?'>Difference between Clone, Close and Dispose methods of Crystal Report?</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/linq/define-lambda-expressions.html' rel='bookmark' title='Permanent Link: Define Lambda expressions'>Define Lambda expressions</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/how-can-i-create-a-singleton-class-by-using-public-constructor.html</link>
			</item>
	<item>
		<title>Define Lambda expressions</title>
		<description><![CDATA[A Lambda expression is nothing but an Anonymous Function, can contain expressions and statements. Lambda expressions can be used mostly to create delegates or expression tree types. Lambda expression uses lambda operator => and read as &#8216;goes to&#8217; operator.
Left side of this operator specifies the input parameters and contains the expression or statement block at the right side. 
Example: myExp = myExp/10; 
Now, let see how we can assign the above to a delegate and create an expression tree: 
delegate int myDel(int intMyNum);
        ...


Related posts:<ol><li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/linq/what-is-a-lambda-expression.html' rel='bookmark' title='Permanent Link: What is a Lambda expression?'>What is a Lambda expression?</a></li>
<li><a href='http://interview.msdotnetheaven.com/microsoft-net-interview-questions/how-can-i-create-a-singleton-class-by-using-public-constructor.html' rel='bookmark' title='Permanent Link: How can I create a Singleton class by using public constructor?'>How can I create a Singleton class by using public constructor?</a></li>
<li><a href='http://interview.msdotnetheaven.com/crystal-report/difference-between-clone-close-and-dispose-methods-of-crystal-report.html' rel='bookmark' title='Permanent Link: Difference between Clone, Close and Dispose methods of Crystal Report?'>Difference between Clone, Close and Dispose methods of Crystal Report?</a></li>
</ol>]]></description>
		<link>http://interview.msdotnetheaven.com/microsoft-net-interview-questions/linq/define-lambda-expressions.html</link>
			</item>
</channel>
</rss>

