Friday, April 13, 2012

.NET Interview Questions

Basic .NET Framework
1 What is an IL?
2 What is a CLR?
3 What is CTS?
4 What is a CLS (Common Language Specification)?
5 What is a Managed Code?
6 What is a Assembly?
7 What are the different types of Assembly?
8 What is NameSpace?
9 What is Difference between NameSpace and Assembly?
10 If you want to view an Assembly how do you go about it?
11 What is Manifest?
12 Where is version information stored of an assembly?
13 Is versioning applicable to private assemblies?
14 What is GAC?
15 what is the concept of strong names?
16 How to add and remove an assembly from GAC?
17 What is Delay signing?
18 What is garbage collection?
19 Can we force garbage collector to run?
20 What is reflection?
21 What are different types of JIT?
22 What are Value types and Reference types?
23 What is concept of Boxing and Unboxing ?
24 What is the difference between VB.NET and C#?
25 what is the difference between System exceptions and Application exceptions?
26 What is CODE Access security?
27 What is a satellite assembly?
28 How to prevent my .NET DLL to be decompiled?
29 what is the difference between Convert.toString and .toString () method?
30 What is Native Image Generator (Ngen.exe)?
31 If we have two version of same assembly in GAC how do we make a choice?
32 What is CodeDom?

   Threading


1 What is Multi-tasking?
2 What is Multi-threading?
3 What is a Thread?
4 Did VB6 support multi-threading?
5 Can we have multiple threads in one App domain?
6 Which namespace has threading?
7 What does Address Of operator do in background?
8 How can you reference current thread of the method?
9 what is Thread.Sleep () in threading?
10 How can we make a thread sleep for infinite period?
11 What is Suspend and Resume in Threading?
12 What the way to stop a long running thread?
13 How do I debug thread?
14 What is Thread.Join () in threading?
15 What are Daemon threads and how can a thread be created as Daemon?
16 How is shared data managed in threading?
17 Can we use events with threading?
18 How can we know a state of a thread?
19 What is use of Interlocked class ?
20 What is a monitor object?
21 What are wait handles?
22 What is ManualResetEvent and AutoResetEvent?
23 What is Reader Writer Locks?
24 How can you avoid deadlock in threading?
25 What is the difference between thread and process?

 Remoting and Webservices

1 What is .NET Remoting?
2 Which class does the remote object has to inherit?
3 what are two different types of remote object creation mode in .NET ?
4 Describe in detail Basic of SAO architecture of Remoting?
5 What are the situations you will use singleton architecture in remoting?
6 What is fundamental of published or precreated objects in Remoting?
7 What are the ways in which client can create object on server in CAO model?
8 Are CAO stateful in nature?
9 To create objects in CAO with ‘new’ keyword what should be done?
10 Is it a good design practice to distribute the implementation to Remoting Client?

11 What are LeaseTime, SponsorshipTime, RenewonCallTime and  LeaseManagerPollTime?
Ans:

In normal .NET environment objects garbage collector manages lifetime. However, in remoting environment remote clients can access objects, which are out of control of garbage collector. Garbage collector boundary is limited to a single PC on which framework is running; any remote client across physical PC is out of control of GC (Garbage Collector).

This constraint of garbage collector leads to a new way of handling lifetime for remoting objects, by using concept called as “LeaseTime”. Every server side object is assigned by default a “LeaseTime” of five minutes. This lease time is decreased at certain intervals. Again, for every method call a default of two minutes is assigned. When i say method call means every call made from client. This is called as “RenewalOnCallTime”.

    Let’s put the whole thing in equation to make the concept more clear.

    Total Remoting object life time = LeaseTime + (Number of method calls) X (RenewalTime).

    Then default Remote Object Life Time = 5 + (1) X 2 = 10 minutes (Everything is in minutes)


When total object lifetime is reduced to zero, then it queries the sponsor that should the object be destroyed. Sponsor is an object, which decides should object Lifetime be renewed. So it queries any registered sponsors with the object, if does not find any then the object is marked for garbage collection. After this garbage, collection has whole control on the object lifetime. If we do not foresee how long a object will be needed specify the “Sponsorship Timeout” value. Sponsorship Timeout is time unit a call to a sponsor is timed out.

    “LeaseManagerPollTime” defines the time the sponsor has to return a lease time extension.

13 Which config file has all the supported channels/protocol?
14 How can you specify remoting parameters using Config files?
15 Can Non-Default constructors be used with Single Call SAO?
16 How can we call methods in remoting asynchronously?
17 What is Asynchronous One-Way Calls?
18 What is marshalling and what are different kinds of marshalling?
19 What is ObjRef object in remoting?
20 What is a Web Service?
21 What is UDDI?
22 What is DISCO?
23 What is WSDL?
24 What the different phase/steps of acquiring a proxy object in Web service?
25 What the different phase/steps of acquiring a proxy object in Web service?
26 What is file extension of Web services?
27 Which attribute is used in order that the method can be used as WebService?
28 What are the steps to create a web service and consume it?
29 Do webservice have state?

Thanks & Regards

Alok Kumar Sharma

No comments:

Post a Comment