Thursday, October 8, 2009

Asp.Net Interview Questions and Answers-(11-20)

11. What does 'Managed Code' mean in the .NET context?

Managed code:
CLR is responsible for managing the execution code.
The code that satisfies the CLR at runtime inorder to execute is reffered to as managed code. Compilers that are compatible to the .NET platform genrate managed code.

12.What is JIT.what is the main work of JIT?

JIT-Just In Time Compiler.
The main work of JIT is to convert the IL code to naive machine code. Then the machine code is sent to runtime manager for execution.

13. What is reflection?

All .NET compilers produce data about the types defined in the modules they produce called metadata.

This metadata can be acessed by mechanism called reflection.

The namepsace system.reflection contains classes that can be used to interrogate the types for a module/assembly.

14.What is Garbage Collection ?

Garbage collection is a concept of runtime object managing the lifetime of objects and the heap memory that they occupy.

15. Is it true that objects don't always get destroyed immediately when the last reference goes away?

Yes. The garbage collector offers no guarantees about the time when an object will be destroyed and its memory reclaimed.

16. Do We have any control over the garbage collection algorithm?

Ya not fully but we can control a little. We have a name space System.GC which has many functions to control the garbage collector.
For ex;
Collect method - this forces the garbage collector to collect all unreferenced objects.

17. Can I find out what the garbage collector is doing?If yes How?

Yes .We can find out it by using the .NET CLR performance counters.
You can view them by performance monitor.

18.Define Serialization ?

Serialization is the process of converting an object into a stream of bytes.

19.Define Deserialization?

Deserialization is nothing but the opposite process of creating an object from a stream of bytes.

20.When the Serialization and Deserialization is used?

Serialization/Deserialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database).

No comments:

Post a Comment