J2EE Interview Questions

1. What is J2EE?
J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces (APIs), and protocols that provide the functionality for developing multitiered, web-based applications.

2. What is the J2EE module?
A J2EE module consists of one or more J2EE components for the same container type and one component deployment descriptor of that type. 

3. What are the components of J2EE application?
A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components. The J2EE specification defines the following J2EE components:
Application clients and applets are client components.
Java Servlet and JavaServer PagesTM (JSPTM) technology components are web components.
Enterprise JavaBeansTM (EJBTM) components (enterprise beans) are business components.
Resource adapter components provided by EIS and tool vendors.
4. What are the four types of J2EE modules?

1. Application client module
2. Web module
3. Enterprise JavaBeans module
4. Resource adapter module
5. What does application client module contain?
The application client module contains:
--Class files,
--An application client deployment descriptoor.
Application client modules are packaged as JAR files with a .jar extension. 

6. What does web module contain?
The web module contains:
--JSP files,
--class files for servlets,
--GIF and HTML files, and
--a Web deployment descriptor. Web modules are packaged as JAR files with a .war (Web ARchive) extension. 

7. What are the differences between Ear, Jar and War files? Under what circumstances should we use each one?
There are no structural differences between the files; they are all archived using zip-jar compression. However, they are intended for different purposes.
--Jar files (files with a .jar extension) arre intended to hold generic libraries of Java classes, resources, auxiliary files, etc.
--War files (files with a .war extension) arre intended to contain complete Web applications. In this context, a Web application is defined as a single group of files, classes, resources, .jar files that can be packaged and accessed as one servlet context.
--Ear files (files with a .ear extension) arre intended to contain complete enterprise applications. In this context, an enterprise application is defined as a collection of .jar files, resources, classes, and multiple Web applications.
Each type of file (.jar, .war, .ear) is processed uniquely by application servers, servlet containers, EJB containers, etc.

8. What is the difference between Session bean and Entity bean? one?
The Session bean and Entity bean are two main parts of EJB container.
Session Bean
--represents a workflow on behalf of a cliennt
--one-to-one logical mapping to a client. –created and destroyed by a client
--not permanent objects
--lives its EJB container(generally) does noot survive system shut down
--two types: stateless and stateful beans Entity Bean
--represents persistent data and behavior off this data
--can be shared among multiple clients
--persists across multiple invocations
--findable permanent objects
--outlives its EJB container, survives systeem shutdown
--two types: container managed persistence(CCMP) and bean managed persistence(BMP) 

9. What is "applet"
A J2EE component that typically executes in a Web browser but can execute in a variety of other applications or devices that support the applet programming model. 

10. What is "applet container"
A container that includes support for the applet programming model. 

11. What is JSP tag library
A collection of custom tags described via a tag library descriptor and Java classes.

12. What is JSTL
Abbreviate of JavaServer Pages Standard Tag Library. 
13. What is JTA
Abbreviate of Java Transaction API. 

14. What is JTS
Abbreviate of Java Transaction Service. 

15. What is keystore
A file containing the keys and certificates used for authentication 

16. What is life cycle (J2EE component)
The framework events of a J2EE component's existence. Each type of component has defining events that mark its transition into states in which it has varying availability for use. For example, a servlet is created and has its init method called by its container before invocation of its service method by clients or other servlets that require its functionality. After the call of its init method, it has the data and readiness for its intended use. The servlet's destroy method is called by its container before the ending of its existence so that processing associated with winding up can be done and resources can be released. The init and destroy methods in this example are callback methods. Similar considerations apply to the life cycle of all J2EE component types: enterprise beans, Web components (servlets or JSP pages), applets, and application clients. 

17. What is life cycle (JavaServer Faces)
A set of phases during which a request for a page is received, a UI component tree representing the page is processed, and a response is produced. During the phases of the life cycle: The local data of the components is updated with the values contained in the request parameters. Events generated by the components are processed. Validators and converters registered on the components are processed. The components' local data is updated to back-end objects. The response is rendered to the client while the component state of The response is saved on the server for future requests. 

18. What is local subset
That part of the DTD that is defined within the current XML file. 

19. What is managed bean creation facility
A mechanism for defining the characteristics of JavaBeans components used in a JavaServer Faces application. 

20. What is message ?
In the Java Message Service, an asynchronous request, report, or event that is created, sent, and consumed by an enterprise application and not by a human. It contains vital information needed to coordinate enterprise applications, in the form of precisely formatted data that describes specific business actions.

21. What is authorization?
The process by which access to a method or resource is determined. Authorization depends on the determination of whether the principal associated with a request through authentication is in a given security role. A security role is a logical grouping of users defined by the person who assembles the application. A deployer maps security roles to security identities. Security identities may be principals or groups in the operational environment.

22. What is authorization constraint
An authorization rule that determines who is permitted to access a Web resource collection.

23. What is B2B
B2B stands for Business-to-business.

24. What is backing bean
A JavaBeans component that corresponds to a JSP page that includes JavaServer Faces components. The backing bean defines properties for the components on the page and methods that perform processing for the component. This processing includes event handling, validation, and processing associated with navigation.

25. What is basic authentication
An authentication mechanism in which a Web server authenticates an entity via a user name and password obtained using the Web application's built-in authentication mechanism.

26. What is bean-managed persistence
The mechanism whereby data transfer between an entity bean's variables and a resource manager is managed by the entity bean.

27. What is bean-managed transaction
A transaction whose boundaries are defined by an enterprise bean.

28. What is binding (XML)
Generating the code needed to process a well-defined portion of XML data.

29. What is binding (JavaServer Faces technology)
Wiring UI components to back-end data sources such as backing bean properties.

30. What is build file
The XML file that contains one or more asant targets. A target is a set of tasks you want to be executed. When starting asant, you can select which targets you want to have executed. When no target is given, the project's default target is executed.

31. What is business logic
The code that implements the functionality of an application. In the Enterprise JavaBeans architecture, this logic is implemented by the methods of an enterprise bean.

32.What is business method
A method of an enterprise bean that implements the business logic or rules of an application.

33. What is callback methods
Component methods called by the container to notify the component of important events in its life cycle.

34. What is caller
Same as caller principal.

35. What is caller principal
The principal that identifies the invoker of the enterprise bean method.

36. What is cascade delete
A deletion that triggers another deletion. A cascade delete can be specified for an entity bean that has container-managed persistence.

37. What is CDATA
A predefined XML tag for character data that means "don't interpret these characters," as opposed to parsed character data (PCDATA), in which the normal rules of XML syntax apply. CDATA sections are typically used to show examples of XML syntax.

38. What is certificate authority
A trusted organization that issues public key certificates and provides identification to the bearer.

39. What is client-certificate authentication
An authentication mechanism that uses HTTP over SSL, in which the server and, optionally, the client authenticate each other with a public key certificate that conforms to a standard that is defined by X.509 Public Key Infrastructure.

40. What is comment
In an XML document, text that is ignored unless the parser is specifically told to recognize it.

41. What is commit
The point in a transaction when all updates to any resources involved in the transaction are made permanent.

42. What is component contract
The contract between a J2EE component and its container. The contract includes life-cycle management of the component, a context interface that the instance uses to obtain various information and services from its container, and a list of services that every container must provide for its components.

43. What is component-managed sign-on
A mechanism whereby security information needed for signing on to a resource is provided by an application component.

44. What is connector
A standard extension mechanism for containers that provides connectivity to enterprise information systems. A connector is specific to an enterprise information system and consists of a resource adapter and application development tools for enterprise information system connectivity. The resource adapter is plugged in to a container through its support for system-level contracts defined in the Connector architecture.

45. What is Connector architecture
An architecture for integration of J2EE products with enterprise information systems. There are two parts to this architecture: a resource adapter provided by an enterprise information system vendor and the J2EE product that allows this resource adapter to plug in. This architecture defines a set of contracts that a resource adapter must support to plug in to a J2EE product-for example, transactions, security, and resource management.

46. What is container
An entity that provides life-cycle management, security, deployment, and runtime services to J2EE components. Each type of container (EJB, Web, JSP, servlet, applet, and application client) also provides component-specific services.

47. What is container-managed persistence
The mechanism whereby data transfer between an entity bean's variables and a resource manager is managed by the entity bean's container.

48. What is container-managed sign-on
The mechanism whereby security information needed for signing on to a resource is supplied by the container.

49. What is container-managed transaction
A transaction whose boundaries are defined by an EJB container. An entity bean must use container-managed transactions.

50. What is content
In an XML document, the part that occurs after the prolog, including the root element and everything it contains.

51. What is context attribute
An object bound into the context associated with a servlet.

52. What is context root
A name that gets mapped to the document root of a Web application.

53. What is conversational state
The field values of a session bean plus the transitive closure of the objects reachable from the bean's fields. The transitive closure of a bean is defined in terms of the serialization protocol for the Java programming language, that is, the fields that would be stored by serializing the bean instance.

54. What is CORBA
Common Object Request Broker Architecture. A language-independent distributed object model specified by the OMG.

55. What is create method
A method defined in the home interface and invoked by a client to create an enterprise bean.

56. What is credentials
The information describing the security attributes of a principal.

57. What is CSS
Cascading style sheet. A stylesheet used with HTML and XML documents to add a style to all elements marked with a particular tag, for the direction of browsers or other presentation mechanisms.

58. What is CTS
Compatibility test suite. A suite of compatibility tests for verifying that a J2EE product complies with the J2EE platform specification.

59. What is data
The contents of an element in an XML stream, generally used when the element does not contain any subelements. When it does, the term content is generally used. When the only text in an XML structure is contained in simple elements and when elements that have subelements have little or no data mixed in, then that structure is often thought of as XML data, as opposed to an XML document.

60. What is DDP
Document-driven programming. The use of XML to define applications.

61. What is declaration
The very first thing in an XML document, which declares it as XML. The minimal declaration is . The declaration is part of the document prolog.

62. What is declarative security
Mechanisms used in an application that are expressed in a declarative syntax in a deployment descriptor.

63. What is delegation
An act whereby one principal authorizes another principal to use its identity or privileges with some restrictions.

64. What is deployer
A person who installs J2EE modules and applications into an operational environment.

65. What is deployment      
The process whereby software is installed into an operational environment.

66. What is deployment descriptor
An XML file provided with each module and J2EE application that describes how they should be deployed. The deployment descriptor directs a deployment tool to deploy a module or application with specific container options and describes specific configuration requirements that a deployer must resolve.

67. What is destination
A JMS administered object that encapsulates the identity of a JMS queue or topic. See point-to-point messaging system, publish/subscribe messaging system.

68. What is digest authentication
An authentication mechanism in which a Web application authenticates itself to a Web server by sending the server a message digest along with its HTTP request message. The digest is computed by employing a one-way hash algorithm to a concatenation of the HTTP request message and the client's password. The digest is typically much smaller than the HTTP request and doesn't contain the password.

69. What is distributed application
An application made up of distinct components running in separate runtime environments, usually on different platforms connected via a network. Typical distributed applications are two-tier (client-server), three-tier (client-middleware-server), and multitier (client-multiple middleware-multiple servers).

67. What is document
In general, an XML structure in which one or more elements contains text intermixed with subelements.

68. What is Document Object Model
An API for accessing and manipulating XML documents as tree structures. DOM provides platform-neutral, language-neutral interfaces that enables programs and scripts to dynamically access and modify content and structure in XML documents.

69. What is document root
The top-level directory of a WAR. The document root is where JSP pages, client-side classes and archives, and static Web resources are stored.

70. What is DTD
Document type definition. An optional part of the XML document prolog, as specified by the XML standard. The DTD specifies constraints on the valid tags and tag sequences that can be in the document. The DTD has a number of shortcomings, however, and this has led to various schema proposals. For example, the DTD entry says that the XML element called username contains parsed character data-that is, text alone, with no other structural elements under it. The DTD includes both the local subset, defined in the current file, and the external subset, which consists of the definitions contained in external DTD files that are referenced in the local subset using a parameter entity.

71. What is durable subscription
In a JMS publish/subscribe messaging system, a subscription that continues to exist whether or not there is a current active subscriber object. If there is no active subscriber, the JMS provider retains the subscription's messages until they are received by the subscription or until they expire.

72. What is EAR file
Enterprise Archive file. A JAR archive that contains a J2EE application.

73. What is ebXML
Electronic Business XML. A group of specifications designed to enable enterprises to conduct business through the exchange of XML-based messages. It is sponsored by OASIS and the United Nations Centre for the Facilitation of Procedures and Practices in Administration, Commerce and Transport (U.N./CEFACT).

74. What is EJB
Enterprise JavaBeans.

75. What is EJB container
A container that implements the EJB component contract of the J2EE architecture. This contract specifies a runtime environment for enterprise beans that includes security, concurrency, life-cycle management, transactions, deployment, naming, and other services. An EJB container is provided by an EJB or J2EE server.

76. What is EJB container provider
A vendor that supplies an EJB container.

77. What is EJB context
A vendor that supplies an EJB container. An object that allows an enterprise bean to invoke services provided by the container and to obtain the information about the caller of a client-invoked method.

78. What is EJB home object
An object that provides the life-cycle operations (create, remove, find) for an enterprise bean. The class for the EJB home object is generated by the container's deployment tools. The EJB home object implements the enterprise bean's home interface. The client references an EJB home object to perform life-cycle operations on an EJB object. The client uses JNDI to locate an EJB home object

79. What is EJB JAR file
A JAR archive that contains an EJB module.

80. What is EJB module
A deployable unit that consists of one or more enterprise beans and an EJB deployment descriptor.

81. What is EJB object
An object whose class implements the enterprise bean's remote interface. A client never references an enterprise bean instance directly; a client always references an EJB object. The class of an EJB object is generated by a container's deployment tools.

82. What is EJB server
Software that provides services to an EJB container. For example, an EJB container typically relies on a transaction manager that is part of the EJB server to perform the two-phase commit across all the participating resource managers. The J2EE architecture assumes that an EJB container is hosted by an EJB server from the same vendor, so it does not specify the contract between these two entities. An EJB server can host one or more EJB containers.

83. What is EJB server provider
A vendor that supplies an EJB server.

83. What is EJB server provider What is element
A unit of XML data, delimited by tags. An XML element can enclose other elements.

84. What is empty tag
A tag that does not enclose any content

85. What is enterprise bean
A J2EE component that implements a business task or business entity and is hosted by an EJB container; either an entity bean, a session bean, or a message-driven bean.

86. What is enterprise bean provider
An application developer who produces enterprise bean classes, remote and home interfaces, and deployment descriptor files, and packages them in an EJB JAR file.
87. What is enterprise information system
The applications that constitute an enterprise's existing system for handling companywide information. These applications provide an information infrastructure for an enterprise. An enterprise information system offers a well-defined set of services to its clients. These services are exposed to clients as local or remote interfaces or both. Examples of enterprise information systems include enterprise resource planning systems, mainframe transaction processing systems, and legacy database systems.

91. What is an entity
A distinct, individual item that can be included in an XML document by referencing it. Such an entity reference can name an entity as small as a character (for example, <, which references the less-than symbol or left angle bracket, <). An entity reference can also reference an entire document, an external entity, or a collection of DTD definitions.
92. What is entity bean An enterprise bean that represents persistent data maintained in a database.
 An entity bean can manage its own persistence or can delegate this function to its container. An entity bean is identified by a primary key. If the container in which an entity bean is hosted crashes, the entity bean, its primary key, and any remote references survive the crash.

AVG 2011 INSTALLATION GUIDE

ASP.NET Interview Questions

·  Explain Namespace.
Namespaces are logical groupings of names used within a program. There may be multiple namespaces in a single application code, grouped based on the identifiers’ use. The name of any given identifier must appear only once in its namespace.
·  List the types of Authentication supported by ASP.NET.
  • Windows (default)
  • Forms
  • Passport
  • None (Security disabled)
·  What is CLR?
Common Language Runtime (CLR) is a run-time environment that manages the execution of .NET code and provides services like memory management, debugging, security, etc. The CLR is also known as Virtual Execution System (VES).
·  What is CLI?
The CLI is a set of specifications for a runtime environment, including a common type system, base class library, and a machine-independent intermediate code known as the Common Intermediate Language (CIL). (Source: Wikipedia.)
·  List the various stages of Page-Load lifecycle.
  • Init()
  • Load()
  • PreRender()
  • Unload()
·  Explain Assembly and Manifest.
An assembly is a collection of one or more files and one of them (DLL or EXE) contains a special metadata called Assembly Manifest. The manifest is stored as binary data and contains details like versioning requirements for the assembly, the author, security permissions, and list of files forming the assembly. An assembly is created whenever a DLL is built. The manifest can be viewed programmatically by making use of classes from the System.Reflection namespace. The tool Intermediate Language Disassembler (ILDASM) can be used for this purpose. It can be launched from the command prompt or via Start> Run.
·  What is Shadow Copy?
In order to replace a COM component on a live dedicated server, it was necessary to stop the entire website, copy the new files and then restart the website. This is not feasible for the web servers that need to be always running. .NET components are different. They can be overwritten at any time using a mechanism called Shadow Copy. It prevents the Portable Executable (PE) files like DLLs and EXEs from being locked. Whenever new versions of the PEs are released, they are automatically detected by the CLR and the changed components will be automatically loaded. They will be used to process all new requests not currently executing, while the older version still runs the currently executing requests. By bleeding out the older version, the update is completed.
·  What is DLL Hell?
DLL hell is the problem that occurs when an installation of a newer application might break or hinder other applications as newer DLLs are copied into the system and the older applications do not support or are not compatible with them. .NET overcomes this problem by supporting multiple versions of an assembly at any given time. This is also called side-by-side component versioning.
·  Explain Web Services.
Web services are programmable business logic components that provide access to functionality through the Internet. Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services are given the .asmx extension.
·  Explain Windows Forms.
Windows Forms is employed for developing Windows GUI applications. It is a class library that gives developers access to Windows Common Controls with rich functionality. It is a common GUI library for all the languages supported by the .NET Framework.
·  What is Postback?
When an action occurs (like button click), the page containing all the controls within the <FORM... > tag performs an HTTP POST, while having itself as the target URL. This is called Postback.
·  Explain the differences between server-side and client-side code?
Server side scripting means that all the script will be executed by the server and interpreted as needed. Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Since the code is included in the HTML page, anyone can see the code by viewing the page source. It also poses as a possible security hazard for the client computer.
·  Enumerate the types of Directives.
  • @ Page directive
  • @ Import directive
  • @ Implements directive
  • @ Register directive
  • @ Assembly directive
  • @ OutputCache directive
  • @ Reference directive
·  What is Code-Behind?
Code-Behind is a concept where the contents of a page are in one file and the server-side code is in another. This allows different people to work on the same page at the same time and also allows either part of the page to be easily redesigned, with no changes required in the other. An Inherits attribute is added to the @ Page directive to specify the location of the Code-Behind file to the ASP.NET page.
·  Describe the difference between inline and code behind.
Inline code is written along side the HTML in a page. There is no separate distinction between design code and logic code. Code-behind is code written in a separate file and referenced by the .aspx page.
·  List the ASP.NET validation controls?
  • RequiredFieldValidator
  • RangeValidator
  • CompareValidator
  • RegularExpressionValidator
  • CustomValidator
  • ValidationSummary
·  What is Data Binding?
Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them.
·  Describe Paging in ASP.NET.
The DataGrid control in ASP.NET enables easy paging of the data. The AllowPaging property of the DataGrid can be set to True to perform paging. ASP.NET automatically performs paging and provides the hyperlinks to the other pages in different styles, based on the property that has been set for PagerStyle.Mode.
·  Should user input data validation occur server-side or client-side? Why?
All user input data validation should occur on the server and minimally on the client-side, though it is a good way to reduce server load and network traffic because we can ensure that only data of the appropriate type is submitted from the form. It is totally insecure. The user can view the code used for validation and create a workaround for it. Secondly, the URL of the page that handles the data is freely visible in the original form page. This will allow unscrupulous users to send data from their own forms to your application. Client-side validation can sometimes be performed where deemed appropriate and feasible to provide a richer, more responsive experience for the user.
·  What is the difference between Server.Transfer and Response.Redirect?
  • Response.Redirect: This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser. This results in two requests by the browser.
  • Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser. Also, any posted form variables and query string parameters are available to the second page as well.
  • What is an interface and what is an abstract class?
In an interface, all methods must be abstract (must not be defined). In an abstract class, some methods can be defined. In an interface, no accessibility modifiers are allowed, whereas it is allowed in abstract classes.
  • Session state vs. View state:
In some cases, using view state is not feasible. The alternative for view state is session state. Session state is employed under the following situations:
    • Large amounts of data - View state tends to increase the size of both the HTML page sent to the browser and the size of form posted back. Hence session state is used.
    • Secure data - Though the view state data is encoded and may be encrypted, it is better and secure if no sensitive data is sent to the client. Thus, session state is a more secure option.
    • Problems in serializing of objects into view state - View state is efficient for a small set of data. Other types like DataSet are slower and can generate a very large view state.
  • Can two different programming languages be mixed in a single ASPX file?
ASP.NET’s built-in parsers are used to remove code from ASPX files and create temporary files. Each parser understands only one language. Therefore mixing of languages in a single ASPX file is not possible.
  • Is it possible to see the code that ASP.NET generates from an ASPX file?
By enabling debugging using a <%@ Page Debug="true" %> directive in the ASPX file or a <compilation debug="true"> statement in Web.config, the generated code can be viewed. The code is stored in a CS or VB file (usually in the \%SystemRoot%\Microsoft.NET\Framework\v1.0.nnnn\Temporary ASP.NET Files).
  • Can a custom .NET data type be used in a Web form?
This can be achieved by placing the DLL containing the custom data type in the application root's bin directory and ASP.NET will automatically load the DLL when the type is referenced.
  • List the event handlers that can be included in Global.asax?
    • Application start and end event handlers
    • Session start and end event handlers
    • Per-request event handlers
    • Non-deterministic event handlers
  • Can the view state be protected from tampering?
This can be achieved by including an @ Page directive with an EnableViewStateMac="true" attribute in each ASPX file that has to be protected. Another way is to include the <pages enableViewStateMac="true" /> statement in the Web.config file.
  • Can the view state be encrypted?
The view state can be encrypted by setting EnableViewStateMac to true and either modifying the <machineKey> element in Machine.config to <machineKey validation="3DES” /> or by adding the above statement to Web.config.
  • When during the page processing cycle is ViewState available?
The view state is available after the Init() and before the Render() methods are called during Page load.
  • Do Web controls support Cascading Style Sheets?
All Web controls inherit a property named CssClass from the base class System.Web.UI.WebControls.WebControl which can be used to control the properties of the web control.
  • What namespaces are imported by default in ASPX files?
The following namespaces are imported by default. Other namespaces must be imported manually using @ Import directives.
    • System
    • System.Collections
    • System.Collections.Specialized
    • System.Configuration
    • System.Text
    • System.Text.RegularExpressions
    • System.Web
    • System.Web.Caching
    • System.Web.Security
    • System.Web.SessionState
    • System.Web.UI
    • System.Web.UI.HtmlControls
    • System.Web.UI.WebControls
  • What classes are needed to send e-mail from an ASP.NET application?
The classes MailMessage and SmtpMail have to be used to send email from an ASP.NET application. MailMessage and SmtpMail are classes defined in the .NET Framework Class Library's System.Web.Mail namespace.
  • Why do some web service classes derive from System.Web.WebServices while others do not?
Those Web Service classes which employ objects like Application, Session, Context, Server, and User have to derive from System.Web.WebServices. If it does not use these objects, it is not necessary to be derived from it.
  • What are VSDISCO files?
VSDISCO files are DISCO files that enable dynamic discovery of Web Services. ASP.NET links the VSDISCO to a HTTP handler that scans the host directory and subdirectories for ASMX and DISCO files and returns a dynamically generated DISCO document. A client who requests a VSDISCO file gets back what appears to be a static DISCO document.
  • How can files be uploaded to Web pages in ASP.NET?
This can be done by using the HtmlInputFile class to declare an instance of an <input type="file" runat="server"/> tag. Then, a byte[] can be declared to read in the data from the input file. This can then be sent to the server.
  • How do I create an ASPX page that periodically refreshes itself?
The following META tag can be used as a trigger to automatically refresh the page every n seconds:
<meta http-equiv="Refresh" content="nn">
  • How do I initialize a TextBox whose TextMode is "password", with a password?
The TextBox’s Text property cannot be used to assign a value to a password field. Instead, its Value field can be used for that purpose.
<asp:TextBox Value="imbatman" TextMode="Password"
                      ID="Password" RunAt="server" />
  • Why does the control's PostedFile property always show null when using HtmlInputFile control to upload files to a Web server?
This occurs when an enctype="multipart/form-data" attribute is missing in the <form> tag.
  • How can the focus be set to a specific control when a Web form loads?
This can be achieved by using client-side script:
document.forms[0].TextBox1.focus ()
The above code will set the focus to a TextBox named TextBox1 when the page loads.
  • How does System.Web.UI.Page's IsPostBack property work?
IsPostBack checks to see whether the HTTP request is accompanied by postback data containing a __VIEWSTATE or __EVENTTARGET parameter. If there are none, then it is not a postback.
  • What is WSDL?
WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). (Source: www.w3.org)
  • What is UDDI?
UDDI stands for Universal Description, Discovery, and Integration. It is like an "Yellow Pages" for Web Services. It is maintained by Microsoft, IBM, and Ariba, and is designed to provide detailed information regarding registered Web Services for all vendors. The UDDI can be queried for specific Web Services.
  • Is it possible to generate the source code for an ASP.NET Web service from a WSDL?
The Wsdl.exe tool (.NET Framework SDK) can be used to generate source code for an ASP.NET web service with its WSDL link.
Example: wsdl /server http://api.google.com/GoogleSearch.wsdl.
  • Why do uploads fail while using an ASP.NET file upload control to upload large files?
ASP.NET limits the size of file uploads for security purposes. The default size is 4 MB. This can be changed by modifying the maxRequestLength attribute of Machine.config's <httpRuntime> element.
  • Describe the difference between inline and code behind.
Inline code is written along side the HTML in a page. Code-behind is code written in a separate file and referenced by the .aspx page.
·         Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
inetinfo.exe is theMicrosoft 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 tothe actual worker process aspnet_wp.exe.
  • Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Valid answers are:
A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
A DataSet is designed to work without any continuing connection to the original data source.
Data in a DataSet is bulk-loaded, rather than being loaded on demand.
There's no concept of cursor types in a DataSet.
DataSets have no current record pointer You can use For Each loops to move through the data.
You can store many edits in a DataSet, and write them to the original data source in a single operation.
Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.
  • What’s a bubbled event?
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.
  • What data types do the RangeValidator control support?
Integer, String, and Date.
  • Explain what a diffgram is, and a good use for one?
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.
  • What is the transport protocol you use to call a Web service?
SOAP (Simple Object Access Protocol) is the preferred protocol.
  • What is ViewState?
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.
  • What does the "EnableViewState" property do? Why would I want it on or off?
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.
  • What are the different types of Session state management options available with ASP.NET?
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.
  • Differences Between XML and HTML?
Anyone with a fundamental grasp of XML should be able describe some of the main differences outlined in the table below
XML
HTML
           User definable tags
Defined set of tags designed for web display
Content driven
Format driven
End tags required for well formed documents
End tags not required
Quotes required around attributes values
Quotes not required
Slash required in empty tags
Slash not required
  • Give a few examples of types of applications that can benefit from using XML.
There are literally thousands of applications that can benefit from XML technologies. The point of this question is not to have the candidate rattle off a laundry list of projects that they have worked on, but, rather, to allow the candidate to explain the rationale for choosing XML by citing a few real world examples. For instance, one appropriate answer is that XML allows content management systems to store documents independently of their format, which thereby reduces data redundancy. Another answer relates to B2B exchanges or supply chain management systems. In these instances, XML provides a mechanism for multiple companies to exchange data according to an agreed upon set of rules. A third common response involves wireless applications that require WML to render data on hand held devices.
  • What is DOM and how does it relate to XML?
The Document Object Model (DOM) is an interface specification maintained by the W3C DOM Workgroup that defines an application independent mechanism to access, parse, or update XML data. In simple terms it is a hierarchical model that allows developers to manipulate XML documents easily Any developer that has worked extensively with XML should be able to discuss the concept and use of DOM objects freely. Additionally, it is not unreasonable to expect advanced candidates to thoroughly understand its internal workings and be able to explain how DOM differs from an event-based interface like SAX.
  • What is SOAP and how does it relate to XML?
The Simple Object Access Protocol (SOAP) uses XML to define a protocol for the exchange of information in distributed computing environments. SOAP consists of three components: an envelope, a set of encoding rules, and a convention for representing remote procedure calls. Unless experience with SOAP is a direct requirement for the open position, knowing the specifics of the protocol, or how it can be used in conjunction with HTTP, is not as important as identifying it as a natural application of XML.
  • Can you walk us through the steps necessary to parse XML documents?
Superficially, this is a fairly basic question. However, the point is not to determine whether candidates understand the concept of a parser but rather have them walk through the process of parsing XML documents step-by-step. Determining whether a non-validating or validating parser is needed, choosing the appropriate parser, and handling errors are all important aspects to this process that should be included in the candidate's response.
  • What are possible implementations of distributed applications in .NET?
.NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services.
  • What are the consideration in deciding to use .NET Remoting or ASP.NET Web Services?
Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process. Web Services provide an open-protocol-based exchange of informaion. Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.
  • What’s a proxy of the server object in .NET Remoting?
It’s a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling.
  • What are remotable objects in .NET Remoting?
Remotable objects are the objects that can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.
  • What are channels in .NET Remoting?
Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.
  • What security measures exist for .NET Remoting in System.Runtime.Remoting?
None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.
  • What is a formatter?
A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.
  • Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters, what are the trade-offs?
Binary over TCP is the most effiecient, SOAP over HTTP is the most interoperable.
  • What’s SingleCall activation mode used for?
If the server object is instantiated for responding to just one single request, the request should be made in SingleCall mode.
  • What’s Singleton activation mode?
A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.
  • How do you define the lease of the object?
By implementing ILease interface when writing the class code.
  • Can you configure a .NET Remoting object via XML file?
Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config.
  • How can you automatically generate interface for the remotable object in .NET with Microsoft tools?
Use the Soapsuds tool.