This is a discussion on Simple Interview Questions within the C# Programming forums, part of the Software Development category; What’s the advantage of using System.Text.StringBuilder over System.String? StringBuilder is more efficient in cases where there ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| What’s the advantage of using System.Text.StringBuilder over System.String? StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created. |
| Sponsored Links |
| |||
| What’s the difference between the System.Array.CopyTo() and System.Array.Clone()? The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object. |
| |||
| What’s an abstract class? A class that cannot be instantiated. An abstract class is a class that must be inherited and have the methods overridden. An abstract class is essentially a blueprint for a class without any implementation. |
| |||
| What happens if you inherit multiple interfaces and they have conflicting method names? It’s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you’re okay. To Do: Investigate |
| |||
| Explain ACID rule of thumb for transactions. Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions), Consistent (data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t), Isolated (no transaction sees the intermediate results of the current transaction), Durable (the values persist if the data had been committed even if the system crashes right after). |
| |||
| What is the difference between const and static read-only? The difference is that static read-only can be modified by the containing class, but const can never be modified and must be initialized to a compile time constant. To expand on the static read-only case a bit, the containing class can only modify it: -- in the variable declaration (through a variable initializer). -- in the static constructor (instance constructors if it's not static). Last edited by KiruthikaSambandam : 03-20-2008 at 09:35 PM. |
| |||
| What’s the difference between an interface and abstract class? In the interface all methods must be abstract; in the abstract class some methods can be concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes. |
| |||
| What are strong and weak references? Normally, the GC cannot collect an object if it is reachable, i.e. if there is a direct or indirect reference to it. Such references are called strong references. A weak reference allows an object to be collected by the GC while it is still referenced. In such a case, the reference will either return a valid object or null if the GC has collected it. Use the System.WeakReference class to use weak references. Set the Target property of this class to an object to which you want to obtain a weak reference. Weak references can be used to increase performance in cases where the weak-referenced object can be allowed to be collected by the GC without major impact on the system using the object. |
| |||
| What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET? SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix, but it’s a .NET layer on top of OLE layer, so not the fastest thing in the world. ODBC.NET is a deprecated layer provided for backward compatibility to ODBC engines. |
| |||
| Explain ACID rule of thumb for transactions. Transaction must be Atomic (it is one unit of work and does not dependent on previous and following transactions), Consistent (data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t), Isolated (no transaction sees the intermediate results of the current transaction), Durable (the values persist if the data had been committed even if the system crashes right after). |
| |||
| What is a pre-requisite for connection pooling? Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings. |
| |||
| Why are there five tracing levels in System.Diagnostics.TraceSwitcher? The tracing dumps can be quite verbose and for some applications that are constantly running you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities. |
| |||
| What debugging tools come with the .NET SDK? CorDBG – command-line debugger, and DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch. |
| |||
| What’s a satellite assembly? When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP Interview Questions & Answers | H2o | Interview Questions & Answers and Tips | 102 | 04-07-2008 07:26 AM |
| Testing Interview Questions....here | tanurai | Interview Questions & Answers and Tips | 6 | 03-24-2008 04:25 AM |
| HR Interview Questions with Answers | Sabari | Interview Questions & Answers and Tips | 63 | 11-23-2007 06:13 AM |
| .Net Interview Questions & Answers | Venkat | Interview Questions & Answers and Tips | 100 | 11-13-2007 06:55 AM |
| Interview Questions | shiva | Interview Questions & Answers and Tips | 6 | 08-24-2007 02:28 AM |