Wednesday 27 April 2011

C# Interview Q & A



1.                   Does C# support multiple-inheritance?
Ans;  No.
 
2.                  Who is a protected class-level variable available to?
Ans;  It is available to any sub-class (a class inheriting this class).
 
3.                  Are private class-level variables inherited?
Ans;  Yes, but they are not accessible.  Although they are not visible or accessible via the class interface, they are inherited.
 
4.                  Describe the accessibility modifier “protected internal”.
Ans;  It is available to classes that are within the same assembly and derived from the specified base class.
 
5.                  What’s the top .NET class that everything is derived from?
Ans; 
System.Object.
 
6.                  What does the term immutable mean?
Ans; 
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.
 
7.                  What’s the difference between System.String and System.Text.StringBuilder classes?
Ans; 
System.String is immutable.  System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
 
8.                  What’s the advantage of using System.Text.StringBuilder over System.String?
Ans; 
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.
 
9.                  Can you store multiple data types in System.Array?
Ans; 
No.
 
10.              What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
Ans;  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.
 
11.               How can you sort the elements of the array in descending order?
Ans;  By calling Sort() and then Reverse() methods.
 
12.              What’s the .NET collection class that allows an element to be accessed using a unique key?
Ans;  HashTable.
 
13.              What class is underneath the SortedList class?
Ans;  A sorted HashTable.
 
14.              Will the finally block get executed if an exception has not occurred?­
Ans;  Yes.
 
15.              What’s the C# syntax to catch any possible exception?
Ans;  A catch block that catches the exception of type System.Exception.  You can also omit the parameter data type in this case and just write catch {}.
 
16.              Can multiple catch blocks be executed for a single try statement?
Ans;  No.  Once the proper catch block processed, control is transferred to the finally block (if there are any).
 
17.              Explain the three services model commonly know as a three-tier application.
Ans;  Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).

18.              Can you prevent your class from being inherited by another class?
Ans;  Yes.  The keyword “sealed” will prevent the class from being inherited. 

19.              Can you allow a class to be inherited, but prevent the method from being over-ridden?
Ans;  Yes.  Just leave the class public and make the method sealed.
 
20.             What’s an abstract class?
Ans;  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.
 
21.              When do you absolutely have to declare a class as abstract?
Ans; 
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.
 
22.             What is an interface class?
Ans;  Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes.
 
23.             Why can’t you specify the accessibility modifier for methods inside the interface?
Ans;  They all must be public, and are therefore public by default.
 
24.             Can you inherit multiple interfaces?
Ans;  Yes.  .NET does support multiple interfaces.
 
25.             What happens if you inherit multiple interfaces and they have conflicting method names?
Ans;  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.
 
26.             What’s the difference between an interface and abstract class?
Ans;  In an interface class, all methods are abstract - there is no implementation.  In an abstract class some methods can be concrete.  In an interface class, no accessibility modifiers are allowed.  An abstract class may have accessibility modifiers.
 
27.             What is the difference between a Struct and a Class?
Ans; 
Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval.  Another difference is that structs cannot inherit.
 
28.             What’s the implicit name of the parameter that gets passed into the set method/property of a class?
Ans;  Value.  The data type of the value parameter is defined by whatever data type the property is declared as.
 
29.             What does the keyword “virtual” declare for a method or property?
Ans;  The method or property can be overridden.
 
30.             How is method overriding different from method overloading?
Ans;  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.
 
31.              Can you declare an override method to be static if the original method is not static?
Ans;  No.  The signature of the virtual method must remain the same.  (Note: Only the keyword virtual is changed to keyword override)
 
32.             What are the different ways a method can be overloaded?
Ans;  Different parameter data types, different number of parameters, different order of parameters.
 
33.             If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?
Ans;  Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.
 
34.             What’s a delegate?
Ans;  A delegate object encapsulates a reference to a method.
 
35.             What’s a multicast delegate?
Ans;  A delegate that has multiple handlers assigned to it.  Each assigned handler (method) is called.
 
36.             Is XML case-sensitive?
Ans;  Yes.
 
37.             What’s the difference between // comments, /* */ comments and /// comments?
Ans;  Single-line comments, multi-line comments, and XML documentation comments.
 
38.             How do you generate documentation from the C# file commented properly with a command-line compiler?
Ans;  Compile it with the /doc switch.
 
39.             What debugging tools come with the .NET SDK?
Ans; 
1.   CorDBG – command-line debugger.  To use CorDbg, you must compile the original C# file using the /debug switch.
           2.   DbgCLR – graphic debugger.  Visual Studio .NET uses the DbgCLR.
 
40.             What does assert() method do?
Ans;  In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false.  The program proceeds without any interruption if the condition is true.
 
41.              What’s the difference between the Debug class and Trace class?
Ans;  Documentation looks the same.  Use Debug class for debug builds, use Trace class for both debug and release builds.
 
42.             Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
Ans;  The tracing dumps can be quite verbose.  For applications that are constantly running you run the risk of overloading the machine and the hard drive.  Five levels range from None to Verbose, allowing you to fine-tune the tracing activities.
 
43.             Where is the output of TextWriterTraceListener redirected?
Ans; 
To the Console or a text file depending on the parameter passed to the constructor.
 
44.             How do you debug an ASP.NET Web application?
Ans; 
Attach the aspnet_wp.exe process to the DbgClr debugger.
 
45.             What are three test cases you should go through in unit testing?
Ans;  1.       Positive test cases (correct data, correct output).
           2.       Negative test cases (broken or missing data, proper handling).
           3.       Exception test cases (exceptions are thrown and caught properly).
 
46.             Can you change the value of a variable while debugging a C# application?
Ans;  Yes.  If you are debugging via Visual Studio.NET, just go to Immediate window.
   
47.             What is the wildcard character in SQL?
Ans;  Let’s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‘La%’.
 
48.             Explain ACID rule of thumb for transactions.
Ans;  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.
 
49.             What connections does Microsoft SQL Server support?
Ans;  Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and password).
 
50.             Between Windows Authentication and SQL Server Authentication, which one is trusted and which one is untrusted?
Ans; 
Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.
 
51.              What does the Initial Catalog parameter define in the connection string?
Ans; 
The database name to connect to.
  
52.             What does the Dispose method do with the connection object?
Ans;  Deletes it from the memory.
To Do: answer better.  The current answer is not entirely correct.
 
53.             What is a pre-requisite for connection pooling?
Ans; 
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.
 
54.             How is the DLL Hell problem solved in .NET?
Ans;  Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly.
 
55.             What are the ways to deploy an assembly?
Ans;  An MSI installer, a CAB archive, and XCOPY command.
 
56.             What is a satellite assembly?
Ans; 
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.
 
57.             What namespaces are necessary to create a localized application?  
Ans;  System.Globalization and System.Resources.
 
58.             What is the smallest unit of execution in .NET?     
Ans;  an Assembly.
 
59.             When should you call the garbage collector in .NET?
Ans; 
As a good rule, you should not call the garbage collector.  However, you could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory.  However, this is usually not a good practice.
 
60.             How do you convert a value-type to a reference-type? 
Ans;  Use Boxing.
 
61.              What happens in memory when you Box and Unbox a value-type?
Ans; 
Boxing converts a value-type to a reference-type, thus storing the object on the heap.  Unboxing converts a reference-type to a value-type, thus storing the value on the stack.

62.            What is Serialization?
Ans;  Serialization is the process of converting an object or a connected graph of objects into a contiguous stream of bytes. Deserialization is the process of converting a contiguous stream of bytes back into its graph of connected objects. The ability to convert objects to and from a byte stream is an incredibly useful mechanism. Here are some examples:
• An application's state (object graph) can easily be saved in a disk file or database and then restored the next time the application is run. ASP.NET saves and restores session state by way of serialization and deserialization.
• A set of objects can easily be copied to the system's clipboard and then pasted into the same or another application. In fact, Windows® Forms uses this procedure.
• A set of objects can be cloned and set aside as a backup while a user manipulates the main set of objects.
• A set of objects can easily be sent over the network to a process running on another machine. The Microsoft® .NET Framework remoting architecture serializes and deserializes objects that are marshaled by value.
Why would you want to use serialization? The two most important reasons are
• to persist the state of an object to a storage medium so an exact copy can be recreated at a later stage, and
• to send the object by value from one application domain to another.


Friday 22 April 2011

ASP.Net Interview Q & A




1. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
Ans:  inetinfo.exe is the Microsoft IIS server running, handling ASP.NET requests among other things. When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tithe actual worker process aspnet_wp.exe.
 
2. What’s the difference between Response.Write() andResponse.Output.Write()?
Ans: 
Response.Output.Write() allows you to write formatted output.
 
3. What methods are fired during the page load?
Ans: 
Init() - when the page is instantiated
Load() - when the page is loaded into server memory
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading.
 
4. When during the page processing cycle is View State available?
Ans:  After the Init() and before the Page_Load(), or OnLoad() for a control.
 
5. What namespace does the Web page belong in the .NET Framework class hierarchy?
Ans: 
System.Web.UI.Page
 
6. Where do you store the information about the user’s locale?
Ans: 
System.Web.UI.Page.Culture
 
7. What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
Ans: 
CodeBehind is relevant to Visual Studio.NET only.
 
8. What’s a bubbled event?
Ans: 
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.
 
9. Suppose you want a certain ASP.NET function executed on MouseOver for a certain button.  Where do you add an event handler?
Ans: 
Add an OnMouseOver attribute to the button.  Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");
 
10. What data types do the RangeValidator control support?
Ans:
    Integer, String, and Date.
 
11. Explain the differences between Server-side and Client-side code?
Ans: 
Server-side code executes on the server.  Client-side code executes in the client's browser.
 
12. What type of code (server or client) is found in a Code-Behind class?
Ans: 
The answer is server-side code since code-behind is executed on the server.  However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser.  But just to be clear, code-behind executes on the server, thus making it server-side code.
 
13. Should user input data validation occur server-side or client-side?  Why?
Ans: 
All user input data validation should occur on the server at a minimum.  Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.
 
14. What is the difference between Server.Transfer and Response.Redirect?  Why would I choose one over the other?
Ans: 
Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser.  This provides a faster response with a little less overhead on the server.  Server.Transfer does not update the clients url history list or current url.  Response.Redirect is used to redirect the user's browser to another page or site.  This perform as a trip back to the client where the client's browser is redirected to the new page.  The user's browser history list is updated to reflect the new address.
 
15. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Ans: 
Valid answers are:
1.  A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
2.  A DataSet is designed to work without any continuing connection to the original data source.
3.  Data in a DataSet is bulk-loaded, rather than being loaded on demand.
4. There's no concept of cursor types in a DataSet.
5.  DataSets have no current record pointer You can use For Each loops to move through the data.
6.  You can store many edits in a DataSet, and write them to the original data source in a single operation.
7. Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
 
16. What is the Global.asax used for?
Ans:    The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.  
17. What are the Application_Start and Session_Start subroutines used for?
Ans: 
This is where you can set the specific variables for the Application and Session objects. 
18. Can you explain what inheritance is and an example of when you might use it?
Ans: 
When you want to inherit (use the functionality of) another class.  Example: With a base class named Employee, a Manager class could be derived from the Employee base class. 
19. What’s an assembly?
Ans: 
Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN 
20. Describe the difference between inline and code behind.
Ans: 
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page. 
21. Explain what a diffgram is, and a good use for one?
Ans: 
The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML.  A good use is reading database data to an XML file to be sent to a Web Service. 
22. What’s MSIL, and why should my developers need an appreciation of it if at all?
Ans: 
MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL.  MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer. 
23. Which method do you invoke on the DataAdapter control to load your generated dataset with data?
Ans: 
The Fill() method. 
24. Can you edit data in the Repeater control?
Ans: 
No, it just reads the information from its data source. 
25. Which template must you provide, in order to display data in a Repeater control?
Ans: 
ItemTemplate. 
26. How can you provide an alternating color scheme in a Repeater control?
Ans: 
Use the AlternatingItemTemplate. 
27. What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?
Ans:
    You must set the DataSource property and call the DataBind method. 
28. What base class do all Web Forms inherit from?
Ans: 
The Page class.
 
29. Name two properties common in every validation control?
Ans: 
ControlToValidate property and Text property. 
30. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box?
Ans: 
DataTextField property.  
31. Which control would you use if you needed to make sure the values in two different controls matched?
Ans: 
CompareValidator control.  
32. How many classes can a single .NET DLL contain?
Ans: 
It can contain many classes. 
33. What is the transport protocol you use to call a Web service?
Ans: 
SOAP (Simple Object Access Protocol) is the preferred protocol.  
34. True or False: A Web service can only be written in .NET?
Ans: 
False  
35. What does WSDL stand for?
Ans: 
Web Services Description Language. 
36. Where on the Internet would you look for Web services?
Ans: 
http://www.uddi.org 
37. True or False: To test a Web service you must create a Windows application or Web application to consume this service?
Ans: 
False, the web service comes with a test page and it provides HTTP-GET method to test
38. What is ViewState?
Ans: 
ViewState allows the state of objects (serializable) to be stored in a hidden field on the page.  ViewState is transported to the client and back to the server, and is not stored on the server or any other external source.  ViewState is used the retain the state of server-side objects between postabacks.  
39. What is the lifespan for items stored in ViewState?
Ans: 
Item stored in ViewState exist for the life of the current page.  This includes postbacks (to the same page).
 
40. What does the "EnableViewState" property do?  Why would I want it on or off?
Ans: 
It allows the page to save the users input on a form across postbacks.  It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser.  When the page is posted back to the server the server control is recreated with the state stored in viewstate.
 
41. What are the different types of Session state management options available with ASP.NET?
Ans: 
ASP.NET provides In-Process and Out-of-Process state management.  In-Process stores the session in memory on the web server.  This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server.  Out-of-Process Session state management stores data in an external data source.  The external data source may be either a SQL Server or a State Server service.  Out-of-Process state management requires that all objects stored in session are serializable.
42. Which controls do not have events?
Ans:
    Timer control.

43. What is the maximum size of the textbox?
Ans: 
65536.

44. Which property of the textbox cannot be changed at runtime?
Ans: 
Locked Property.
45. Which control cannot be placed in MDI?
Ans: 
The controls that do not have events.

46. Difference between a sub and a function.
Ans:-
  A Sub Procedure is a method will not return a value
-A sub procedure will be defined with a “Sub” keyword
Sub ShowName(ByVal myName As String)
Console.WriteLine(”My name is: ” & myName)
End Sub

-A function is a method that will return value(s).
-A function will be defined with a “Function” keyword
Function FindSum(ByVal num1 As Integer, ByVal num2 As Integer) As Integer
Dim sum As Integer = num1 + num2
Return sum
End Function

47. Explain manifest & metadata.
Ans: 
Manifest is metadata about assemblies. Metadata is machine-readable information about a resource, or “”data about data.” In .NET, metadata includes type definitions, version information, external assembly references, and other standardized information.

48. Difference between imperative and interrogative code
Ans.
  There are imperative and interrogative functions and I think they are talking about that. Imperative functions are the one which return a value while the interrogative functions do not return a value.

49. What are the two kinds of properties
Ans.
  Two types of properties in .Net: Get & Set
Two kind of properties are scalar properties and indexed properties

50. Explain constructor
Ans: 
Constructor is a method in the class which has the same name as the class (in VB.Net its New()). It initializes the member attributes whenever an instance of the class is created.

51. Describe ways of cleaning up objects
Ans.
  The run time will maintain a service called as garbage collector. This service will take care of deallocating memory corresponding to objects, it works as a thread with least priority. When application demands for memory the runtime will take care of setting the high priority for the garbage collector, so that it will be called for execution and memory will be release. The programmer can make a call to garbage collector by using GC class in system name space.

52. What are value types and reference types?
Ans.
  Value type - bool, byte, chat, decimal, double, enum , float, int, long, sbyte, short, strut, uint, ulong, ushort
Value types are stored in the Stack
Reference type - class, delegate, interface, object, string
Reference types are stored in the Heap

53. How can you clean up objects holding resources from within the  code?
Ans: 
Call the dispose method from code for clean up of objects

54. Explain the life cycle of an ASP .NET page.
Ans: 
Life cycle of ASP.Net Web Form
Page Request >> Start >> Page Init >> Page Load >> Validation >> PostBack Event Handling >> Page Rendering >> Page Unload
Page Request - When the page is requested ASP.Net determines whether the page is to be parsed and compiled or a cached verion of the page is to be sent without running the page.
Start - Page propertied REQUEST and RESPONSE are SET, if the page is pastback request then the IsPostBack property is SET and in addition to this UICulture property is also SET.
Page Initilization - In this the UniqueID of each property is SET.  If the request was postback the data is not yet loaded from the viewstate.
Page Load - If it was a postback request then the data gets loaded in the control from the ViewState and control property are set.
Validation - If any control validation present, they are performed and IsValid property is SET for each control.
PostBack Event Handling - If it was a postback request then any event handlers are called.
Page Rendering - Before this the viewstate is saved from the page and RENDER method of each page is called.
Page Unload - Page is fully rendered and sent to the client(Browser) and is discarded. Page property RESPONSE and REQUEST are unloaded.

55. What is .Net architecture?
Ans: 
The order starting from the bottom
1. CLR (Common Language Runtime)
2. .Net framework base class
3. ASP.Net Web Form / Windows Form
56.  What are object-oriented concepts?
Ans.
Object Oriented concept includes the following:
1. Inheritance
2. Abstraction
3. Polymorphism
4. Encapsulation
57.  How do you create multiple inheritance in c# and .NET?
Ans.
  Use interfaces
public class MyTest: IPaidInterface, ISoldInterface

58.  When is web.config called?
Ans.
   Web.config is an xml configuration file. It is never directly called
unless we need to retrieve a configurations setting.

59.  How many weg.configs can an application have?
Ans.
   One.

60.  How do you set language in weg.config?
Ans.
   defaultLanguage=”vb”: This specifies the default code language.
debug=”true”: This specifies that the application should be run in debug
mode

61.  What does connection string consist of?
Ans.
    Server, user id, password, database name.

62.  Where do you store connection string?
Ans.
    Web.config
63.  What is abstract class?
Ans.
   An abstract class is a class that cannot be instantiated. Its purpose is
to act as a base class from which other classes may be derived.

64.  What is difference between interface inheritance and class inheritance?
Ans.
    We can only inherit from one class but multiple interfaces. In addition, an interface does not contain any implementation it just contains a series of signatures.

65.  What are the collection classes?
Ans.
   Queue, Stack, BitArray, HashTable, LinkedList, ArrayList, Name
ValueCollection, Array, SortedList , HybridDictionary, ListDictionary, StringCollection, StringDictionary

66. What are the types of threading models?
Ans.
   Single Threading: This is the simplest and most common threading model where a single thread corresponds to your entire application’s process.

Apartment Threading (STA): This allows multiple threads to exist in a single application. In single threading apartment (STA), each thread is isolated in its own apartment. The process may contain multiple threads (apartments) however when an object is created in a thread (i.e. apartment) it stays within that apartment. If any communication needs to occur between different threads (i.e. different apartments) then we must marshal the first thread object to the second thread. Free Threading: The most complex threading model. Unlike STA, threads are not confined to their own apartments. Multiple treads can make calls to the same methods and same components at the same time.

67. What inheritance does VB.NET support?
Ans.
   Single inheritance using classes or multiple inheritance using interfaces.

68.  What is a runtime host?
Ans.
   The runtime host is the environment in which the CLR is started and managed.

69.  Describe the techniques for optimizing your application?
Ans:
   The techniques for optimizing the application are:
1.  Avoid round-trips to server. Perform validation on client.
2. Save viewstate only when necessary.
3. Employ caching.
4. Leave buffering on unless there is a dire need to disable it.
5. Use connection pooling.
6.  Use stored procedures instead of in-line SQL or dynamic SQL.

70.  Differences between application and session
Ans.
   The session object maintains state on a per client basis whereas the application object is on a per application basis and is consistent across all client requests.

71.  What is web application virtual directory?
Ans.
   A virtual directory appears to client browsers as though it were contained in a Web server’s root directory, even though it can physically Reside somewhere else.

72.  What is isPostback property?
Ans:
    This property is used to check whether the page is being loaded and accessed for the first time or whether the page is added in response to the client postback.
Example:-
Consider two combo boxes
In one lets have a list of countries
In the other, the states.
Upon selection of the first, the subsequent one should be populated in
accordance. So this requires postback property in combo boxes to be true.

73.  Where do you store connection string?
Ans.
   Database connection string can be stored in the web config file. The connection string can be stored in the web.config file under element

74.  What does connection string consist of?
Ans.
   The connection string consists of the following parts:
In general:
Server: Whether local or remote.
Uid: User Id (sa-in sql server)
Password: The required password to be filled-in here
Database: The database name.

75.  What are the collection classes?
Ans.
   The .NET Framework provides specialized classes for data storage and retrieval.  These classes provide support for stacks, queues, lists, and hash tables.

76.  What is isPostback property?
Ans.
   This property is used to check whether the page is being loaded and accessed for the first time or whether the page is loaded in response to the client postback.
Example:
Consider two combo boxes. In one let’s have a list of countries. In the other, the states. Upon selection of the first, the subsequent one should be populated in accordance. So this requires postback property in combo boxes to be true.

77.  What are Abstract base classes?
Ans.
    Abstract Class is nothing but a true virtual class. This class cannot be instantiated instead it has to be inherited.
The method in abstract class are virtual and hence they can be overridden in the child class.

78. What is difference between interface inheritance and class inheritance?
Ans.
   Interface inheritance: -
1. The accessibility modifier in Interface is public by default.
2. All the methods defined in the interface class should be overridden in the child class.
Class Inheritance -
1. There is not restriction on the accessibility modifier in a class.
2. Only the method that are defined virtual should be overridden.

79.  ASP.NET OBJECTS?
Ans.
    Application,Request,Responce,server and session

80.  How do you get the value of a combo box in Javascript?
Ans.
   document.form_name.element_name.value

81.  Why do we use Option Explicit?
Ans::
Correct answer is - This statement force the declaration of variables in VB before using them.

82.  How do you create a recordset object in VBScript?
Ans.
//First of all declare a variable to hold the Recordset object,
ex-Dim objRs
//Now, Create this variable as a Recordset object, ex-
Set objRs=Server.CreateObject(ADODB.RECORDSET)

83.  What is a class in CSS?
Ans.
   A class allows you to define different style characteristics to the same HTML element, class is a child to the id, id should be used only once, a css class can be used multiple times:
div id=”banner”
p class=”alert”

84.  When inserting strings into a SQL table in ASP what is the risk and how can you prevent it?
Ans.
    SQL Injection, to prevent you probably need to use Stored Procedures  instead of inline/incode SQL

85. What is boxing? what is unboxing? what is deep copy & shallow copy?
Ans.
    Converting the value type into reverence type is call boxing.  When an object of value type is assigned with another, the data itself is copied from one object to another. Suppose there are two integer variables, count1 and count2. Further suppose that count1 contains the value 5 and that count2 is assigned the value of count1.
count1 = 5;
count2 = count1;
Both count1 and count2 now contain their own copies of the data, in this case, the value 5. They are independent. If count1 is now assigned the value 6, count2 will still contain the value 5. This type of copy is referred to as a deep copy. The value itself is copied.
If count1 is now assigned the value 6, count2 will still contain the value 5. This type of copy is referred to as a deep copy.
For reference types copies work differently. Remember that a reference type consists of two parts: the data on the heap and the address of the data stored in the reference variable itself on the stack. When one reference variable is assigned to another, the address stored in the first is copied to the second. They both then refer to the same data content on the heap. This is referred to as a shallow copy.

86.  What will be output for the given code?
Dim I as integer = 5
Do
I = I + 2
Response.Write (I & \” \”)
Loop Until I > 10
Ans.   o/p: It generates error because of \” \”. (VB.NET)