Pages

Tuesday, November 30, 2010

Questpond .Net Interview Questions on Garbage Collection

Garbage Collection in .Net

.Net Framework's -Memory Management Garbage Collector which manages allocation and release of memory from application.Now developers no need to worry about memory allocated for each object which is created on application . garbage collector automatically manages memory on application

I would like share this horrible experience which I faced in one of the big IT multinational company. Even though I have 8 years of experience, I flunked very badly and I flunked due to 1 topic "Garbage collector". I hope the below discussion will help some one down the line when facing c sharp and dot net interviews. I just hope dot net interviews get more matured down the line and ask practical questions rather than asking questions which we do not use on day to day to basis.
The interviewer started with a basic question which I knew pretty well
What is a garbage collector?
Garbage collector is a background process which checks for unused objects in the application and cleans them up.
After that answer my guess was the interviewer will not probe more....but fate turned me down , came the bouncer.
What are generations in garbage collector?
Generation define the age of the object.
Well i did not answer the question , i have just written down by searching in google....
How many types of Generations are there in GC garbage collector?
There are 3 generations gen 0 , gen 1 and gen 2.
Then came a solid tweak questions which i just slipped by saying Yes...
Does garbage collector clean unmanaged objects ?
No.
Then came the terror question...which i never knew...
When we define clean up destructor , how does it affect garbage collector?
If you define clean up in destructor garbage collector will take more time to clean up the objects and more and more objects are created in Gen 2..
How can we overcome the destructor problem ?
By implementing "Idisposable" interface.
The above question was tricky , you can search in google for finalize and dispose patterns.
Where do we normally put unmanaged code clean up?.
In finalize a.k.a destructor.
One thing i learnt from this interview experience is one thing but we also should know core concepts in detail to crack Dot net interviews .
By ShivPrasad Koirala
For more Queries please visit : http://www.questpond.com

Thursday, November 25, 2010

C# and .NET interview questions and answers around global assembly cache (GAC)

C# and .NET interview questions and answers around global assembly cache (GAC)

for more visit :www.questpond.com


One of the most asked questions in .NET interviews are around assembly and GAC. Most of the times .NET developers get confused with these questions. Below are some of the question which keeps coming from GAC perspective.

Interviewer normally starts with what is GAC?
GAC is a central repository folder where you can share your DLL among different applications running in the same computer. So for example you have accounting and invoicing application running in the same computer and both these application need some common utility like the logging DLL then you need to register them in GAC and share them.

If you are able to answer the top interview questions the next question can be on versioning.
If we have different versions of DLL in GAC how can the application identify them?

This is done by using binding redirect and specifying older version and new version value. So which ever version you put in the new version will be used by the application.
The other question can come from the perspective of how you can register a DLL in GAC. Interviewer expectation is that you do not just talk about GACUTIL but you need talk more realistic.

What are the various ways by which you can register a DLL in GAC?

We can use the GACUTIL tool to register the DLL in GAC.

But when we talk about application they have 100 of DLL’s so how feasible is GACUTIL tool?

We need to create installation package which will register the DLL in GAC.

If we do not have strong name can assembly be registered in GAC?
This is again a catchy question which is testing do you know the pre-requisites to register DLL in GAC. No, you cannot register DLL in GAC without strong names.

How do we create strong named DLL?

By using SN.EXE or by going to the project properties and making the assembly string named.

So next time you face a question in GAC in C# and .NET interviews understand the above twist and twirls. Happy job hunting.

Wednesday, November 24, 2010

Questpond - .Net Interview Questions and Answers

.Net Interview Questions and Answers

for more please visit www.questpond.com




What is .Net?


.Net is software which is developed by Microsoft.

From .Net we can create softwares, application, web portals, web services, silver light application, and web sites

.Net provides tools for programmer or developers  to create all software related application (tools like ajax,grid,sql connection,html button , textbox, hyperlink and lots more).It enables to create stable and secure software development application




1      What is .Net Framework?


.Net Framework which includes base class libraries which provides user interface, database connectivity, web application tools etc


.Net Framework also includes CLR (Common Language Runtime) on which .Net program executes and provides functionality


2      What is .Net Architecture?

.Net Architecture is a Combination of

CLR (Common Language Runtime)

CTS (Common Type Specification)

Base Class Libraries

.Net tools

3      What is view state?

View State is a state management in .net. Its help to store information of data type and objects




4      What is Session State?

Session state is also state management but it helps to store and retrieves information for particular session.


5      What is Design Pattern?


Design patterns are reusable solution to software design problems you find again and again in real-world application development. A design pattern is not a finished design that can be transformed directly into code


Types of Design Pattern


   1. Adapter Pattern
   2. Flyweight Pattern
   3. Facade Pattern
   4. Decorator Pattern
   5. Iterator Pattern
   6. Bridge Pattern
   7. Template Pattern
   8. Proxy Pattern
   9. Prototype Pattern
  10. Builder Pattern
  11. Observer Pattern
  12. Strategy Pattern
  13. Command Pattern
  14. Interpreter  Pattern
  15. Mediator Pattern
  16. Memento Pattern

Structural Pattern

Structural Pattern uses object composition. Structural Pattern uses inheritance to define new functionality of object

 Behavioral Patterns

This Pattern deals with object communication

6      . What is Global Assembly Cache (GAC)?


GAC stores assemblies that stores assemblies specifically designated to be shared by several applications on the computer.


7.   What is an ADO.NET?

      ADO.Net is a .Net software component used by developers to able to access database through sql server        


7      . What are Generics?

Generics which is introduced in .Net Framework 2.0 which has ability to create list type safe collections


8.  Modes of Authentication in Web config file

        

          1 .Form

          2. Passport

          3. Windows


9.  What is three tier architecture?

          Three tier architecture is basically divided into three parts 1st is UI or user interface 2nd is Business Login where you write only your application login 3rd is a datalayer for database


10. What is Dataset?

   Dataset is disconnected architecture.  It usually loads data in tabular form or xml form