Sunday, November 2, 2008

DotNet Faqs

DOT Net FAQ

1 Advantage of .Net compare to other languages.
Ans: Dot Net is having
• Language Interoperability
• Platform and Processor Independency
• Supports Open Standards ( XML,WSDL,UDDI )
• High Security ( Windows / Forms Authentication )
2.Dotnet architecture
Ans: 1. IDE – CLS/ CTS
2.BCL
3. CLR
3. what is CLR
Ans: Runtime Infrastructure for Dot Net Applications

4. define CLS

Ans: A set of Library Files provides to execute Dot Net Applications

5. what is name space and list out the namespaces
Ans: Logical grouping of classes, System.Data,System.web.UI
6. define assembly and types of assemblies

Ans:Collection of MSIL Types and Meta Data.
1)Private Assembly
2)Shared Assembly

7. Managed code
Ans:Code which targets the CLR is called Managed code.
Code which targets the OS is called Unmanaged Code.
8. what is JIT compiler and what are the types
Converts the MSIL Types to Native code
1)pre-JIT
2)Echo-JIT
3)Normal-JIT
9. What is the base class of .Net
Ans:System.object
10. what is the Metadata and Types of metadata
Ans: The data about Data (MSIL Types) and Type Meta Data, Assembly Meta Data, Resource Meta Data are the types of the MD
11. what are the steps involved in creating an assembly
1)csc –t:library filename.cs

12. How to convert the private assembly to shared assembly
Ans:
1)first convert in to .dll file
2)Create FileName.Snk using Strong Name tool
(sn –k Filename.snk)
3)Create Asseblyinfo.cs File
(
[Assembly:Assemblyversion=”1.0.0.1”]
[Assembly:AssmblyKeyfile(“FileName.snk”)]

)

4) Gacutil –I .dll fileName

-I -> inserting the Assembly in to GAC
-U -> Deleting the Assembly in to GAC
13. What is the use of strong name
ANS:To avoid the Naming Confliction in GAC
14. what is shadowing
ANS:using super class reference we can’t access the sub class members.
15. what is method overriding
Ans:
To avoid the shadowing we are going for overriding. using super class reference we can access the sub class members
16. types of class members
Ans:
Instance class members
Static class members
17. constructor
Ans:

Mainly used for variable initialition.
At the time object creation the contructor will invoke automatically
18. what is the use of THIS keyword
Ans:
THIS keyword pointing to the current object
19. diff b/t OUT parameters and REF parameters
Ans:
Using Ref we can the values from main to that function.
But in the case of OUT we can’t pass the values from main to that function.

20. Explain and Garbage collector
Ans:

It’s Like a Destructor.It will automatically destroy’s the object whenever the memory is low.
21. what are the various mechanism of Polymorphism
Ans:
Compile Time polymorphism(Operator over loading,Function over loading)
Runtime Polymorphism(Virutal Fuctions)

22. what is inheritance and types of inheritance

Ans:Code reusability.
Single
Multiple
Multilevel
Hiararical
23. what is the use of interface
ans: The Dotnet will not support the multiple inheritance so we use interface.

24. what is the property and write syntax
Ans:
Property is a behaviour like a method, which can access like a variable
Every Property contains Set and Get Blocks
In Set Block always we are assigning the value to a property and From Get Block we are retrieving the value of a property.
25. diff b/t class and structure
Ans :
1. Class are reference type and where as structure is a value type
2.class cant be inherited where structure can be inherited.
26. diff b/t abstract class and interface
ans: abstract class contains both abstract method and concrete method. where as the interface contains only abstract methods .


27. Delagate and write delagate synatax

Ans: Delegates are function pointers which is holding a address of a specific function.
Syntax:
Public delegate (signature);
28. Muliticast Delagate
Ans: If the delegate handles more than one function address is called Multi cast delegate
29. Event
Ans: Event is an Action on an object
All the Events are internally delegate instance.
30. Types of collections in Dot net
Ans:
.NET Supports the Dynamic collections
1)Arrary list(support random access)
2)Hashtable(support random access)
3)Stack(doesn’t support random access)
4)Queue(doesn’t support random access)
31. What are Collections supports for Random Access
Ans:
1)Arrary list(support random access)
2)Hashtable(support random access)

