.NET interview questions for 5+ years of experience - OOPS, C#, WPF, .NET Fundamentals


Recently, I attended interview with Logica, Chennai and mode of the interview was telephonic. I used WPF, WCF in my last project. So they mainly concentrated in C#, .NET Fundamentals, WPF and OOPs concents. Most of the questions look common but some of the questions are new. I will try to post answers also.

1. What is a chain constructor?
2. Is this the proper way? If yes why, if no why?
try { }
catch(Exception ex) { }
catch(ArgumentNullException) { }
catch(ArgumentNullException) {}
catch {}
finally {}

3. What is lambda expression?
4. What is anonymous type?
5. What is the difference between interface and abstract?
6. What is data modeling?
7. Difference between MVVM and MVC?
8. How will implement gate pass entry application using MVVM
9. What is UML?
10. What is design pattern?
11. What is singleton, how will you implement?
12. What is the max size of Viewstate?
13. Difference between session and viewstate?
14. What is agile methodology? What are the advantages?
15. You have edited some value in a gridview. How will you update those values to dataset?
16. Difference between Acceptchanges and Updatechanges in dataset?
17. Difference between WCF and web services
18. Why do we go for web services?
19. Difference between .NET Remoting and web services
20. What is Pivot?
21. Employee table has two columns - eId, eName;
What is the output of the following queries?
Select eId eName as Name from Employee
Select eId eName from Employee


Comments

Guest Author: Sai13 Sep 2012

Nice stuff

Author: Phagu Mahato16 Jan 2014 Member Level: Gold   Points : 10

What is a chain Constructor
Constructor Chaining is an approach where a Constructor calls another Constructor in the same or base class. Example of chain Constructor code snippet


namespace ConstructoreChaining

{

class A

{

public A(){

Console.WriteLine("ConstructorExampleExample A.");

}

public A(string s){

Console.WriteLine("ConstructorExample A with parameter = {0}",s);

}

public A(string s,string t){

Console.WriteLine("ConstructorExample A with parameter = {0} & {1}", s,t);

}

}



class B:A

{

public B():base(){

Console.WriteLine("ConstructorExample B.");

}

public B(string s):base(s){

Console.WriteLine("ConstructorExample B with parameter = {0}", s);

}

public B(string s, string t):base(s,t){

Console.WriteLine("ConstructorExample B with parameter = {0} & {1}", s, t);

}

}

class Program

{

static void Main(string[] args)

{

B b1 = new B();

B b2 = new B("First Parameter ", "Second Parameter");



Console.Read();

}

}

}



What is lambda expression in C#
A lambda expression is an anonymous Functionalist that you can use to create delegates or expression tree types.To create a lambda expression, you specify input parameters on the left side of the lambda operator =>, and you put the expression or statement block on the other side. For example, the lambda expression x => x * x . Example as below

using System.Linq.Expressions;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Expression del myET = x => x * x;
}
}

Program that uses lambda expressions: C#

using System;

class Program
{
static void Main()
{
Function Function1 = x => x + 1;
Function Function2 = x => { return x + 1; };
Functiontion Function3 = (int x) => x + 1;
Function Function4 = (int x) => { return x + 1; };
Function Function5 = (x, y) => x * y;
Action Function6 = () => Console.WriteLine();
Function Function7 = delegate(int x) { return x + 1; };
Function Function8 = delegate { return 1 + 1; };

Console.WriteLine(Function1.Invoke(1));
Console.WriteLine(Function2.Invoke(1));
Console.WriteLine(Function3.Invoke(1));
Console.WriteLine(Function4.Invoke(1));
Console.WriteLine(Function5.Invoke(2, 2));
Function6.Invoke();
Console.WriteLine(Function7.Invoke(1));
Console.WriteLine(Function8.Invoke());
}
}
}



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: