Tuesday, July 15, 2008

Basic Dot Net Interview Questions

What is the difference between a Struct and a Class ?
Answer :
The struct type is suitable for representing lightweight objects such as Point, Rectangle, and Color. Although it is possible to represent a point as a class, a struct is more efficient in some scenarios. For example, if you declare an array of 1000 Point objects, you will allocate additional memory for referencing each object. In this case, the struct is less expensive. When you create a struct object using the new operator, it gets created and the appropriate constructor is called. Unlike classes, structs can be instantiated without using the new operator. If you do not use new, the fields will remain unassigned and the object cannot be used until all of the fields are initialized. It is an error to declare a default (parameterless) constructor for a struct. A default constructor is always provided to initialize the struct members to their default values.It is an error to initialize an instance field in a struct.There is no inheritance for structs as there is for classes. A struct cannot inherit from another struct or class, and it cannot be the base of a class. Structs, however, inherit from the base class Object. A struct can implement interfaces, and it does that exactly as classes do.A struct is a value type, while a class is a reference type.

What are the types of authentication in .net?
We have three types of authentication:. Form authenticatio. Windows authentication. Passport This has to be declared in web.config file.

What is difference between constants, readonly and, static ?
Constants: The value can’t be changedRead-only: The value will be initialized only once from the constructor of the class.Static: Value can be initialized once.
What is the benefit of using an enum rather than a #define constant?
The use of an enumeration constant (enum) has many advantages over using the traditional symbolic constant style of #define. These advantages include a lower maintenance requirement, improved program readability, and better debugging capability.
1) The first advantage is that enumerated constants are generated automatically by the compiler. Conversely, symbolic constants must be manually assigned values by the programmer.For instance, if you had an enumerated constant type for error codes that could occur in your program, your enum definition could look something like this:
enum Error_Code{OUT_OF_MEMORY,INSUFFICIENT_DISK_SPACE,LOGIC_ERROR,FILE_NOT_FOUND};
In the preceding example, OUT_OF_MEMORY is automatically assigned the value of 0 (zero) by the compiler because it appears first in the definition. The compiler then continues to automatically assign numbers to the enumerated constants, making INSUFFICIENT_DISK_SPACE equal to 1, LOGIC_ERROR equal to 2, and FILE_NOT_FOUND equal to 3, so on.If you were to approach the same example by using symbolic constants, your code would look something like this:
#define OUT_OF_MEMORY 0#define INSUFFICIENT_DISK_SPACE 1#define LOGIC_ERROR 2#define FILE_NOT_FOUND 3
values by the programmer. Each of the two methods arrives at the same result: four constants assigned numeric values to represent error codes. Consider the maintenance required, however, if you were to add two constants to represent the error codes DRIVE_NOT_READY and CORRUPT_FILE. Using the enumeration constant method, you simply would put these two constants anywhere in the enum definition. The compiler would generate two unique values for these constants. Using the symbolic constant method, you would have to manually assign two new numbers to these constants. Additionally, you would want to ensure that the numbers you assign to these constants are unique.
2) Another advantage of using the enumeration constant method is that your programs are more readable and thus can be understood better by others who might have to update your program later.
3) A third advantage to using enumeration constants is that some symbolic debuggers can print the value of an enumeration constant. Conversely, most symbolic debuggers cannot print the value of a symbolic constant. This can be an enormous help in debugging your program, because if your program is stopped at a line that uses an enum, you can simply inspect that constant and instantly know its value. On the other hand, because most debuggers cannot print #define values, you would most likely have to search for that value by manually looking it up in a header file.
What is Reference type and value type ?
Reference Type: Reference types are allocated on the managed CLR heap, just like object types. A data type that is stored as a reference to the value’s location. The value of a reference type is the location of the sequence of bits that represent the type’s data. Reference types can be self-describing types, pointer types, or interface types
Value Type: Value types are allocated on the stack just like primitive types in VBScript, VB6 and C/C++. Value types are not instantiated using new go out of scope when the function they are defined within returns.
Value types in the CLR are defined as types that derive from system.valueType.
A data type that fully describes a value by specifying the sequence of bits that constitutes the value’s representation. Type information for a value type instance is not stored with the instance at run time, but it is available in metadata. Value type instances can be treated as objects using boxing.
Why only boxed types can be unboxed?
Unboxing is the process of converting a Reference type variable to Value type and thus allocating memory on the stack . It happens only to those Reference type variables that have been earlier created by Boxing of a Value Type , therefore internally they contain a value type , which can be obtained through explicit casting . For any other Reference type , they don’t internally contain a Value type to Unboxed via explicit casting . This is why only boxed types can be unboxed .
What is MSIL, IL, CTS and, CLR ?
MSIL: (Microsoft intermediate language) When compiling to managed code, the compiler translates your source code into Microsoft intermediate language (MSIL), which is a CPU-independent set of instructions that can be efficiently converted to native code. MSIL includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations. Before code can be executed, MSIL must be converted to CPU-specific code, usually by a just-in-time (JIT) compiler. Because the common language runtime supplies one or more JIT compilers for each computer architecture it supports, the same set of MSIL can be JIT-compiled and executed on any supported architecture. When a compiler produces MSIL, it also produces metadata. Metadata describes the types in your code, including the definition ofeach type, the signatures of each type’s members, the members that our code references, and other data that the runtime uses at execution time. The MSIL and metadata are contained in a portable executable (PE) file that is based on and extends the published Microsoft PE and Common Object File Format (COFF) used historically for executable content. This file format, which accommodates
MSIL or native code as well as metadata, enables the operating system to recognize common language runtime images. The presence of metadata in the file along with the MSIL enables your code to describe itself, which means that there is no need for type libraries or Interface Definition Language (IDL). The runtime locates and extracts the metadata from the file as needed during execution.IL: (Intermediate Language)A language used as the output of a number of compilers and as the input to a just-in-time (JIT) compiler. The common language runtime includes a JIT compiler for converting MSIL to native code.
CTS: (Common Type System) The specification that determines how the common language runtime defines, uses, and manages types
CLR: (Common Language Runtime) The engine at the core of managed code execution. The runtime supplies managed code with services such as cross-language integration, code access security, object lifetime management, and debugging and profiling support.
Differnce between Managed code and unmanaged code ?
Managed Code: Code that runs under a “contract of cooperation” with the common language runtime. Managed code must supply the metadata necessary for the runtime to provide services such as memory management, cross-language integration, code access security, and automatic lifetime control of objects. All code based on Microsoft intermediate language (MSIL) executes as managed code.
Un-Managed Code:Code that is created without regard for the conventions and requirements of the common language runtime. Unmanaged code executes in the common language runtime environment with minimal services (for example, no garbage collection, limited debugging, and so on).
How can I stop my code being reverse-engineered from IL?
There is currently no simple way to stop code being reverse-engineered from IL. In future it is likely that IL obfuscation tools will become available, either from MS or from third parties. These tools work by ‘optimising’ the IL in such a way that reverse-engineering becomes much more difficult. Of course if you are writing web services then reverse-engineering is not a problem as clients do not have access to your IL.
What are attributes?
There are at least two types of .NET attribute. The first type I will refer to as a metadata attribute - it allows some data to be attached to a class or method. This data becomes part of the metadata for the class, and (like other class metadata) can be accessed via reflection. The other type of attribute is a context attribute. Context attributes use a similar syntax to metadata attributes but they are fundamentally different. Context attributes provide an interception mechanism whereby instance activation and method calls can bepre- and/or post-processed.
Why is XmlSerializer so slow?
There is a once-per-process-per-type overhead with XmlSerializer. So the first time you serialize or deserialize an object of a given type in an application, there is a significant delay. This normally doesn’t matter, but it may mean, for example, that XmlSerializer is a poor choice for loading configuration settings during startup of a GUI application.
Can I customise the serialization process?
Yes. XmlSerializer supports a range of attributes that can be used to configure serialization for a particular class. For example, a field or property can be marked with the [XmlIgnore] attribute to exclude it from serialization. Another example is the [XmlElement]attribute, which can be used to specify the XML element name to be used for a particular property or field.Serialization via SoapFormatter/BinaryFormatter can also be controlled to some extent by attributes. For example, the [NonSerialized] attribute is the equivalent of XmlSerializer’s [XmlIgnore] attribute. Ultimate control of the serialization process can be acheived by implementing the the ISerializable interface on the class whose instances are to be serialized.
What is serialization?
Serialization is the process of converting an object into a stream of bytes. Deserialization is the opposite process of creating an object from a stream of bytes. Serialization / Deserialization is mostly used to transport objects (e.g. during remoting), or to persistobjects (e.g. to a file or database).
Is the lack of deterministic destruction in .NET a problem?
It’s certainly an issue that affects component design. If you have objects that maintain expensive or scarce resources (e.g. database locks), you need to provide some way for the client to tell the object to release the resource when it is done. Microsoft recommend that you provide a method called Dispose() for this purpose. However, this causes problems for distributed objects - in a distributed system who calls the Dispose() method? Some form of reference-counting or ownership-management mechanism is needed to handle distributed objects - unfortunately the runtime offers no help with this.
What is side-by-side execution?
Can two application one using private assembly and other using Shared assembly be stated as a side-by-side executables? Side-by-side execution is the ability to run multiple versions of an application or component on the same computer. You can have multiple versions of the common language runtime, and multiple versions of applications and components that use a version of the runtime, on the same computer at the same time. Since versioning is only applied to shared assemblies, and not to private assemblies, two application one using private assembly and one using shared assembly cannot be stated as side-by-sideexecutables.
Does the .NET Framework have in-built support for serialization?
There are two separate mechanisms provided by the .NET class library - XmlSerializer and SoapFormatter/BinaryFormatter. Microsoft uses XmlSerializer for Web Services, and SoapFormatter/BinaryFormatter for remoting. Both are available for use in your own code.
What is the difference between a private assembly and a shared assembly?
Location and visibility: A private assembly is normally used by a single application, and is stored in the application’s directory, or a sub-directory beneath. A shared assembly is normally stored in the global assembly cache, which is a repository of assemblies maintained by the .NET runtime. Shared assemblies are usually libraries of code which many applications will find useful, e.g. the .NET framework classes.Versioning: The runtime enforces versioning constraints only on shared assemblies, not on private assemblies.
What is the CTS, and how does it relate to the CLS?
CTS = Common Type System. This is the full range of types that the .NET runtime understands. Not all .NET languages support all the types in the CTS.CLS = Common Language Specification. This is a subset of the CTS which all .NET languages are expected to support. The idea is that any program which uses CLS-compliant types can interoperate with any .NET program written in any language. This interop is very fine-grained - for example a VB.NET class can inherit from a C# class.
what size is a .NET object?
Each instance of a reference type has two fields maintained by the runtime - a method table pointer and a sync block. These are 4 bytes each on a 32-bit system, making a total of 8 bytes per object overhead. Obviously the instance data for the type must be added to this to get the overall size of the object. So, for example, instances of the following class are 12 bytes each:
class MyInt{…private int x;}
However, note that with the current implementation of the CLR there seems to be a minimum object size of 12 bytes, even for classes with no data (e.g. System.Object).
Values types have no equivalent overhead.
What is the difference between an event and a delegate?
An event is just a wrapper for a multicast delegate. Adding a public event to a class is almost the same as adding a public multicast delegate field. In both cases, subscriber objects can register for notifications, and in both cases the publisher object can send notifications to the subscribers. However, a public multicast delegate has the undesirable property that external objects can invoke the delegate, something we’d normally want to restrict to the publisher. Hence events - an event adds public methods to the containing class to add and remove receivers, but does not make the invocation mechanism public.
What is an event and what are the models available for event handling?
An event is an event object that describes a state of change in a source. In other words, event occurs when an action is generated, like pressing button, clicking mouse, selecting a list, etc. There are two types of models for handling events and they are: a) event-inheritance model and b) event-delegation model
What is adapter class?
An adapter class provides an empty implementation of all methods in an event listener interface. Adapter classes are useful when you want to receive and process only some of the events that are handled by a particular event listener interface. You can define a new class to act listener by extending one of the adapter classes and implementing only those events in which you are interested.
How does .NET remoting work?
.NET remoting involves sending messages along channels. Two of the standard channels are HTTP and TCP. TCP is intended for LANs only - HTTP can be used for LANs or WANs (internet).
Support is provided for multiple message serializarion formats. Examples are SOAP (XML-based) and binary. By default, the HTTP channel uses SOAP (via the .NET runtime Serialization SOAP Formatter), and the TCP channel uses binary (via the .NET runtime Serialization Binary Formatter). But either channel can use either serialization format.
There are a number of styles of remote access:
* SingleCall. Each incoming request from a client is serviced by a new object. The object is thrown away when the request has finished.* Singleton. All incoming requests from clients are processed by a single server object.* Client-activated object. This is the old stateful (D)COM model whereby the client receives a reference to the remote object and holds that reference (thus keeping the remote object alive) until it is finished with it.
Distributed garbage collection of objects is managed by a system called ‘leased based lifetime’. Each object has a lease time, and when that time expires the object is disconnected from the .NET runtime remoting infrastructure. Objects have a default renew time - the lease is renewed when a successful call is made from the client to the object. The client can also explicitly renew the lease.
How do I know when my thread pool work item has completed?
There is no way to query the thread pool for this information. You must put code into the WaitCallback method to signal that it has completed. Events are useful for this.
How do I stop a thread?
There are several options. First, you can use your own communication mechanism to tell the ThreadStart method to finish. Alternatively the Thread class has in-built support for instructing the thread to stop. The two principle methods are Thread.Interrupt() and Thread.Abort(). The former will cause a ThreadInterruptedException to be thrown on the thread when it next goes into a WaitJoinSleep state. In other words, Thread.Interrupt is a polite way of asking the thread to stop when it is no longer doing any useful work. In contrast, Thread.Abort() throws a ThreadAbortException regardless of what the thread is doing. Furthermore, the ThreadAbortException cannot normally be caught (though the ThreadStart’s finally method will be executed). Thread.Abort() is a heavy-handed mechanism which should not normally be required.
How does CAS work?
The CAS security policy revolves around two key concepts - code groups and permissions. Each .NET assembly is a member of a particular code group, and each code group is granted the permissions specified in a named permission set.
What is Code Access Security (CAS)?
CAS is the part of the .NET security model that determines whether or not code is allowed to run, and what resources it can use when it is running. For example, it is CAS that will prevent a .NET web applet from formatting your hard disk.
What is the lapsed listener problem?
The lapsed listener problem is one of the primary causes of leaks in .NET applications. It occurs when a subscriber (or ‘listener’) signs up for a publisher’s event, but fails to unsubscribe. The failure to unsubscribe means that the publisher maintains a reference to the subscriber as long as the publisher is alive. For some publishers, this may be the duration of the application.
This situation causes two problems. The obvious problem is the leakage of the subscriber object. The other problem is the performance degredation due to the publisher sending redundant notifications to ‘zombie’ subscribers.
There are at least a couple of solutions to the problem. The simplest is to make sure the subscriber is unsubscribed from the publisher, typically by adding an Unsubscribe() method to the subscriber.
How can I find out what the garbage collector is doing?
Lots of interesting statistics are exported from the .NET runtime via the ‘.NET CLR xxx’ performance counters. Use Performance Monitor to view them.
What is the CTS?
CTS = Common Type System. This is the range of types that the .NET runtime understands, and therefore that .NET applications can use. However note that not all .NET languages will support all the types in the CTS. The CTS is a superset of the CLS.
Difference Between VB and VB.Net.
VB.Net (or VB7.0) is not an upgrade to VB 6.0; it is a completely new language written from the ground up to be compatible with Microsofts “dotnet” Common Language Runtime. The legacy VB language was used as a general guide for syntax but backwards compatibility was sacrificed at so many points that there is little code that can be directly ported. If you are looking at VB.Net as a potential upgrade path for current applications or as a tool for current developers to move into and then learn new features you are probably going to have significant problems. The Visual Basic 6.0 runtime is great at simplifying many of the common programming tasks. But having this simplifying layer has meant that you cant use a new operating system feature, such as DirectX, until there is a Visual Basic-accessible wrapper around it. As a Visual Basic developer, the most important benefit you get from the .NET Framework is direct and easy access to the underlying .NET platform using a consistent programming model. This means you can build applications with Visual Basic.NET that were not easy or not possible to build with Visual Basic 6.0. As a Visual Basic 6.0 developer, you will appreciate now having access to the same features and capabilities as other platform languages. For example, to create a Windows Service, you no longer have to write it in Visual C++, nor will you have to resort to hacks or kludges. You can do it all elegantly, cleanly, and easily using Visual Basic.NET. To give you some examples of what you can do with the .NET Framework, lets discuss four common tasks that you might need to perform in your applications: tracing and event logging, multithreading, file system monitoring, and creating Windows Services. Tracing and Event Logging When building a robust application, you must pay careful attention to diagnostics and troubleshooting mechanisms. Typically, this involves writing a tracing component, which handles opening the output destination (event log or file), writing the trace message, and closing the output destination. You then call methods on this component throughout your code, passing it the text to log. You invest all this time and effort to build a tracing and logging subsystem, which ultimately does not contribute to solving the business problem but is required to build the application. The .NET Framework includes classes and other data types that make it easy to log trace messages by providing the logging infrastructure for you. Multithreaded Applications One of the great features of the .NET Framework is the ability to create multithreaded applications in Visual Basic without having to use third-party tools or unsupported Visual Basic tricks. The .NET Frameworks multithreading support is provided by classes and interfaces in the System.Threading namespace, so all .NET languages can create and manipulate threads in the same way. System.Threading.Thread is the core class and provides support for creating and controlling threads. To create a thread, you create a new System.Threading.Thread object that passes the constructor a ThreadStart delegate. This delegate represents the method where the thread will begin its execution. When youre ready to start the new thread, you call Thread.Start() (see Listing 1). As you start to build multithreaded applications, youll quickly realize the need to control access to shared resources, such as shared class variables. The .NET Framework also includes several classes and data types that you can use to synchronize actions performed by two threads. File System Monitoring Ive come across a few applications that are required to wait and process files that show up in a particular directory—for example, an application that imports data from a file into a database. Data files may be downloaded from a mainframe or otherwise transferred into an input directory, from which the application imports them into a database. Instead of constantly polling the directory for new files, you can wait for notifications indicating that a new file has been created. You can do this in Visual Basic 6.0 by using Win32 APIs, and you can do it in Visual Basic.NET by using the .NET Framework classes. However, implementation in .NET is more consistent with the way you do everything else in .NET, so the learning curve is minimal. Creating Windows Services When you want to create a Windows Service, you must use Visual C++ or resort to using srvany.exe or third-party tools to create the service in Visual Basic. Either way, you are not writing your service natively in Visual Basic, and you are adding more dependencies outside the Visual Basic runtime. If you write a Windows Service from scratch using C++ or C (without using the Active Template Library), youll have to write quite a bit of code to coordinate communication back and forth between your service and the Service Control Manager (SCM), which handles starting, pausing, continuing, and stopping services. The .NET Framework makes it easy to implement a service by providing the System.ServiceProcess.ServiceBase class. To write a service, you inherit from this class, override some of its methods, set its properties, and youre ready to go!
What is Structured Exception Handling?
Structured Exception handling is a fundamental part of the CLR, and provides .NET programmers with a great way of managing errors. All the exceptions are derived from the System.Exception class. The System.Exception class is the parent class for all the exceptions. When an exception occurs in an application, the system throws the error and the error is handled through the process of structured exception handling.In Structured Exception handling, the application is divided into blocks of code. Those blocks that have the probability of raising an error contain one or more associated exception handlers. Structured exception handling uses the Try…Catch…Finally statement.
How can we Handle Exception in VB.Net?
Vb.Net provides two ways to handle exceptionsi) Structured Exception Handlingii)Unstructured Exception Handling
Which of the following is NOT supported for .NET Classes?
Multiple InheritanceClearly, in VB.NET or C# or any language supported by .NET framework, a child Class cannot Inherit from 2 Parent Classes. It inherits from a Single Parent class. So, no multiple inheritance ALLOWED in .NET for Classes, However multiple inheritance is allowed for Interfaces.
Which Polymorphism-keyword should be used [within the Child class code] for Method/Function of the Parent Class to be executed?
ShadowingOccurs for activity of Parent Class to take precedence over the Child Class; The Reverse or vice-versa - u write Overrides - so that Child class method gets executed.
What is an Interface Class?
It’s an abstract class with public abstract methods all of which must be implemented in the inherited classes.
What is interface and its use?
Interface is similar to a class which may contain method’s signature only but not bodies and it is a formal set of method and constant declarations that must be defined by the class that implements it. Interfaces are useful for:
a) Declaring methods that one or more classes are expected to implementb) Capturing similarities between unrelated classes without forcing a class relationship.c) Determining an object’s programming interface without revealing the actual body of the class.
How do we implement private interfaces?
Private interfaces can not be implemented.Interfaces must always be declared as public so that they can be implemented or inherited
What is the significance of Shadowing a method in VB.Net?
It replaces all the implementation from high in the inheritance chain
What is the keyword in VB.Net to create an Abstract Class?
The keyword used to create Abstract Class in VB.Net is MustInherit
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.
When do you absolutely have to declare a class as abstract?
1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden.2. When at least one of the methods in the class is abstract.
What is the difference between abstract class and interface?
a) All the methods declared inside an interface are abstract whereas abstract class must have at least one abstract method and others may be concrete or abstract.
b) In abstract class, key word abstract must be used for the methodsWhereas interface we need not use that keyword for the methods. c)Abstract class must have subclasses whereas interface can’t have subclasses.
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. The connection string must be identical.
Explain ACID rule of thumb for transactions.Answer :
A transaction must be:1. Atomic - it is one unit of work and does not dependent on previous and following transactions.2. Consistent - data is either committed or roll back, no “in-between” case where something has been updated and something hasn’t.3. Isolated - no transaction sees the intermediate results of the current transaction).4. Durable - the values persist if the data had been committed even if the system crashes right after.
How is method overriding different from method overloading?
When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class.
What are the different ways a method can be overloaded?
Different parameter data types, different number of parameters, different order of parameters.
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.
Can you prevent your class from being inherited by another class?
Yes. The keyword “sealed” will prevent the class from being inherited.
What are Sealed Classes in C#?
Answer :
The sealed modifier is used to prevent derivation from a class. A compile-time error occurs if a sealed class is specified as the base class of another class. (A sealed class cannot also be an abstract class)

What does the term immutable mean?
The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.
What’s the difference between System.String and System.Text.StringBuilder classes?
System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed
What are Checked and UnChecked Exception?
A checked exception is some subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses.Making an exception checked forces client programmers to deal with the possibility that the exception will be thrown. eg, IOException thrown by java.io.FileInputStream’s read() method·Unchecked exceptions are RuntimeException and any of its subclasses. Class Error and its subclasses also are unchecked. With an unchecked exception, however, the compiler doesn’t force client programmers either to catch theexception or declare it in a throws clause. In fact, client programmers may not even know that the exception could be thrown. eg, StringIndexOutOfBoundsException thrown by String’s charAt() method· Checked exceptions must be caught at compile time. Runtime exceptions do not need to be. Errors often cannot be.
Can you tell me about Array Covariance?
For any two reference-types A and B, if an implicit reference conversion or explicit reference conversion exists from A to B, then the same reference conversion also exists from the array type A[R] to the array type B[R], where R is any given rank-specifier (but the same for both array types). This relationship is known as array covariance. Array covariance in particular means that a value of an array type A[R] may actually be a reference to an instance of an array type B[R], provided an implicit reference conversion exists from B to A.
Because of array covariance, assignments to elements of reference type arrays include a run-time check which ensures that the value being assigned to the array element is actually of a permitted type
What is Livelock?
A livelock is one, where a request for an exclusive lock is repeatedly denied because a series of overlapping shared locks keeps interfering. SQL Server detects the situation after four denials and refuses further shared locks. A livelock also occurs when read transactions monopolize a table or page, forcing a write transaction to wait indefinitely.
What is lock escalation?
Lock escalation is the process of converting a lot of low level locks (like row locks, page locks) into higher level locks (like table locks). Every lock is a memory structure too many locks would mean, more memory being occupied by locks. To prevent this from happening, SQL Server escalates the many fine-grain locks to fewer coarse-grain locks. Lock escalation threshold was definable in SQL Server 6.5, but from SQL Server 7.0 onwards it’s dynamically managed by SQL Server.
What is an Index?
When queries are run against a db, an index on that db basically helps in the way the data is sorted to process the query for faster and data retrievals are much faster when we have an index.
What’s the difference between a primary key and a unique key?
Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn’t allow NULLs, but unique key allows one NULL only.
What is the difference among “dropping a table”, “truncating a table” and “deleting all records” from a table.
Dropping : (Table structure + Data are deleted), Invalidates the dependent objects ,Drops the indexesTruncating: (Data alone deleted), Performs an automatic commit, Faster than deleteDelete : (Data alone deleted), Doesn’t perform automatic commit
How are DTDs/XML Schemas important while building XML applications?
Document Type Definition (DTD) or XML Schema is used to define the structure and other constrains for the XML documents. If an XML document has an associated DTD/Schema, it is said to be a valid XML document, and it ensures that the XML document structure and data adheres to the predefined rules. While using the XML document in an application, once the XML document is validated, it is then not required to assert/check for parent-child relationship, presence/absence of elements/attributes, data-value range checks, etc. The schema validation already took care of all such issues. If a valid XML document is being used as the media of data transfer between two parties, both can be rest assured that the XML document is as expected. In addition, DTDs/Schemas have many other benefits, including help in understanding the resultant XML document structure/constraints (documentation), and defining DTDs/Schemas is also a good design step
What is DOM?
Document Object Model (DOM) is a W3C specification that defines a standard (abstract) programming API to build, navigate and update XML documents. It is a “tree-structure-based” interface. As per the DOM specification, the XML parsers (such as MSXML or Xerces), load the entire XML document into memory, before it can be processed. XPath is used to navigate randomly in the document, and various DOM methods are used to create and update (add elements, delete elements, add/remove attributes, etc.) the XML documents.
What is XPath?
XML Path Language (XPath) is a W3C specification that defines syntax for addressing parts of XML document. XML document is considered as a logical tree structure, and syntax based on this consideration is used to address elements and attributes at any level in the XML document. For example, considering the XML document /abc:Employees/abc:Emp/@EmpID XPath expression can be used to access the EmpID attribute under the (first) Emp element under the Employees document element. XPath is used in various other specifications such as XSLT.
What is the use of Namespaces in XML?
As XML does not predefine any set of tags/attribute names. Hence, it is quite possible that two totally different XML documents, defined by two totally different people/ companies, use the same tag name/attribute name. If an application needs to use (merge, process, etc.) above two XML documents together, this would cause confusion and we need a way to distinguish deterministically between tags with the same name. XML Namespaces are used for this purpose. Namespaces are defined using URI (Uniform Resource Identifier), and then associated with the element/attribute names. Namespaces are also used to “group” a logically related set of XML vocabulary.
Explain what a DiffGram is, and a good use for one?
A DiffGram is an XML format that is used to identify current and original versions of data elements. When sending and retrieving a DataSet from an XML Web service, the DiffGram format is implicitly used.The DataSet uses the DiffGram format to load and persist its contents, and to serialize its contents for transport across a network connection. When a DataSet is written as a DiffGram, it populates the DiffGram with all the necessary information to accurately recreate the contents, though not the schema, of the DataSet, including column values from both the Original and Current row versions, row error information, and row order.DiffGram FormatThe DiffGram format is divided into three sections: the current data, the original (or “before”) data, and an errors section, as shown in the following example.
The DiffGram format consists of the following blocks of data:
The name of this element, DataInstance, is used for explanation purposes in this documentation. A DataInstance element represents a DataSet or a row of a DataTable. Instead of DataInstance, the element would contain the name of the DataSet or DataTable. This block of the DiffGram format contains the current data, whether it has been modified or not. An element, or row, that has been modified is identified with the diffgr:hasChanges annotation.
This block of the DiffGram format contains the original version of a row. Elements in this block are matched to elements in the DataInstance block using the diffgr:id annotation.
This block of the DiffGram format contains error information for a particular row in the DataInstance block. Elements in this block are matched to elements in the DataInstance block using the diffgr:id annotation.

69 comments:

Unknown said...

tnk u sir

Dot Net Training institutes in Chennai

Unknown said...

That;s a great list but a bit basic. If you want a more dynamic onine quiz there's one here Dot Net Interview Help Test

Sujitkumar said...

nice information dotnet training. Really helpful information.
keep sharing...........
Thanks

Unknown said...

Get 100+ asp.net mvc interview question answers. you are also join or download .net training course agenda.

Unknown said...



very useful info, and please keep updating........
b

Unknown said...

Really nice information here about by choosing with the headlines. We want to make the readers whether it is relevant for their searches or not. They will decide by looking at the headline itself. I agree with your points but i can't understand what's logic behind by including with the number? Why most of the marketers will suggest that one? Is there any important factor within that please convey me.....

Dot Net Training in Chennai

Software Testing Training in Chennai

Unknown said...
This comment has been removed by the author.
Unknown said...

I found your blog to be very informative and interesting. On similar lines you can also check out http://crbtech.in/Dot-Net-Training/interview-questions-answers-net-framework/ which is also a very good blog on this very topic. Request you to continue writing on varied topics as we would like to read.

Inwizards said...

Nice blog.. Thanks for sharing informative blog.. I just want to say that all the information you have given here is awesome...great and nice blog thanks sharing.
Hire .Net Developers India
.Net Development Company India
hire asp.net developers
.net development services

Hari said...

Hi,
Thanks for sharing the information, Plz keep sharing on...
Thank you...
DOT NET training institutes in Hyderabad

Unknown said...

Very nice article for online training thanks for sharing.
Dot Net Online Training

Inwizards said...

Nice blog. Thanks for sharing such great information.Inwizards Inc is a Dot Net Development company offers quality Asp Dot Net development services best in web industries. Intrested click here - Hire .Net Developers India

Sarah Rose said...

Order your first Asp Net Programming Assignment Help For Obtaining Better Grades at low rates online. Get Taxation law assignment help from Help My Assignment Writers at affordable rates. Law and Taxation Assignment Help | ASP NET Programming Assignment Help

Unknown said...

Nice and helpful post.
visit: VB.Net training

Unknown said...

Thanks for the informative article. This is one of the best resources I have found in quite some time. Once Again Thanks for Sharing this Valuable Information i like this i Can Share this with My Friend Circle.
ASP.NET Interview Questions and Answers

alltop said...



Hi Your Blog is very nice!!

Get All Top Interview Questions and answers PHP, Magento, laravel,Java, Dot Net, Database, Sql, Mysql, Oracle, Angularjs, Vue Js, Express js, React Js,
Hadoop, Apache spark, Apache Scala, Tensorflow.

Mysql Interview Questions for Experienced
php interview questions for freshers
php interview questions for experienced
python interview questions for freshers
tally interview questions and answers





Unknown said...

Great Post, I read it well. very useful info Thank you so much for sharing this one really well defined all information.

Dotnet Training in Chennai | Dotnet Training Institute in Chennai

latesttechnologyblogs said...

Thanks for sharing this post. Your post is really very helpful its students. .Net Online course Bangalore

padmini said...

Thanks for sharing this useful information. keep updating.If you want to learn DotNet course in online, please visit below site.
Dotnet online training
dotnet online course
dotnet online training in hyderabad
dotnet online training in Bangalore
dotnet online training in chennai

Unknown said...

Thanks for sharing such a nice blog...It is very useful and informative..mitroztech.com

David John said...

It is really a great work and the way in which you are sharing the knowledge is excellent.
Thanks for helping me to understand basic concepts. As a beginner in dot net programming, your post helps me a lot. Here I would like to share the information for students who want to become software developers & learn dot Net. DTA offers the best Dot Net Course Fee in Delhi for all modules. Thanks for your informative article.

NIIT Noida said...

I am very happy when read this blog post because blog post written in good manner and write on good topic.
Thanks for sharing valuable information
Dot Net Training Institute in Noida

Ace Mind Tech said...

Excellent information, I really appreciate the blog. To know more about DIGITAL MARKETING Tips:
List of Web Development Company in Delhi

Unknown said...

Get aws training in hyderabad from top institutes.

pooja said...

I always enjoy reading quality articles by an individual who is obviously knowledgeable on their chosen subject. Ill be watching this post with much interest. Keep up the great work, I will be back
Online DevOps Certification Course - Gangboard
Best Devops Training institute in Chennai

Saro said...

It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command
best rpa training in bangalore
rpa training in pune | rpa course in bangalore
RPA training in bangalore
rpa training in chennai

saranyaregan said...

Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
best rpa training in bangalore
rpa training in pune | rpa course in bangalore
RPA training in bangalore
rpa training in chennai

rohini said...

Wonderful article, very useful and well explanation. Your post is extremely incredible. I will refer this to my candidates...
Best Devops online Training
Online DevOps Certification Course - Gangboard
Best Devops Training institute in Chennai

nikitha josh said...

Such an excellent and interesting blog, do post like this more with more information, This was very useful, Thank you.
Aviation Academy in Chennai
Air hostess training in Chennai
Airport management courses in Chennai
Ground staff training in Chennai
Medical coding training in Chennai
Fashion designing courses in Chennai
Interior design courses in Chennai

Jaweed Khan said...

Hi, It's very best advantageous blogs.I read this subjects blog such a great blog and good sharing I'll be like this informative post.Thank you for selecting the time to provide us with your valuable knowledge.C#.NET Online Course

NIIT Noida said...

I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly...
Dot Net Training Institute in Noida
Python Training classes in Noida
Advanced Excel Training In Noida


NIIT Noida said...

I am very happy when this blog post read because blog post written in good manner and write on good topic.
Thanks for sharing valuable information…

C C++ Training Institutes in Noida
Oracle Training Institutes in Noida
Advanced Excel Training In Noida


NIIT Noida said...

I like you post.It is very usfull to all.
In this post having more usefull information and improve our knowledge.Can you share more valuable information present Technology.
Dot Net Training Institute in Noida
Oracle Training Institutes in Noida
Advanced Excel Training In Noida


Kamila said...

Thanks for your great and helpful presentation I like your good service. I always appreciate your post. That is very interesting I love reading and I am always searching for informative information like this. Well written article Thank You for Sharing with Us
Dot Net Course in Chennai | Dot Net Training Center in Chennai
Best Selenium Training Institute in Chennai | Selenium Coaching Institute in Chennai
Software Testing Training in Chennai | Testing Courses in Chennai
Java Training Institute in Chennai | Core Java Training in Chennai | Java Course and Certification
PHP Course in Chennai

APTRON Delhi said...

I like your blog. Thanks for Sharing the good post
ASP.NET Training Course in Delhi

manisha said...

nice course. thanks for sharing this post.
Dot Net Training in Noida

shweta said...

needed information.......
thank you so much......keep updating
https://www.exltech.in/dot-net-training.html

Ritika Goswami said...

Thanks for sharing such helpful information really good blog keep sharing more thanks for it
https://www.exltech.in/dot-net-training.html

educational blogs said...

Thanks for sharing this valuable information and we collected some information from this post.
Online Courses in Nigeria

Aditi said...

Thanks for sharing informative post. Click here to check ServiceNow Integration

educational blogs said...

I am so happy after reading your blog. It’s a very useful blog for us.

Corporate training in Machine learning


educational blogs said...

Thanks for sharing this valuable information and we collected some information from this post.

Data Science Corporate training

ramya said...



And indeed, Iam just always astounded concerning the remarkable things served by you. Some of the facts on this page are undeniably the most effective I have had.
Big Data Hadoop Training in Chennai
Advanced Linux Training in Chennai
Cloud Computing Training in Chennai
Top Software Testing Training in Chennai
Blue Prism Training in Chennai
Angularjs Training in Chennai
MCSE Training in Chennai
AI Training in Chennai
SEO Training in Chennai

priya said...

thanks for share information.have a great work!
All training in chennai zuan
PhP training in chennai
php course in chennai
php developer training institution chennai
php training with placement in chennai

akhilapriya404 said...

Nice information thank you,if you want more information please visit our link dot net course
dot net online training
visual studio training

Raj Sharma said...

Good Post. I like your blog. Thanks for Sharing.
.Net Training in Noida

Anonymous said...

Thanks for these interview question..All of these are very useful..
dot net classes in pune
dot net course in pune
Best dot net training institute in pune
dot net training in pune

software testing institute in pune
software testing course in pune
software testing classes in pune
best software testing institute in pune

Janu said...

Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.



Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery




Revathi said...

I have read your blog and I gathered some new information through your blog. Thanks for sharing the information..keep it up!!!

Android Training in Chennai

Android Online Training in Chennai

Android Training in Bangalore

Android Training in Hyderabad

Android Training in Coimbatore

Android Training

Android Online Training

Alwin Co Daan said...

Great Article. Thank you for sharing! Really an awesome post for every one.

IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Projects for CSE It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai


The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

praveen said...

Thanks for your informative article,Your post helped me to understand the future and career prospects &Keep on updating your blog with such awesome article.
angular js training in chennai

angular js training in porur

full stack training in chennai

full stack training in porur

php training in chennai

php training in porur

photoshop training in chennai

photoshop training in porur

Unknown said...

code works SEO Online Training
Java Online Training
python Online Training
Salesforce Online Training
Tableau Online Training

David Fincher said...

This post is so interactive and informative.keep update more information...
Android Training in Velachery
Android Training in Chennai

Leo Oliver said...

Due to the wide range of topics covered, students may find it difficult to compose their marketing assignments. But now that we're here to help you with your marketing assignments, you won't have to worry about them anymore because we're the best marketing assignment assistance. Our Marketing Assignment Help constantly helps students get the grades they need on their assignments.

Car Service said...

Looking for top quality car servicing in Geelong from trusted mechanics in Geelong? Armstrong Creek Motors helps you find the right workshop near you.

Ducat said...

Great blog, Keep writing such informative blogs, I am a regular reader of your blogs. Students searching for industry expert training and guarnteed placement assistance, can aplly in Ducat for best dot net training. Call now on 7070905090.

Pavithra Devi said...

This post is so interactive and informative.keep update more information...
Ethical Hacking Course in Tambaram
Ethical Hacking Course in Chennai

Techystick said...

Green Anarkali Suit Set
Cotton Anarkali kurti Sharara Suit
Red Anarkali Suit Set
Black Anarkali Flared Gown Suit
Chikankari Suit Set
Blue Anarkali Partywear Suit
Partywear Gown Suit Set
Anarkali Gown Suit Set
Partywear Suit Set

Harsh Sethi said...

Get The Best Assignment Help From Best Assignment Helpers Online

Assignment writing help
Essay Writing Help Services

Dissertation Writing Help Services
Case Studies Writing Help
Myob Help
Presentation Assignment Help Services
Proofreading and Editing Services
Find help for your assignment

Matt Reeves said...

Mindblowing blog very useful thanks
DevOps Training in Velachery
DevOps Training in Chennai

Dinesh Kumar said...

Dicsinnovatives in Delhi is one of the most reputed institution offering specialized digital marketing course in pitampura, Delhi. with 100% Placement ;Digital marketing institute in pitampura, Join now dicsinnovatives EMI Available. Enroll Now. Training.100+ Hiring Partners. Expert-Led Online Course. Industry Expert Faculty

krish said...

Dot Net Training In Chennai
Dot Net Training In Chennai
Dot Net Course In Bangalore

RSM Enterprises said...

Pink Lady Medicine is Used For Improving Sexual Disorder in Female
Buy Pink Lady 100mg
Buy Female Sildenafil 100mg

Assignment Help said...

Great post. keep sharing such a worthy information. Do visit https://assignmenthelpservice.net/services/essay-writing-service/

Jane Wilson said...

Thanks for sharing useful articles. For students, a project management assignment help is becoming increasingly significant. Project management is becoming a must for every other firm to handle various initiatives, which has led to an increase in the quantity of project managers hired.

Hire Web and Mobile App Developer said...

Thanks for sharing this informative article on some of the basic and important question on Asp Dot Net development interview question. If you have any requirement to Hire ASP.Net Developers for your web development solution. Please contact us.

vcube said...

This post is so interactive and informative. keep update more information..
python training in hyderabad

advocareaora said...

Really appreciate you sharing these great insights!
Rheumatoid arthritis

anjani02 said...

Workday HCM Certification Training
Gain hands-on experience in Workday Human Capital Management, covering HR, payroll, and business process frameworks. Prepare for global certification with live projects and practical learning modules.