32. Can we instantiate the file and Directory class

No.We can’t instantiate .Because of that are having private constructor

33. what are the class that supports byte and charatcter oriented in I/O streams
Binary Writer,Binary Reader(byte)
Stream Reader,Stream Writer(Charactor)

34. What is Serialization and Explain types
Ans:
Is a process of maintaining the persistency (state) of an object.
* Deep Serialization
1)Binary
2)SOAP
* Shallow Serialization
1)XML
35. What are the XML technologies
1)XML
2)DTD
3)Xpath
4)XSL/XSLT
5)Parsers

36. What is DTD and Explain types of DTD
Ans:It’s define the structure or constraints on a specific Xml Document
Types of DTD
1)Internal DTD
2)External DTD


37. define remoting and types of remoting objects
ANS:
Remoting is a Communication between the Two objects located in the same process running in same machine or two different machine.
1)Marshal by value
2)Marshal by Ref
38. what are the protocols that supports remoting
Ans:HTTP,AND TCP
39. What is the use of port and list out some post numbers
Ans: Port is a physical device of a system which is used for Communicating between the two systems. Internally every process is running it’s own port, that is identified by one unique port number.
HTTP:80
FTP:20,21
Telnet:23
40. What is the use of APP.config
Ans:
In Future suppose we are going to modify some data in that application,we can change that information in configuration file without disturbing the sourcecode.
41. What is the diff b/t SAO types and CAO
Ans:
In the case of SAO singleton Server creates only one object for multiple request by multiple clients.
In the case of SAO siglecall Server creates one object for each request made by sameclient or different client.
In the case of CAO Server creates Each object for each Client.
42. What is Reflection and write Namespace for it
Ans:
Using Reflection we can retrieve the metadata of an assembly at runtime.
System.Reflection
43. write the syntax for appsettings in APP.config
Ans:


44. What is Enumerations
Ans:A group of fixed values.
45. What is Exceptions Handling and explain the Blocks
Ans:
To Avoid the abnormal termination of an application we are going for Exception Handling.
Three blocks.
1)Try
2)Catch
3)Finally(optional)
46. What is the difference b/t FOR and FOR EACH LOOP
Ans:
For loop it will writes only numeric values.
ForEach it will writes object Types.
47. Can we invoke the garbage collector programmatically. Yes/No
Ans:
Yes
48. What is Destructor and Syntax
Ans:
Public Finalizer();
49. What is Diff/B/t ADO and ADO.Net
Ans:
ADO:DNA Architecture
Connection oriented
Only record set
Ado.NET:Dotnet Architecture.
Dicconnected Architecure
Much more Complex
Having Dataset
50. List out some provider Name in Ado .Net
Ans:
1)Oledb
2)odbc
3)Msdaora
51. What are the Methods in Command class
Ans:
1)Execute Reader
2)Execute Nonquery
3)Execute Scaler
52. What is the use of Data Adapter
Ans:
To Establish the connection between the Database to dataset.
53. Diff b/t the Data Reader and Data set
Ans:
DataReader:Connection oriended
Forward only,Readonly
Dataset :Disconnected
We can do DML(Insert,update,Delete) operation in Dataset
54. what is the Returns type of execute scalar methods()
Return Type:object
55. Define dataset
Ans:
Dataset is a container,Which can have multiple tables in different datasources.
56. What is the use Transaction Class
Ans:
This class is used to control the transaction in back end. Using Commit and Rollback Command.
57. How to copy data from one dataset to another dataset.
Ans:
Ds.Copy();


58.AUTHENTICATION AND AUTHORIZATION

ANS:

See lets take a example of login
we have 2 important steps in it.

1. We have to enter username and password to login
2. for every page we have to check if credentials use while logging are correct or not.

So first one is authentication. Secured process to access a page
Second one is authorization. Checking logged in permissions for all pages.

I hope you understood.



What are the contents of assembly?
In general, a static assembly can consist of four elements:
• The assembly manifest, which contains assembly metadata.
• Type metadata.
• Microsoft intermediate language (MSIL) code that implements the types.
• A set of resources.

1. What is Method overloading?
Method overloading occurs when a class contains two methods with the same name, but different signatures.

No comments: