Common interview Question for C# and .Net Technology - World's Largest Collection of Interview Questions

@ What is C#
- is an oo language which is developed by microsoft that uses the .net technology

@ What are the characteristic of C#
- modern
- type safe
- oo
- versioning

@ What is the is operator?
- check whether the runtime type of an object is compatible with the given type

@ What does the parameter initial Catalog define inside Connection String ?
- the database name to connect to

@ What class is underneath the SortedList class
- a sorted hash table

@ How can you sort the elements of the array in decending orders
- by calling Sort() and Reverse() method

@ What is the size in bytes of object
- the object = 8 bytes
- instance of the object = 12 bytes

@ What happends in memory when you box unbox a value-type
- boxing : convert a value-type to reference-type thus storing the object on the heap
- unboxing : convert a reference-type to value-type thus storing the object on the stack

@ What is the difference between System.String and System.StringBuilder class
- System.String = immutable; once you initialize a content, you cannot change
- System.StringBuilder = mutable; allows you to change the content

@ Can you store mulitple data types in System.Array?
- no

@ Expain the three services model(three tier application)
- Presentation (UI), Business (logic and underlying code), Data (storage)

@ What connections does Microsoft SQL server support
- Windows Authentication
- SQL server authentication

@ In how many ways you can create new copies of an existing string in C#
- Overloaded : String string1 = string2;
- Static copy method :  String string1 = String.copy(string2);

@ In how many ways you can compare two strings in C# using overloaded mehthods and operators
- Overloaded compare() method
- Overloaded Equal() method
- Overloaded == operator

@ How to concatenate two arrayList
- list1.addRange(list2);

@ What is Namespace
- is a keyword declared to use a scope; you can declare another namespace, class, interfaces and others.

@ What are partial classes
- allowing the seperation of a class into multiple source files

@ What is the difference between Convert.ToInt32 and Int32.Parse(String)
- Convert.ToInt32 return 0; Int32.parse(String) return nullException; if the string is null

@ Are private class-level variables inherited?
- yes, but they are not accessible.

Artikel Berkaitan