Quantcast Job Interview Questions - www.interviewhelper.org: September 2007



Get unlimited interview questions on our new improved website...


 Interview Helper Home | Forum | Submit Link | Online Tickets | Freelance Work | Free Games | Jobs

Saturday, September 29, 2007

J2EE Interview Questions

What is abstract schema

The part of an entity bean's deployment descriptor that defines the bean's persistent fields and relationships.

What is abstract schema name

A logical name that is referenced in EJB QL queries.

What is access control

The methods by which interactions with resources are limited to collections of users or programs for the purpose of enforcing

integrity, confidentiality, or availability constraints.

What is ACID

The acronym for the four properties guaranteed by transactions: atomicity, consistency, isolation, and durability.

What is activation

The process of transferring an enterprise bean from secondary storage to memory. (See passivation.) What is anonymous access

Accessing a resource without authentication.

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.

What is applet container

A container that includes support for the applet programming model.

What is application assembler

A person who combines J2EE components and modules into deployable application units.

What is application client

A first-tier J2EE client component that executes in its own Java virtual machine. Application clients have access to some

J2EE platform APIs.

What is application client container

A container that supports application client components. What is application client module

A software unit that consists of one or more classes and an application client deployment descriptor.

What is application component provider

A vendor that provides the Java classes that implement components' methods, JSP page definitions, and any required deployment

descriptors.

What is application configuration resource file

An XML file used to configure resources for a JavaServer Faces application, to define navigation rules for the application,

and to register converters, validators, listeners, renderers, and components with the application.

What is archiving

The process of saving the state of an object and restoring it.

What is asant

A Java-based build tool that can be extended using Java classes. The configuration files are XML-based, calling out a target

tree where various tasks get executed.

What is attribute

A qualifier on an XML tag that provides additional information.

What is authentication

The process that verifies the identity of a user, device, or other entity in a computer system, usually as a prerequisite to

allowing access to resources in a system. The Java servlet specification requires three types of authentication-basic,

form-based, and mutual-and supports digest authentication.

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.

What is authorization constraint

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

What is B2B

B2B stands for Business-to-business.

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. 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.

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.

What is bean-managed transaction

A transaction whose boundaries are defined by an enterprise bean.

What is binary entity

See unparsed entity.

What is binding (XML)

Generating the code needed to process a well-defined portion of XML data.

What is binding (JavaServer Faces technology)

Wiring UI components to back-end data sources such as backing bean properties.

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.

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.

What is business method

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

What is callback methods

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

What is caller

Same as caller principal.

What is caller principal

The principal that identifies the invoker of the enterprise bean method. 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.

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.

What is certificate authority

A trusted organization that issues public key certificates and provides identification to the bearer.

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.

What is comment

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

What is commit

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

What is component

See what is J2EE component.

What is component (JavaServer Faces technology)

See what is JavaServer Faces UI component.

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.

What is component-managed sign-on

A mechanism whereby security information needed for signing on to a resource is provided by an application component.

What is connection

See what is resource manager connection.

What is connection factory

See what is resource manager connection factory.

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.

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.

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.

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.

What is container-managed sign-on

The mechanism whereby security information needed for signing on to a resource is supplied by the container.

What is container-managed transaction

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

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

What is context attribute

An object bound into the context associated with a servlet.

What is context root

A name that gets mapped to the document root of a Web application.

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.

What is CORBA

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

What is create method

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

What is credentials

The information describing the security attributes of a principal.

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.

What is CTS

Compatibility test suite. A suite of compatibility tests for verifying that a J2EE product complies with the J2EE platform

specification.

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.

What is DDP

Document-driven programming. The use of XML to define applications.

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.

What is declarative security

Mechanisms used in an application that are expressed in a declarative syntax in a deployment descriptor.

What is delegation

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

What is deployer

A person who installs J2EE modules and applications into an operational environment.

What is deployment

The process whereby software is installed into an operational environment.

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.

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.

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.

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).

What is document

In general, an XML structure in which one or more elements contains text intermixed with subelements. See also data.

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.

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.

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.

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.

What is EAR file

Enterprise Archive file. A JAR archive that contains a J2EE application.

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).

What is EJB

Enterprise JavaBeans.

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. What is EJB container provider

A vendor that supplies an EJB container.

What is EJB context

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.

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.

What is EJB JAR file

A JAR archive that contains an EJB module.

What is EJB module

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

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.

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.

What is EJB server provider

A vendor that supplies an EJB server.

What is element

A unit of XML data, delimited by tags. An XML element can enclose other elements.

What is empty tag

A tag that does not enclose any content.

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.

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.

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.

What is enterprise information system resource

An entity that provides enterprise information system-specific functionality to its clients. Examples are a record or set of

records in a database system, a business object in an enterprise resource planning system, and a transaction program in a

transaction processing system.

What is Enterprise JavaBeans (EJB)

A component architecture for the development and deployment of object-oriented, distributed, enterprise-level applications.

Applications written using the Enterprise JavaBeans architecture are scalable, transactional, and secure.

What is Enterprise JavaBeans Query Language (EJB QL)

Defines the queries for the finder and select methods of an entity bean having container-managed persistence. A subset of

SQL92, EJB QL has extensions that allow navigation over the relationships defined in an entity bean's abstract schema.

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.

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.

What is entity reference

A reference to an entity that is substituted for the reference when the XML document is parsed. It can reference a predefined

entity such as < or reference one that is defined in the DTD. In the XML data, the reference could be to an entity that is

defined in the local subset of the DTD or to an external XML file (an external entity). The DTD can also carve out a segment

of DTD specifications and give it a name so that it can be reused (included) at multiple points in the DTD by defining a

parameter entity.

What is error

A SAX parsing error is generally a validation error; in other words, it occurs when an XML document is not valid, although it

can also occur if the declaration specifies an XML version that the parser cannot handle. See also fatal error, warning.

What is Extensible Markup Language

XML.

What is external entity

An entity that exists as an external XML file, which is included in the XML document using an entity reference.

What is external subset

That part of a DTD that is defined by references to external DTD files.

What is fatal error

A fatal error occurs in the SAX parser when a document is not well formed or otherwise cannot be processed. See also error,

warning.

What is filter

An object that can transform the header or content (or both) of a request or response. Filters differ from Web components in

that they usually do not themselves create responses but rather modify or adapt the requests for a resource, and modify or

adapt responses from a resource. A filter should not have any dependencies on a Web resource for which it is acting as a

filter so that it can be composable with more than one type of Web resource.

What is filter chain

A concatenation of XSLT transformations in which the output of one transformation becomes the input of the next.

What is finder method

A method defined in the home interface and invoked by a client to locate an entity bean.

What is form-based authentication

An authentication mechanism in which a Web container provides an application-specific form for logging in. This form of

authentication uses Base64 encoding and can expose user names and passwords unless all connections are over SSL.

What is general entity

An entity that is referenced as part of an XML document's content, as distinct from a parameter entity, which is referenced

in the DTD. A general entity can be a parsed entity or an unparsed entity.

What is group

An authenticated set of users classified by common traits such as job title or customer profile. Groups are also associated

with a set of roles, and every user that is a member of a group inherits all the roles assigned to that group.

What is handle

An object that identifies an enterprise bean. A client can serialize the handle and then later deserialize it to obtain a

reference to the enterprise bean. What is home handle

An object that can be used to obtain a reference to the home interface. A home handle can be serialized and written to stable

storage and deserialized to obtain the reference.

What is home interface

One of two interfaces for an enterprise bean. The home interface defines zero or more methods for managing an enterprise

bean. The home interface of a session bean defines create and remove methods, whereas the home interface of an entity bean

defines create, finder, and remove methods.

What is HTML

Hypertext Markup Language. A markup language for hypertext documents on the Internet. HTML enables the embedding of images,

sounds, video streams, form fields, references to other objects with URLs, and basic text formatting.

What is HTTP

Hypertext Transfer Protocol. The Internet protocol used to retrieve hypertext objects from remote hosts. HTTP messages

consist of requests from client to server and responses from server to client.

What is HTTPS

HTTP layered over the SSL protocol.

What is IDL

Interface Definition Language. A language used to define interfaces to remote CORBA objects. The interfaces are independent

of operating systems and programming languages.

What is IIOP

Internet Inter-ORB Protocol. A protocol used for communication between CORBA object request brokers.

What is impersonation

An act whereby one entity assumes the identity and privileges of another entity without restrictions and without any

indication visible to the recipients of the impersonator's calls that delegation has taken place. Impersonation is a case of

simple delegation. What is initialization parameter

A parameter that initializes the context associated with a servlet.

What is ISO 3166

The international standard for country codes maintained by the International Organization for Standardization (ISO).

What is ISV

Independent software vendor.

What is J2EE

Java 2 Platform, Enterprise Edition.

What is J2EE application

Any deployable unit of J2EE functionality. This can be a single J2EE module or a group of modules packaged into an EAR file along with a J2EE application deployment descriptor. J2EE applications are typically engineered to be distributed across multiple computing tiers.

What is J2EE component

A self-contained functional software unit supported by a container and configurable at deployment time. The J2EE specification defines the following J2EE components:

Application clients and applets are components that run on the client.

Java servlet and JavaServer Pages (JSP) technology components are Web components that run on the server.

Enterprise JavaBeans (EJB) components (enterprise beans) are business components that run on the server.

J2EE components are written in the Java programming language and are compiled in the same way as any program in the language. The difference between J2EE components and standard Java classes is that J2EE components are assembled into a J2EE application, verified to be well formed and in compliance with the J2EE specification, and deployed to production, where they are run and managed by the J2EE server or client container.

What is J2EE module

A software unit that consists of one or more J2EE components of the same container type and one deployment descriptor of that type. There are four types of modules: EJB, Web, application client, and resource adapter. Modules can be deployed as stand-alone units or can be assembled into a J2EE application.

What is J2EE product

An implementation that conforms to the J2EE platform specification.

What is J2EE product provider

A vendor that supplies a J2EE product.

What is J2EE server

The runtime portion of a J2EE product. A J2EE server provides EJB or Web containers or both.

What is J2ME

Abbreviate of Java 2 Platform, Micro Edition.

What is J2SE

Abbreviate of Java 2 Platform, Standard Edition.

What is JAR

Java archive. A platform-independent file format that permits many files to be aggregated into one file. What is Java 2 Platform, Enterprise Edition (J2EE)

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.

What is Java 2 Platform, Micro Edition (J2ME)

A highly optimized Java runtime environment targeting a wide range of consumer products, including pagers, cellular phones, screen phones, digital set-top boxes, and car navigation systems.

What is Java 2 Platform, Standard Edition (J2SE)

The core Java technology platform.

What is Java API for XML Processing (JAXP)

An API for processing XML documents. JAXP leverages the parser standards SAX and DOM so that you can choose to parse your data as a stream of events or to build a tree-structured representation of it. JAXP supports the XSLT standard, giving you control over the presentation of the data and enabling you to convert the data to other XML documents or to other formats, such as HTML. JAXP provides namespace support, allowing you to work with schema that might otherwise have naming conflicts.

What is Java API for XML Registries (JAXR)

An API for accessing various kinds of XML registries.

What is Java API for XML-based RPC (JAX-RPC)

An API for building Web services and clients that use remote procedure calls and XML.

What is Java IDL

A technology that provides CORBA interoperability and connectivity capabilities for the J2EE platform. These capabilities enable J2EE applications to invoke operations on remote network services using the Object Management Group IDL and IIOP.

What is Java Message Service (JMS)

An API for invoking operations on enterprise messaging systems.

What is Java Naming and Directory Interface (JNDI)

An API that provides naming and directory functionality.

What is Java Secure Socket Extension (JSSE)

A set of packages that enable secure Internet communications.

What is Java Transaction API (JTA)

An API that allows applications and J2EE servers to access transactions.

What is Java Transaction Service (JTS)

Specifies the implementation of a transaction manager that supports JTA and implements the Java mapping of the Object Management Group Object Transaction Service 1.1 specification at the level below the API.

What is JavaBeans component

A Java class that can be manipulated by tools and composed into applications. A JavaBeans component must adhere to certain property and event interface conventions.

What is JavaMail

An API for sending and receiving email.

What is JavaServer Faces Technology

A framework for building server-side user interfaces for Web applications written in the Java programming language.

What is JavaServer Faces conversion model

A mechanism for converting between string-based markup generated by JavaServer Faces UI components and server-side Java objects.

What is JavaServer Faces event and listener model

A mechanism for determining how events emitted by JavaServer Faces UI components are handled. This model is based on the JavaBeans component event and listener model.

What is JavaServer Faces expression language

A simple expression language used by a JavaServer Faces UI component tag attributes to bind the associated component to a bean property or to bind the associated component's value to a method or an external data source, such as a bean property. Unlike JSP EL expressions, JavaServer Faces EL expressions are evaluated by the JavaServer Faces implementation rather than by the Web container.

What is JavaServer Faces navigation model

A mechanism for defining the sequence in which pages in a JavaServer Faces application are displayed.

What is JavaServer Faces UI component

A user interface control that outputs data to a client or allows a user to input data to a JavaServer Faces application.

What is JavaServer Faces UI component class

A JavaServer Faces class that defines the behavior and properties of a JavaServer Faces UI component.

What is JavaServer Faces validation model

A mechanism for validating the data a user inputs to a JavaServer Faces UI component.

What is JavaServer Pages (JSP)

An extensible Web technology that uses static data, JSP elements, and server-side Java objects to generate dynamic content for a client. Typically the static data is HTML or XML elements, and in many cases the client is a Web browser.

What is JavaServer Pages Standard Tag Library (JSTL)

A tag library that encapsulates core functionality common to many JSP applications. JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization and locale-specific formatting tags, SQL tags, and functions.

What is JAXR client

A client program that uses the JAXR API to access a business registry via a JAXR provider.

What is JAXR provider

An implementation of the JAXR API that provides access to a specific registry provider or to a class of registry providers that are based on a common specification.

What is JDBC

An API for database-independent connectivity between the J2EE platform and a wide range of data sources.

What is JMS

Java Message Service.

What is JMS administered object

A preconfigured JMS object (a resource manager connection factory or a destination) created by an administrator for the use of JMS clients and placed in a JNDI namespace.

What is JMS application

One or more JMS clients that exchange messages.

What is JMS client

A Java language program that sends or receives messages.

What is JMS provider

A messaging system that implements the Java Message Service as well as other administrative and control functionality needed in a full-featured messaging product.

What is JMS session

A single-threaded context for sending and receiving JMS messages. A JMS session can be nontransacted, locally transacted, or participating in a distributed transaction.

What is JNDI

Abbreviate of Java Naming and Directory Interface.

What is JSP

Abbreviate of JavaServer Pages.

What is JSP action

A JSP element that can act on implicit objects and other server-side objects or can define new scripting variables. Actions follow the XML syntax for elements, with a start tag, a body, and an end tag; if the body is empty it can also use the empty tag syntax. The tag must use a prefix. There are standard and custom actions.

What is JSP container

A container that provides the same services as a servlet container and an engine that interprets and processes JSP pages into a servlet.

What is JSP container, distributed

A JSP container that can run a Web application that is tagged as distributable and is spread across multiple Java virtual machines that might be running on different hosts.

What is JSP custom action

A user-defined action described in a portable manner by a tag library descriptor and imported into a JSP page by a taglib directive. Custom actions are used to encapsulate recurring tasks in writing JSP pages.

What is JSP custom tag

A tag that references a JSP custom action.

What is JSP declaration

A JSP scripting element that declares methods, variables, or both in a JSP page.

What is JSP directive

A JSP element that gives an instruction to the JSP container and is interpreted at translation time.

What is JSP document

A JSP page written in XML syntax and subject to the constraints of XML documents.

What is JSP element

A portion of a JSP page that is recognized by a JSP translator. An element can be a directive, an action, or a scripting element.

What is JSP expression

A scripting element that contains a valid scripting language expression that is evaluated, converted to a String, and placed into the implicit out object.

What is JSP expression language

A language used to write expressions that access the properties of JavaBeans components. EL expressions can be used in static text and in any standard or custom tag attribute that can accept an expression.

What is JSP page

A text-based document containing static text and JSP elements that describes how to process a request to create a response. A JSP page is translated into and handles requests as a servlet.

What is JSP scripting element

A JSP declaration, scriptlet, or expression whose syntax is defined by the JSP specification and whose content is written according to the scripting language used in the JSP page. The JSP specification describes the syntax and semantics for the case where the language page attribute is java.

What is JSP scriptlet

A JSP scripting element containing any code fragment that is valid in the scripting language used in the JSP page. The JSP specification describes what is a valid scriptlet for the case where the language page attribute is java.

What is JSP standard action

An action that is defined in the JSP specification and is always available to a JSP page.

What is JSP tag file

A source file containing a reusable fragment of JSP code that is translated into a tag handler when a JSP page is translated into a servlet.

What is JSP tag handler

A Java programming language object that implements the behavior of a custom tag.

What is JSP tag library

A collection of custom tags described via a tag library descriptor and Java classes.

What is JSTL

Abbreviate of JavaServer Pages Standard Tag Library.

What is JTA

Abbreviate of Java Transaction API.

What is JTS

Abbreviate of Java Transaction Service.

What is keystore

A file containing the keys and certificates used for authentication. 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.

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.

What is local subset

That part of the DTD that is defined within the current XML file.

What is managed bean creation facility

A mechanism for defining the characteristics of JavaBeans components used in a JavaServer Faces application.

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.

What is message consumer

An object created by a JMS session that is used for receiving messages sent to a destination.

What is message-driven bean

An enterprise bean that is an asynchronous message consumer. A message-driven bean has no state for a specific client, but its instance variables can contain state across the handling of client messages, including an open database connection and an object reference to an EJB object. A client accesses a message-driven bean by sending messages to the destination for which the bean is a message listener.

What is message producer

An object created by a JMS session that is used for sending messages to a destination.

What is mixed-content model

A DTD specification that defines an element as containing a mixture of text and one more other elements. The specification must start with #PCDATA, followed by diverse elements, and must end with the zero-or-more asterisk symbol (*).

What is method-binding expression

A JavaServer Faces EL expression that refers to a method of a backing bean. This method performs either event handling, validation, or navigation processing for the UI component whose tag uses the method-binding expression.

What is method permission

An authorization rule that determines who is permitted to execute one or more enterprise bean methods.

What is mutual authentication

An authentication mechanism employed by two parties for the purpose of proving each other's identity to one another.

What is namespace

A standard that lets you specify a unique label for the set of element names defined by a DTD. A document using that DTD can be included in any other document without having a conflict between element names. The elements defined in your DTD are then uniquely identified so that, for example, the parser can tell when an element should be interpreted according to your DTD rather than using the definition for an element in a different DTD.

What is naming context

A set of associations between unique, atomic, people-friendly identifiers and objects.

What is naming environment

A mechanism that allows a component to be customized without the need to access or change the component's source code. A container implements the component's naming environment and provides it to the component as a JNDI naming context. Each component names and accesses its environment entries using the java:comp/env JNDI context. The environment entries are declaratively specified in the component's deployment descriptor.

What is normalization

The process of removing redundancy by modularizing, as with subroutines, and of removing superfluous differences by reducing them to a common denominator. For example, line endings from different systems are normalized by reducing them to a single new line, and multiple whitespace characters are normalized to one space.

What is North American Industry Classification System (NAICS)

A system for classifying business establishments based on the processes they use to produce goods or services.

What is notation

A mechanism for defining a data format for a non-XML document referenced as an unparsed entity. This is a holdover from SGML. A newer standard is to use MIME data types and namespaces to prevent naming conflicts.

What is OASIS

Organization for the Advancement of Structured Information Standards. A consortium that drives the development, convergence, and adoption of e-business standards. Its Web site is http://www.oasis-open.org/. The DTD repository it sponsors is at http://www.XML.org.

What is OMG

Object Management Group. A consortium that produces and maintains computer industry specifications for interoperable enterprise applications. Its Web site is http://www.omg.org/.

What is one-way messaging

A method of transmitting messages without having to block until a response is received.

What is ORB

Object request broker. A library that enables CORBA objects to locate and communicate with one another. What is OS principal

A principal native to the operating system on which the J2EE platform is executing.

What is OTS

Object Transaction Service. A definition of the interfaces that permit CORBA objects to participate in transactions.

What is parameter entity

An entity that consists of DTD specifications, as distinct from a general entity. A parameter entity defined in the DTD can then be referenced at other points, thereby eliminating the need to recode the definition at each location it is used.

What is parsed entity

A general entity that contains XML and therefore is parsed when inserted into the XML document, as opposed to an unparsed entity.

What is parser

A module that reads in XML data from an input source and breaks it into chunks so that your program knows when it is working with a tag, an attribute, or element data. A nonvalidating parser ensures that the XML data is well formed but does not verify that it is valid. See also validating parser.

What is passivation

The process of transferring an enterprise bean from memory to secondary storage. See activation.

What is persistence

The protocol for transferring the state of an entity bean between its instance variables and an underlying database.

What is persistent field

A virtual field of an entity bean that has container-managed persistence; it is stored in a database.

What is POA

Portable Object Adapter. A CORBA standard for building server-side applications that are portable across heterogeneous ORBs.

What is point-to-point messaging system

A messaging system built on the concept of message queues. Each message is addressed to a specific queue; clients extract messages from the queues established to hold their messages.

What is primary key

An object that uniquely identifies an entity bean within a home.

What is principal

The identity assigned to a user as a result of authentication.

What is privilege

A security attribute that does not have the property of uniqueness and that can be shared by many principals.

What is processing instruction

Information contained in an XML structure that is intended to be interpreted by a specific application.

What is programmatic security

Security decisions that are made by security-aware applications. Programmatic security is useful when declarative security alone is not sufficient to express the security model of an application.

What is prolog

The part of an XML document that precedes the XML data. The prolog includes the declaration and an optional DTD.

What is public key certificate

Used in client-certificate authentication to enable the server, and optionally the client, to authenticate each other. The public key certificate is the digital equivalent of a passport. It is issued by a trusted organization, called a certificate authority, and provides identification for the bearer.

What is publish/subscribe messaging system

A messaging system in which clients address messages to a specific node in a content hierarchy, called a topic. Publishers and subscribers are generally anonymous and can dynamically publish or subscribe to the content hierarchy. The system takes care of distributing the messages arriving from a node's multiple publishers to its multiple subscribers.

What is query string

A component of an HTTP request URL that contains a set of parameters and values that affect the handling of the request.

What is queue

See point-to-point messaging system.

What is RAR

Resource Adapter Archive. A JAR archive that contains a resource adapter module.

What is RDF

Resource Description Framework. A standard for defining the kind of data that an XML file contains. Such information can help ensure semantic integrity-for example-by helping to make sure that a date is treated as a date rather than simply as text.

What is RDF schema

A standard for specifying consistency rules that apply to the specifications contained in an RDF.

What is realm

See security policy domain. Also, a string, passed as part of an HTTP request during basic authentication, that defines a protection space. The protected resources on a server can be partitioned into a set of protection spaces, each with its own authentication scheme or authorization database or both.

In the J2EE server authentication service, a realm is a complete database of roles, users, and groups that identify valid users of a Web application or a set of Web applications.

What is reentrant entity bean

An entity bean that can handle multiple simultaneous, interleaved, or nested invocations that will not interfere with each other.

What is reference

See entity reference.

What is registry

An infrastructure that enables the building, deployment, and discovery of Web services. It is a neutral third party that facilitates dynamic and loosely coupled business-to-business (B2B) interactions.

What is registry provider

An implementation of a business registry that conforms to a specification for XML registries (for example, ebXML or UDDI).

What is relationship field

A virtual field of an entity bean having container-managed persistence; it identifies a related entity bean.

What is remote interface

One of two interfaces for an enterprise bean. The remote interface defines the business methods callable by a client.

What is remove method

Method defined in the home interface and invoked by a client to destroy an enterprise bean.

What is render kit

A set of renderers that render output to a particular client. The JavaServer Faces implementation provides a standard HTML render kit, which is composed of renderers that can render HMTL markup.

What is renderer

A Java class that can render the output for a set of JavaServer Faces UI components.

What is request-response messaging

A method of messaging that includes blocking until a response is received.

What is resource adapter

A system-level software driver that is used by an EJB container or an application client to connect to an enterprise information system. A resource adapter typically is specific to an enterprise information system. It is available as a library and is used within the address space of the server or client using it. A resource adapter plugs in to a container. The application components deployed on the container then use the client API (exposed by the adapter) or tool-generated high-level abstractions to access the underlying enterprise information system. The resource adapter and EJB container collaborate to provide the underlying mechanisms-transactions, security, and connection pooling-for connectivity to the enterprise information system.

What is resource adapter module

A deployable unit that contains all Java interfaces, classes, and native libraries, implementing a resource adapter along with the resource adapter deployment descriptor.

What is resource manager

Provides access to a set of shared resources. A resource manager participates in transactions that are externally controlled and coordinated by a transaction manager. A resource manager typically is in a different address space or on a different machine from the clients that access it. Note: An enterprise information system is referred to as a resource manager when it is mentioned in the context of resource and transaction management.

What is resource manager connection

An object that represents a session with a resource manager.

What is resource manager connection factory

An object used for creating a resource manager connection.

What is RMI

Remote Method Invocation. A technology that allows an object running in one Java virtual machine to invoke methods on an object running in a different Java virtual machine.

What is RMI-IIOP

A version of RMI implemented to use the CORBA IIOP protocol. RMI over IIOP provides interoperability with CORBA objects implemented in any language if all the remote interfaces are originally defined as RMI interfaces.

What is role (development)

The function performed by a party in the development and deployment phases of an application developed using J2EE technology. The roles are application component provider, application assembler, deployer, J2EE product provider, EJB container provider, EJB server provider, Web container provider, Web server provider, tool provider, and system administrator.

What is role mapping

The process of associating the groups or principals (or both), recognized by the container with security roles specified in the deployment descriptor. Security roles must be mapped by the deployer before a component is installed in the server.

What is role (security)

An abstract logical grouping of users that is defined by the application assembler. When an application is deployed, the roles are mapped to security identities, such as principals or groups, in the operational environment.

In the J2EE server authentication service, a role is an abstract name for permission to access a particular set of resources. A role can be compared to a key that can open a lock. Many people might have a copy of the key; the lock doesn't care who you are, only that you have the right key.

What is rollback

The point in a transaction when all updates to any resources involved in the transaction are reversed.

What is root

The outermost element in an XML document. The element that contains all other elements.

What is SAX

Abbreviation of Simple API for XML.

What is Simple API for XML

An event-driven interface in which the parser invokes one of several methods supplied by the caller when a parsing event occurs. Events include recognizing an XML tag, finding an error, encountering a reference to an external entity, or processing a DTD specification.

What is schema

A database-inspired method for specifying constraints on XML documents using an XML-based language. Schemas address deficiencies in DTDs, such as the inability to put constraints on the kinds of data that can occur in a particular field. Because schemas are founded on XML, they are hierarchical. Thus it is easier to create an unambiguous specification, and it is possible to determine the scope over which a comment is meant to apply.

What is Secure Socket Layer (SSL)

A technology that allows Web browsers and Web servers to communicate over a secured connection.

What is security attributes

A set of properties associated with a principal. Security attributes can be associated with a principal by an authentication protocol or by a J2EE product provider or both.

What is security constraint

A declarative way to annotate the intended protection of Web content. A security constraint consists of a Web resource collection, an authorization constraint, and a user data constraint.

What is security context

An object that encapsulates the shared state information regarding security between two entities.

What is security permission

A mechanism defined by J2SE, and used by the J2EE platform to express the programming restrictions imposed on application component developers.

What is security permission set

The minimum set of security permissions that a J2EE product provider must provide for the execution of each component type.

What is security policy domain

A scope over which security policies are defined and enforced by a security administrator. A security policy domain has a collection of users (or principals), uses a well-defined authentication protocol or protocols for authenticating users (or principals), and may have groups to simplify setting of security policies.

What is security role

See role (security).

What is security technology domain

A scope over which the same security mechanism is used to enforce a security policy. Multiple security policy domains can exist within a single technology domain.

What is security view

The set of security roles defined by the application assembler.

What is server certificate

Used with the HTTPS protocol to authenticate Web applications. The certificate can be self-signed or approved by a certificate authority (CA). The HTTPS service of the Sun Java System Application Server Platform Edition 8 will not run unless a server certificate has been installed.

What is server principal

The OS principal that the server is executing as.

What is service element

A representation of the combination of one or more Connector components that share a single engine component for processing incoming requests.

What is service endpoint interface

A Java interface that declares the methods that a client can invoke on a Web service.

What is servlet

A Java program that extends the functionality of a Web server, generating dynamic content and interacting with Web applications using a request-response paradigm.

What is servlet container

A container that provides the network services over which requests and responses are sent, decodes requests, and formats responses. All servlet containers must support HTTP as a protocol for requests and responses but can also support additional request-response protocols, such as HTTPS.

What is servlet container, distributed

A servlet container that can run a Web application that is tagged as distributable and that executes across multiple Java virtual machines running on the same host or on different hosts.

What is servlet context

An object that contains a servlet's view of the Web application within which the servlet is running. Using the context, a servlet can log events, obtain URL references to resources, and set and store attributes that other servlets in the context can use.

What is servlet mapping

Defines an association between a URL pattern and a servlet. The mapping is used to map requests to servlets.

What is session

An object used by a servlet to track a user's interaction with a Web application across multiple HTTP requests. What is session bean

An enterprise bean that is created by a client and that usually exists only for the duration of a single client-server session. A session bean performs operations, such as calculations or database access, for the client. Although a session bean can be transactional, it is not recoverable should a system crash occur. Session bean objects either can be stateless or can maintain conversational state across methods and transactions. If a session bean maintains state, then the EJB container manages this state if the object must be removed from memory. However, the session bean object itself must manage its own persistent data.

What is SGML

Standard Generalized Markup Language. The parent of both HTML and XML. Although HTML shares SGML's propensity for embedding presentation information in the markup, XML is a standard that allows information content to be totally separated from the mechanisms for rendering that content.

What is SOAP

Simple Object Access Protocol. A lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. It defines, using XML technologies, an extensible messaging framework containing a message construct that can be exchanged over a variety of underlying protocols.

What is SOAP with Attachments API for Java (SAAJ)

The basic package for SOAP messaging, SAAJ contains the API for creating and populating a SOAP message.

What is SQL

Structured Query Language. The standardized relational database language for defining database objects and manipulating data.

What is SQL/J

A set of standards that includes specifications for embedding SQL statements in methods in the Java programming language and specifications for calling Java static methods as SQL stored procedures and user-defined functions. An SQL checker can detect errors in static SQL statements at program development time, rather than at execution time as with a JDBC driver.

What is SSL

Secure Socket Layer. A security protocol that provides privacy over the Internet. The protocol allows client-server applications to communicate in a way that cannot be eavesdropped upon or tampered with. Servers are always authenticated, and clients are optionally authenticated.

What is stateful session bean

A session bean with a conversational state.

What is stateless session bean

A session bean with no conversational state. All instances of a stateless session bean are identical.

What is system administrator

The person responsible for configuring and administering the enterprise's computers, networks, and software systems.

What is tag

In XML documents, a piece of text that describes a unit of data or an element. The tag is distinguishable as markup, as opposed to data, because it is surrounded by angle brackets (<>). To treat such markup syntax as data, you use an entity reference or a CDATA section.

What is template

A set of formatting instructions that apply to the nodes selected by an XPath expression.

What is tool provider

An organization or software vendor that provides tools used for the development, packaging, and deployment of J2EE applications.What is topic

See publish-subscribe messaging system.

What is transaction

An atomic unit of work that modifies data. A transaction encloses one or more program statements, all of which either complete or roll back. Transactions enable multiple users to access the same data concurrently.

What is transaction attribute

A value specified in an enterprise bean's deployment descriptor that is used by the EJB container to control the transaction scope when the enterprise bean's methods are invoked. A transaction attribute can have the following values: Required, RequiresNew, Supports, NotSupported, Mandatory, or Never.

What is transaction isolation level

The degree to which the intermediate state of the data being modified by a transaction is visible to other concurrent transactions and data being modified by other transactions is visible to it.

What is transaction manager

Provides the services and management functions required to support transaction demarcation, transactional resource management, synchronization, and transaction context propagation.

What is Unicode

A standard defined by the Unicode Consortium that uses a 16-bit code page that maps digits to characters in languages around the world. Because 16 bits covers 32,768 codes, Unicode is large enough to include all the world's languages, with the exception of ideographic languages that have a different character for every concept, such as Chinese. For more information, see http://www.unicode.org/.

What is Universal Description, Discovery and Integration (UDDI) project

An industry initiative to create a platform-independent, open framework for describing services, discovering businesses, and integrating business services using the Internet, as well as a registry. It is being developed by a vendor consortium.

What is Universal Standard Products and Services Classification (UNSPSC)

A schema that classifies and identifies commodities. It is used in sell-side and buy-side catalogs and as a standardized account code in analyzing expenditure.

What is unparsed entity

A general entity that contains something other than XML. By its nature, an unparsed entity contains binary data.

What is URI

Uniform resource identifier. A globally unique identifier for an abstract or physical resource. A URL is a kind of URI that specifies the retrieval protocol (http or https for Web applications) and physical location of a resource (host name and host-relative path). A URN is another type of URI.

What is URL

Uniform resource locator. A standard for writing a textual reference to an arbitrary piece of data in the World Wide Web. A URL looks like this: protocol://host/localinfo where protocol specifies a protocol for fetching the object (such as http or ftp), host specifies the Internet name of the targeted host, and localinfo is a string (often a file name) passed to the protocol handler on the remote host.

What is URL path

The part of a URL passed by an HTTP request to invoke a servlet. A URL path consists of the context path + servlet path + path info, where Context path is the path prefix associated with a servlet context of which the servlet is a part. If this context is the default context rooted at the base of the Web server's URL namespace, the path prefix will be an empty string. Otherwise, the path prefix starts with a / character but does not end with a / character.

Servlet path is the path section that directly corresponds to the mapping that activated this request. This path starts with a / character.

Path info is the part of the request path that is not part of the context path or the servlet path.

What is URN

Uniform resource name. A unique identifier that identifies an entity but doesn't tell where it is located. A system can use a URN to look up an entity locally before trying to find it on the Web. It also allows the Web location to change, while still allowing the entity to be found.

What is user data constraint

Indicates how data between a client and a Web container should be protected. The protection can be the prevention of tampering with the data or prevention of eavesdropping on the data.

What is user (security)

An individual (or application program) identity that has been authenticated. A user can have a set of roles associated with that identity, which entitles the user to access all resources protected by those roles.

What is valid

A valid XML document, in addition to being well formed, conforms to all the constraints imposed by a DTD. It does not contain any tags that are not permitted by the DTD, and the order of the tags conforms to the DTD's specifications.

What is validating parser

A parser that ensures that an XML document is valid in addition to being well formed. See also parser.

What is value-binding expression

A JavaServer Faces EL expression that refers to a property of a backing bean. A component tag uses this expression to bind the associated component's value or the component instance to the bean property. If the component tag refers to the property via its value attribute, then the component's value is bound to the property. If the component tag refers to the property via its binding attribute then the component itself is bound to the property.

What is virtual host

Multiple hosts plus domain names mapped to a single IP address.

What is W3C

World Wide Web Consortium. The international body that governs Internet standards. Its Web site is http://www.w3.org/.

What is WAR file

Web application archive file. A JAR archive that contains a Web module.

What is warning

A SAX parser warning is generated when the document's DTD contains duplicate definitions and in similar situations that are not necessarily an error but which the document author might like to know about, because they could be. See also fatal error, error.

What is Web application

An application written for the Internet, including those built with Java technologies such as JavaServer Pages and servlets, as well as those built with non-Java technologies such as CGI and Perl.

What is Web application, distributable

A Web application that uses J2EE technology written so that it can be deployed in a Web container distributed across multiple Java virtual machines running on the same host or different hosts. The deployment descriptor for such an application uses the distributable element.

What is Web component

A component that provides services in response to requests; either a servlet or a JSP page.

What is Web container

A container that implements the Web component contract of the J2EE architecture. This contract specifies a runtime environment for Web components that includes security, concurrency, life-cycle management, transaction, deployment, and other services. A Web container provides the same services as a JSP container as well as a federated view of the J2EE platform APIs. A Web container is provided by a Web or J2EE server.

What is Web container, distributed

A Web container that can run a Web application that is tagged as distributable and that executes across multiple Java virtual machines running on the same host or on different hosts.

What is Web container provider

A vendor that supplies a Web container.

What is Web module

A deployable unit that consists of one or more Web components, other resources, and a Web application deployment descriptor contained in a hierarchy of directories and files in a standard Web application format.

What is Web resource

A static or dynamic object contained in a Web application that can be referenced by a URL.

What is Web resource collection

A list of URL patterns and HTTP methods that describe a set of Web resources to be protected.

What is Web server

Software that provides services to access the Internet, an intranet, or an extranet. A Web server hosts Web sites, provides support for HTTP and other protocols, and executes server-side programs (such as CGI scripts or servlets) that perform certain functions. In the J2EE architecture, a Web server provides services to a Web container. For example, a Web container typically relies on a Web server to provide HTTP message handling. The J2EE architecture assumes that a Web container is hosted by a Web server from the same vendor, so it does not specify the contract between these two entities. A Web server can host one or more Web containers.

What is Web server provider

A vendor that supplies a Web server.

What is Web service

An application that exists in a distributed environment, such as the Internet. A Web service accepts a request, performs its function based on the request, and returns a response. The request and the response can be part of the same operation, or they can occur separately, in which case the consumer does not need to wait for a response. Both the request and the response usually take the form of XML, a portable data-interchange format, and are delivered over a wire protocol, such as HTTP.

What is well-formed

An XML document that is syntactically correct. It does not have any angle brackets that are not part of tags, all tags have an ending tag or are themselves self-ending, and all tags are fully nested. Knowing that a document is well formed makes it possible to process it. However, a well-formed document may not be valid. To determine that, you need a validating parser and a DTD.

What is Xalan

An interpreting version of XSLT.

What is XHTML

An XML look-alike for HTML defined by one of several XHTML DTDs. To use XHTML for everything would of course defeat the purpose of XML, because the idea of XML is to identify information content, and not just to tell how to display it. You can reference it in a DTD, which allows you to say, for example, that the text in an element can contain and tags rather than being limited to plain text.

What is XLink

The part of the XLL specification that is concerned with specifying links between documents.

What is XLL

The XML Link Language specification, consisting of XLink and XPointer.

What is XML

Extensible Markup Language. A markup language that allows you to define the tags (markup) needed to identify the content, data, and text in XML documents. It differs from HTML, the markup language most often used to present information on the Internet. HTML has fixed tags that deal mainly with style or presentation. An XML document must undergo a transformation into a language with style tags under the control of a style sheet before it can be presented by a browser or other presentation mechanism. Two types of style sheets used with XML are CSS and XSL. Typically, XML is transformed into HTML for presentation. Although tags can be defined as needed in the generation of an XML document, a document type definition (DTD) can be used to define the elements allowed in a particular type of document. A document can be compared by using the rules in the DTD to determine its validity and to locate particular elements in the document. A Web services application's J2EE deployment descriptors are expressed in XML with schemas defining allowed elements. Programs for processing XML documents use SAX or DOM APIs.

What is XML registry

See registry.

What is XML Schema

The W3C specification for defining the structure, content, and semantics of XML documents.

What is XPath

An addressing mechanism for identifying the parts of an XML document.

What is XPointer

The part of the XLL specification that is concerned with identifying sections of documents so that they can be referenced in links or included in other documents.

What is XSL

Extensible Stylesheet Language. A standard that lets you do the following:

Specify an addressing mechanism, so that you can identify the parts of an XML document that a transformation applies to (XPath).

Specify tag conversions, so that you can convert XML data into different formats (XSLT).

Specify display characteristics, such page sizes, margins, and font heights and widths, as well as the flow objects on each page. Information fills in one area of a page and then automatically flows to the next object when that area fills up. That allows you to wrap text around pictures, for example, or to continue a newsletter article on a different page (XSL-FO).

What is XSL-FO

A subcomponent of XSL used for describing font sizes, page layouts, and how information flows from one page to another.

What is XSLT

XSL Transformations. An XML document that controls the transformation of an XML document into another XML document or HTML. The target document often has presentation-related tags dictating how it will be rendered by a browser or other presentation mechanism. XSLT was formerly a part of XSL, which also included a tag language of style flow objects.

What is XSLTC

A compiling version of XSLT

Friday, September 28, 2007

Java Interview Questions

1. What is a transient variable?
A transient variable is a variable that may not be serialized.

2. Which containers use a border Layout as their default layout?
The window, Frame and Dialog classes use a border layout as their default layout.

3. Why do threads block on I/O?
Threads block on I/O (that is enters the waiting state) so that other threads may execute while the I/O Operation is performed.

4. How are Observer and Observable used?
Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.

5. What is synchronization and why is it important?
With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.

6. Can a lock be acquired on a class?
Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.

7. What's new with the stop(), suspend() and resume() methods in JDK 1.2?
The stop(), suspend() and resume() methods have been deprecated in JDK 1.2.

8. Is null a keyword?
The null value is not a keyword.

9. What is the preferred size of a component?
The preferred size of a component is the minimum component size that will allow the component to display normally.

10. What method is used to specify a container's layout?
The setLayout() method is used to specify a container's layout.

11. Which containers use a FlowLayout as their default layout?
The Panel and Applet classes use the FlowLayout as their default layout.

12. What state does a thread enter when it terminates its processing?
When a thread terminates its processing, it enters the dead state.

13. What is the Collections API?
The Collections API is a set of classes and interfaces that support operations on collections of objects.

14. which characters may be used as the second character of an identifier, but not as the first character of an identifier?
The digits 0 through 9 may not be used as the first character of an identifier but they may be used after the first character of an identifier.

15. What is the List interface?
The List interface provides support for ordered collections of objects.

16. How does Java handle integer overflows and underflows?
It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.

17. What is the Vector class?
The Vector class provides the capability to implement a growable array of objects

18. What modifiers may be used with an inner class that is a member of an outer class?
A (non-local) inner class may be declared as public, protected, private, static, final, or abstract.

19. What is an Iterator interface?
The Iterator interface is used to step through the elements of a Collection.

20. What is the difference between the >> and >>> operators?
The >> operator carries the sign bit when shifting right. The >>> zero-fills bits that have been shifted out.

21. Which method of the Component class is used to set the position and size of a component?
setBounds()

22. How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters?
Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bit and larger bit patterns.

23 What is the difference between yielding and sleeping?
When a task invokes its yield() method, it returns to the ready state. When a task invokes its sleep() method, it returns to the waiting state.

24. Which java.util classes and interfaces support event handling?
The EventObject class and the EventListener interface support event processing.

25. Is sizeof a keyword?
The sizeof operator is not a keyword.

26. What are wrapper classes?
Wrapper classes are classes that allow primitive types to be accessed as objects.

27. Does garbage collection guarantee that a program will not run out of memory?
Garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.

28. What restrictions are placed on the location of a package statement within a source code file?
A package statement must appear as the first line in a source code file (excluding blank lines and comments).

29. Can an object's finalize() method be invoked while it is reachable?
An object's finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object's finalize() method may be invoked by other objects.

30. What is the immediate superclass of the Applet class?
Panel

31. What is the difference between preemptive scheduling and time slicing?
Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and then reenters the pool of ready tasks. The scheduler then determines which task should execute next, based on priority and other factors.

32. Name three Component subclasses that support painting.
The Canvas, Frame, Panel, and Applet classes support painting.

33. What value does readLine() return when it has reached the end of a file?
The readLine() method returns null when it has reached the end of a file.

34. What is the immediate superclass of the Dialog class?
Window.

35. What is clipping?
Clipping is the process of confining paint operations to a limited area or shape.

36. What is a native method?
A native method is a method that is implemented in a language other than Java.

37. Can a for statement loop indefinitely?
Yes, a for statement can loop indefinitely. For example, consider the following:
for(;;) ;

38. What are order of precedence and associativity, and how are they used?
Order of precedence determines the order in which operators are evaluated in expressions. Associatity determines whether an expression is evaluated left-to-right or right-to-left

39. When a thread blocks on I/O, what state does it enter?
A thread enters the waiting state when it blocks on I/O.

40. To what value is a variable of the String type automatically initialized?
The default value of a String type is null.

41. What is the catch or declare rule for method declarations?
If a checked exception may be thrown within the body of a method, the method must either catch the exception or declare it in its throws clause.

42. What is the difference between a MenuItem and a CheckboxMenuItem?
The CheckboxMenuItem class extends the MenuItem class to support a menu item that may be checked or unchecked.

43. What is a task's priority and how is it used in scheduling?
A task's priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks.

44. What class is the top of the AWT event hierarchy?
The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy.

45. When a thread is created and started, what is its initial state?
A thread is in the ready state after it has been created and started.

46. Can an anonymous class be declared as implementing an interface and extending a class?
An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.

47. What is the range of the short type?
The range of the short type is -(2^15) to 2^15 - 1.

48. What is the range of the char type?
The range of the char type is 0 to 2^16 - 1.

49. In which package are most of the AWT events that support the event-delegation model defined?
Most of the AWT-related events of the event-delegation model are defined in the java.awt.event package. The AWTEvent class is defined in the java.awt package.

50. What is the immediate superclass of Menu?
MenuItem

51. What is the purpose of finalization?
The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.

52. Which class is the immediate superclass of the MenuComponent class.
Object

53. What invokes a thread's run() method?
After a thread is started, via its start() method or that of the Thread class, the JVM invokes the thread's run() method when the thread is initially executed.

54. What is the difference between the Boolean & operator and the && operator?
If an expression involving the Boolean & operator is evaluated, both operands are evaluated. Then the & operator is applied to the operand. When an expression involving the && operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The && operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped.

55. Name three subclasses of the Component class.
Box.Filler, Button, Canvas, Checkbox, Choice, Container, Label, List, Scrollbar, or TextComponent

56. What is the GregorianCalendar class?
The GregorianCalendar provides support for traditional Western calendars.

57. Which Container method is used to cause a container to be laid out and redisplayed?
validate()

58. What is the purpose of the Runtime class?
The purpose of the Runtime class is to provide access to the Java runtime system.

59. How many times may an object's finalize() method be invoked by the
garbage collector?
An object's finalize() method may only be invoked once by the garbage collector.

60. What is the purpose of the finally clause of a try-catch-finally statement?
The finally clause is used to provide the capability to execute code no matter whether or not an exception is thrown or caught.

61. What is the argument type of a program's main() method?
A program's main() method takes an argument of the String[] type.

62. Which Java operator is right associative?
The = operator is right associative.

63. What is the Locale class?
The Locale class is used to tailor program output to the conventions of a particular geographic, political, or cultural region.64. Can a double value be cast to a byte?
Yes, a double value can be cast to a byte.

65. What is the difference between a break statement and a continue statement?
A break statement results in the termination of the statement to which it applies (switch, for, do, or while). A continue statement is used to end the current loop iteration and return control to the loop statement.

66. What must a class do to implement an interface?
It must provide all of the methods in the interface and identify the interface in its implements clause.

67. What method is invoked to cause an object to begin executing as a separate thread?
The start() method of the Thread class is invoked to cause an object to begin executing as a separate thread.

68. Name two subclasses of the TextComponent class.
TextField and TextArea

69. What is the advantage of the event-delegation model over the earlier event-inheritance model?
The event-delegation model has two advantages over the event-inheritance model. First, it enables event handling to be handled by objects other than the ones that generate the events (or their containers). This allows a clean separation between a component's design and its use. The other advantage of the event-delegation model is that it performs much better in applications where many events are generated. This performance improvement is due to the fact that the event-delegation model does not have to repeatedly process unhandled events, as is the case of the event-inheritance
model.

70. Which containers may have a MenuBar?
Frame

71. How are commas used in the initialization and iteration parts of a for statement?
Commas are used to separate multiple statements within the initialization and iteration parts of a for statement.

72. What is the purpose of the wait(), notify(), and notifyAll() methods?
The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to wait for a shared resource. When a thread executes an object's wait() method, it enters the waiting state. It only enters the ready state after another thread invokes the object's notify() or notifyAll() methods.

73. What is an abstract method?
An abstract method is a method whose implementation is deferred to a subclass.

74. How are Java source code files named?
A Java source code file takes the name of a public class or interface that is defined within the file. A source code file may contain at most one public class or interface. If a public class or interface is defined within a source code file, then the source code file must take the name of the public class or interface. If no public class or interface is defined within a source code file, then the file must take on a name that is different than its classes and interfaces. Source code files use the .java extension.

75. What is the relationship between the Canvas class and the Graphics class?
A Canvas object provides access to a Graphics object via its paint() method.

76. What are the high-level thread states?
The high-level thread states are ready, running, waiting, and dead.

77. What value does read() return when it has reached the end of a file?
The read() method returns -1 when it has reached the end of a file.

78. Can a Byte object be cast to a double value?
No, an object cannot be cast to a primitive value.

79. What is the difference between a static and a non-static inner class?
A non-static inner class may have object instances that are associated with instances of the class's outer class. A static inner class does not have any object instances.

80. What is the difference between the String and StringBuffer classes?
String objects are constants. StringBuffer objects are not.

81. If a variable is declared as private, where may the variable be accessed?
A private variable may only be accessed within the class in which it is declared.

82. What is an object's lock and which objects have locks?
An object's lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of an object only after it has acquired the object's lock. All objects and classes have locks. A class's lock is acquired on the class's Class object.

83. What is the Dictionary class?
The Dictionary class provides the capability to store key-value pairs.

84. How are the elements of a BorderLayout organized?
The elements of a BorderLayout are organized at the borders (North, South, East, and West) and the center of a container.

85. What is the % operator?
It is referred to as the modulo or remainder operator. It returns the remainder of dividing the first operand by the second operand.

86. When can an object reference be cast to an interface reference?
An object reference be cast to an interface reference when the object implements the referenced interface.

87. What is the difference between a Window and a Frame?
The Frame class extends Window to define a main application window that can have a menu bar.

88. Which class is extended by all other classes?
The Object class is extended by all other classes.

89. Can an object be garbage collected while it is still reachable?
A reachable object cannot be garbage collected. Only unreachable objects may be garbage collected..

90. Is the ternary operator written x : y ? z or x ? y : z ?
It is written x ? y : z.

91. What is the difference between the Font and FontMetrics classes?
The FontMetrics class is used to define implementation-specific properties, such as ascent and descent, of a Font object.

92. How is rounding performed under integer division?
The fractional part of the result is truncated. This is known as rounding toward zero.

93. What happens when a thread cannot acquire a lock on an object?
If a thread attempts to execute a synchronized method or synchronized statement and is unable to acquire an object's lock, it enters the waiting state until the lock becomes available.

94. What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
The Reader/Writer class hierarchy is character-oriented, and the InputStream/OutputStream class hierarchy is byte-oriented.

95. What classes of exceptions may be caught by a catch clause?
A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Error and Exception types.

96. If a class is declared without any access modifiers, where may the class be accessed?
A class that is declared without any access modifiers is said to have package access. This means that the class can only be accessed by other classes and interfaces that are defined within the same package.

97. What is the SimpleTimeZone class?
The SimpleTimeZone class provides support for a Gregorian calendar.

98. What is the Map interface?
The Map interface replaces the JDK 1.1 Dictionary class and is used associate keys with values.99. Does a class inherit the constructors of its superclass?
A class does not inherit constructors from any of its super classes.

100. For which statements does it make sense to use a label?
The only statements for which it makes sense to use a label are those statements that can enclose a break or continue statement.

101. What is the purpose of the System class?
The purpose of the System class is to provide access to system resources.

102. Which TextComponent method is used to set a TextComponent to the read-only state?
setEditable()

103. How are the elements of a CardLayout organized?
The elements of a CardLayout are stacked, one on top of the other, like a deck of cards.

104. Is &&= a valid Java operator?
No, it is not.

105. Name the eight primitive Java types.
The eight primitive types are byte, char, short, int, long, float, double, and boolean.

106. Which class should you use to obtain design information about an object?
The Class class is used to obtain information about an object's design.

107. What is the relationship between clipping and repainting?
When a window is repainted by the AWT painting thread, it sets the clipping regions to the area of the window that requires repainting.

108. Is "abc" a primitive value?
The String literal "abc" is not a primitive value. It is a String object.

109. What is the relationship between an event-listener interface and an event-adapter class?
An event-listener interface defines the methods that must be implemented by an event handler for a particular kind of event. An event adapter provides a default implementation of an event-listener interface.

110. What restrictions are placed on the values of each case of a switch statement?
During compilation, the values of each case of a switch statement must evaluate to a value that can be promoted to an int value.

111. What modifiers may be used with an interface declaration?
An interface may be declared as public or abstract.

112. Is a class a subclass of itself?
A class is a subclass of itself.

113. What is the highest-level event class of the event-delegation model?
The java.util.EventObject class is the highest-level class in the event-delegation class hierarchy.

114. What event results from the clicking of a button?
The ActionEvent event is generated as the result of the clicking of a button.

115. How can a GUI component handle its own events?
A component can handle its own events by implementing the required event-listener interface and adding itself as its own event listener.

116. What is the difference between a while statement and a do statement?
A while statement checks at the beginning of a loop to see whether the next loop iteration should occur. A do statement checks at the end of a loop to see whether the next iteration of a loop should occur. The do statement will always execute the body of a loop at least once.

117. How are the elements of a GridBagLayout organized?
The elements of a GridBagLayout are organized according to a grid. However, the elements are of different sizes and may occupy more than one row or column of the grid. In addition, the rows and columns may have different sizes.

118. What advantage do Java's layout managers provide over traditional windowing systems?
Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java's layout managers aren't tied to absolute sizing and positioning, they are able to accommodate platform-specific differences among windowing systems.

119. What is the Collection interface?
The Collection interface provides support for the implementation of a mathematical bag - an unordered collection of objects that may contain duplicates.

120. What modifiers can be used with a local inner class?
A local inner class may be final or abstract.

121. What is the difference between static and non-static variables?
A static variable is associated with the class as a whole rather than with specific instances of a class. Non-static variables take on unique values with each object instance.

122. What is the difference between the paint() and repaint() methods?
The paint() method supports painting via a Graphics object. The repaint() method is used to cause paint() to be invoked by the AWT painting thread.

123. What is the purpose of the File class?
The File class is used to create objects that provide access to the files and directories of a local file system.

124. Can an exception be rethrown?
Yes, an exception can be rethrown.

125. Which Math method is used to calculate the absolute value of a number?
The abs() method is used to calculate absolute values.

126. How does multithreading take place on a computer with a single CPU?
The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially.

127. When does the compiler supply a default constructor for a class?
The compiler supplies a default constructor for a class if no other constructors are provided.

128. When is the finally clause of a try-catch-finally statement executed?
The finally clause of the try-catch-finally statement is always executed unless the thread of execution terminates or an exception occurs within the execution of the finally clause.

129. Which class is the immediate superclass of the Container class?
Component

130. If a method is declared as protected, where may the method be accessed?
A protected method may only be accessed by classes or interfaces of the same package or by subclasses of the class in which it is declared.

131. How can the Checkbox class be used to create a radio button?
By associating Checkbox objects with a CheckboxGroup.

132. Which non-Unicode letter characters may be used as the first character of an identifier?
The non-Unicode letter characters $ and _ may appear as the first character of an identifier

133. What restrictions are placed on method overloading?
Two methods may not have the same name and argument list but different return types.

134. What happens when you invoke a thread's interrupt method while it is sleeping or waiting?
When a task's interrupt() method is executed, the task enters the ready state. The next time the task enters the running state, an InterruptedException is thrown.

135. What is casting?
There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.

136. What is the return type of a program's main() method?
A program's main() method has a void return type.

137. Name four Container classes.
Window, Frame, Dialog, FileDialog, Panel, Applet, or ScrollPane

138. What is the difference between a Choice and a List?
A Choice is displayed in a compact form that requires you to pull it down to see the list of available choices. Only one item may be selected from a Choice. A List may be displayed in such a way that several List items are visible. A List supports the selection of one or more List items.

139. What class of exceptions are generated by the Java run-time system?
The Java runtime system generates RuntimeException and Error exceptions.

140. What class allows you to read objects directly from a stream?
The ObjectInputStream class supports the reading of objects from input streams.

141. What is the difference between a field variable and a local variable?
A field variable is a variable that is declared as a member of a class. A local variable is a variable that is declared local to a method.

142. Under what conditions is an object's finalize() method invoked by the garbage collector?
The garbage collector invokes an object's finalize() method when it detects that the object has become unreachable.

143. How are this () and super () used with constructors?
this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.

144. What is the relationship between a method's throws clause and the exceptions that can be thrown during the method's execution?
A method's throws clause must declare any checked exceptions that are not caught within the body of the method.

145. What is the difference between the JDK 1.02 event model and the event-delegation model introduced with JDK 1.1?
The JDK 1.02 event model uses an event inheritance or bubbling approach. In this model, components are required to handle their own events. If they do not handle a particular event, the event is inherited by (or bubbled up to) the component's container. The container then either handles the event or it is bubbled up to its container and so on, until the highest-level container has been tried.
In the event-delegation model, specific objects are designated as event handlers for GUI components. These objects implement event-listener interfaces. The event-delegation model is more efficient than the event-inheritance model because it eliminates the processing required to support the bubbling of unhandled events.

146. How is it possible for two String objects with identical values not to be equal under the == operator?
The == operator compares two objects to determine if they are the same object in memory. It is possible for two String objects to have the same value, but located indifferent areas of memory.

147. Why are the methods of the Math class static?
So they can be invoked as if they are a mathematical code library.

148. What Checkbox method allows you to tell if a Checkbox is checked?
getState()

149. What state is a thread in when it is executing?
An executing thread is in the running state.

150. What are the legal operands of the instanceof operator?
The left operand is an object reference or null value and the right operand is a class, interface, or array type.

151. How are the elements of a GridLayout organized?
The elements of a GridBad layout are of equal size and are laid out using the squares of a grid.

152. What an I/O filter?
An I/O filter is an object that reads from one stream and writes to another, usually altering the data in some way as it is passed from one stream to another.

153. If an object is garbage collected, can it become reachable again?
Once an object is garbage collected, it ceases to exist. It can no longer become reachable again.

154. What is the Set interface?
The Set interface provides methods for accessing the elements of a finite mathematical set. Sets do not allow duplicate elements.

155. What classes of exceptions may be thrown by a throw statement?
A throw statement may throw any expression that may be assigned to the Throwable type.

156. What are E and PI?
E is the base of the natural logarithm and PI is mathematical value pi.

157. Are true and false keywords?
The values true and false are not keywords.

158. What is a void return type?
A void return type indicates that a method does not return a value.

159. What is the purpose of the enableEvents() method?
The enableEvents() method is used to enable an event for a particular object. Normally, an event is enabled when a listener is added to an object for a particular event. The enableEvents() method is used by objects that handle events by overriding their event-dispatch methods.

160. What is the difference between the File and RandomAccessFile classes?
The File class encapsulates the files and directories of the local file system. The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.

161. What happens when you add a double value to a String?
The result is a String object.162. What is your platform's default character encoding?
If you are running Java on English Windows platforms, it is probably Cp1252. If you are running Java on English Solaris platforms, it is most likely 8859_1..

163. Which package is always imported by default?
The java.lang package is always imported by default.

164. What interface must an object implement before it can be written to a stream as an object?
An object must implement the Serializable or Externalizable interface before it can be written to a stream as an object.

165. How are this and super used?
this is used to refer to the current object instance. super is used to refer to the variables and methods of the superclass of the current object instance.

166. What is the purpose of garbage collection?
The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources may be reclaimed and
reused.

167. What is a compilation unit?
A compilation unit is a Java source code file.

168. What interface is extended by AWT event listeners?
All AWT event listeners extend the java.util.EventListener interface.

169. What restrictions are placed on method overriding?
Overridden methods must have the same name, argument list, and return type.
The overriding method may not limit the access of the method it overrides.
The overriding method may not throw any exceptions that may not be thrown
by the overridden method.

170. How can a dead thread be restarted?
A dead thread cannot be restarted.

171. What happens if an exception is not caught?
An uncaught exception results in the uncaughtException() method of the thread's ThreadGroup being invoked, which eventually results in the termination of the program in which it is thrown.

172. What is a layout manager?
A layout manager is an object that is used to organize components in a container.

173. Which arithmetic operations can result in the throwing of an ArithmeticException?
Integer / and % can result in the throwing of an ArithmeticException.

174. What are three ways in which a thread can enter the waiting state?
A thread can enter the waiting state by invoking its sleep() method, by blocking on I/O, by unsuccessfully attempting to acquire an object's lock, or by invoking an object's wait() method. It can also enter the waiting state by invoking its
(deprecated) suspend() method.

175. Can an abstract class be final?
An abstract class may not be declared as final.176. What is the ResourceBundle class?
The ResourceBundle class is used to store locale-specific resources that can be loaded by a program to tailor the program's appearance to the particular locale in which it is being run.

177. What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?
The exception propagates up to the next higher level try-catch statement (if any) or results in the program's termination.

178. What is numeric promotion?
Numeric promotion is the conversion of a smaller numeric type to a larger numeric type, so that integer and floating-point operations may take place. In numerical promotion, byte, char, and short values are converted to int
values. The int values are also converted to long values, if necessary. The long and float values are converted to double values, as required.

179. What is the difference between a Scrollbar and a ScrollPane?
A Scrollbar is a Component, but not a Container. A ScrollPane is a Container. A ScrollPane handles its own events and performs its own scrolling.

180. What is the difference between a public and a non-public class?
A public class may be accessed outside of its package. A non-public class may not be accessed outside of its package.

181. To what value is a variable of the boolean type automatically initialized?
The default value of the boolean type is false.

182. Can try statements be nested?
Try statements may be tested.

183. What is the difference between the prefix and postfix forms of the ++ operator?
The prefix form performs the increment operation and returns the value of the increment operation. The postfix form returns the current value all of the expression and then performs the increment operation on that value.

184. What is the purpose of a statement block?
A statement block is used to organize a sequence of statements as a single statement group.

185. What is a Java package and how is it used?
A Java package is a naming context for classes and interfaces. A package is used to create a separate name space for groups of classes and interfaces. Packages are also used to organize related classes and interfaces into a single API unit and to control accessibility to these classes and interfaces.

186. What modifiers may be used with a top-level class?
A top-level class may be public, abstract, or final.

187. What are the Object and Class classes used for?
The Object class is the highest-level class in the Java class hierarchy. The Class class is used to represent the classes and interfaces that are loaded by a Java program.

188. How does a try statement determine which catch clause should be used to handle an exception?
When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the exception is executed.
The remaining catch clauses are ignored.

189. Can an unreachable object become reachable again?
An unreachable object may become reachable again. This can happen when the object's finalize() method is invoked and the object performs an operation which causes it to become accessible to reachable objects.

190. When is an object subject to garbage collection?
An object is subject to garbage collection when it becomes unreachable to the program in which it is used.

191. What method must be implemented by all threads?
All tasks must implement the run() method, whether they are a subclass of Thread or implement the Runnable interface.

192. What methods are used to get and set the text label displayed by a Button object?
getLabel() and setLabel()

193. Which Component subclass is used for drawing and painting?
Canvas

194. What are synchronized methods and synchronized statements?
Synchronized methods are methods that are used to control access to an object. A thread only executes a synchronized method after it has acquired the lock for the method's object or class. Synchronized statements are similar to synchronized methods. A synchronized statement can only be executed after a thread has acquired the lock for the object or class referenced in the synchronized statement

195. What are the two basic ways in which classes that can be run as threads may be defined?
A thread class may be declared as a subclass of Thread, or it may implement the Runnable interface.

196. What are the problems faced by Java programmers who don't use layout managers?
Without layout managers, Java programmers are faced with determining how their GUI will be displayed across multiple windowing systems and finding a common sizing and positioning that will work within the constraints imposed by each windowing system.

197. What is the difference between an if statement and a switch statement?
The if statement is used to select among two alternatives. It uses a boolean expression to decide which alternative should be executed. The switch statement is used to select among multiple alternatives. It uses an int expression to determine which alternative should be executed.

VB Interview Questions

What are the three main differences between flexgrid control and dbgrid(Data bound Grid) control

The Microsoft FlexGrid (MSFlexGrid) control displays and operates on tabular data. It allows complete flexibility to sort, merge, and format tables containing strings and pictures. When bound to a Data control, MSFlexGrid displays read-only data.Adaptation to existing Visual Basic code for the data-bound grid (DBGrid).

dbgrid is A spreadsheet-like bound control that displays a series of rows and columns representing records and fields from a Recordset object.


The data grids are bound controls; that is, they require a data source that actually connects to a database and retrieves their data. And it seems that the root of the problem with DBGrid is that there's no data source that can be readily included along with the DBGrid control.
In Visual Basic, the solution is simply to include the Data Control on the same form as DBGrid. But the Data Control is an intrinsic control; it's unavailable to anything outside of the Visual Basic environment itself. and VB 6.0 has a new set of data controls (DataGrid, DataList, DataCombo, MSHFlexGrid, MSFlexGrid) that once again are bound controls. Unlike DBGrid, though, they support OLE DB, and therefore rely on the an ADO Data Source (and in particular the ActiveX Data Objects Data Control, or ADO DC) for data access. Unlike the Data Control, the ADO
DC is a custom control (that is, an .OCX) that can be added to any project. In short, if you add ADO DC to your project along with the
DataGrid control.

ActiveX and Types of ActiveX Components in VB ?

Standard EXE
ActiveX EXE
ActiveX DLL
ActiveX document
ActiveX Control

What is difference between inprocess and out of process ?

An in-process component is implemented as a DLL, and runs in the same process space as its client app, enabling the most efficient communication between client and component.Each client app that uses the component starts a new instance of it.

An out of process component is implemented as an EXE, and unlike a dll, runs in its own process space. As a result, exe's are slower then dll's
because communications between client and component must be marshalled across process boundaries. A single instance of an out of process component can service many clients.
Advantage of ActiveX Dll over Active Exe ?

ACTIVEX DLL:
An in-process component, or ActiveX DLL, runs in another application’s process. In-process components are used by applications or other in-process components. this allows you to wrap up common functionality (like an ActiveX Exe).

ACTIVEX EXE:
An out-of-process component, or ActiveX EXE, runs in its own address space. The client is usually an application running in another process.The code running in an ActiveX Exe is running in a separate process space. You would usually use this in N-Tier programming.

An ActiveX EXE runs out of process while an ActiveX DLL runs in the same process space as VB app. Also, and ActiveX EXE can be run independent of your application if desired.

Explain single thread and multithread thread apartments

All components created with Visual Basic use the apartment model, whether they’re single-threaded or multithreaded. A single-threaded component has only one apartment, which contains all the objects the component provides.

This means that a single-threaded DLL created with Visual Basic is safe to use with a multithreaded client. However, there’s a performance trade-off for this safety. Calls from all client threads except one are marshaled, just as if they were out-of-process calls.

What is a Component?

If you compile an ActiveX dll, it becomes a component.
If you compile an ActiveX Control, it becomes both a component and a control. Component is a general term used to describe code that's grouped by functionality. More specifically, a component in COM terms is a compiled collection of properties/methods and events.

Typically a component is loaded into your project via the References whereas an ActiveX Control is loaded into your project via "components".

What is meant by "Early Binding" and "Late Binding"? Which is better?

Early binding and late binding refer to the method used to bind an interface's properties and methods to an object reference (variable). Early binding uses type library information at design time to reference procedures, while late binding handles this at run time. Late binding
handles this by interrogating the reference before each call to insure that it supports a particular method. Since every call to a late bound
object actually requires two calls

("Do you do this?" followed by "Okay, do it then"), late binding is much less efficient than early binding. Except where early binding is not supported (ASP, scripting, etc.), late binding should only be used in very special cases.

It is a common misconception that any code using the CreateObject function instead of Set = New is using late binding. This is not the case. The type declaration of the object variable determines whether
it is late or early bound, as in the following:

Dim A As Foo
Dim B As Foo
Dim C As Object
Dim D As Object

Set A = New Foo 'Early Bound
Set B = CreateObject("FooLib.Foo") 'Early Bound
Set C = CreateObject("FooLib.Foo") 'Late Bound
Set D = New Foo 'Late Bound
What are the Advantages of disconnected recordsets?

A disconnected Recordset, as its name implies, is a Recordset that lacks a connection.

seen that a Recordset that does not have a database connection can be very useful as a tool in your programming. It can save you time and effort and make your code more scalable.

In order to create a disconnected Recordset two Recordset properties must be set appropriately.
It is a requirement that the CursorLocation property is set to adUseClient and the LockType property is set to adLockBatchOptimistic. Note that the CursorType will default to adUseStatic if we don't explicitly state that it should be set to adUseClient.) i.e

rst.LockType = adLockBatchOptimistic
rst.CursorLocation = adUseClient

However, we've recently discovered that these steps aren't necessary. VB automatically assigns batch optimistic locking to newly created,
connectionless recordsets. And, of course, without a connection, a recordset can't have any other cursor but a client-side one. To create one of these structures, then, the only thing you need do is create
the object variable instance. After that, you can simply begin adding fields to the construct.

To add fields, you use the Fields collection's Append method. This method requires two parameters , the field name and the field data type. So, to create a connectionless recordset with two fields,you'd use code similar to:

Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset

rst.Fields.Append "CustID", adVarChar
rst.Fields.Append "CustName", adVarChar

Additional, optional Append method parameters include DefinedSize and Attrib. The DefinedSize argument takes the size of the field. Fill the Attrib parameter with constants that define additional field characteristics, such as whether it will allow null values or is updatable.
Since, in our technique, we want the fields to mirror the structure of the original recordset, we'll simply use existing values for these parameters.

Disconnected Recordsets, first available with ADO 2.0, are the most commonly used mechanism to retrieve a Recordset and open a connection for only the necessary amount of time, thus increasing scalability. They are call disconnected because the connection to the database is closed.
The collections, properties, and methods of a disconnected Recordset are still available even though the connection is closed. This frees up server resources, given that the number of open connections is limited and database locking is a non-issue.

What are Benefits of wrapping database calls into MTS transactions?

If database calls are made within the context of a transaction, aborting the transaction will undo and changes that occur within that transaction.
This removes the possibility of stranded, or partial data. Transaction that uses the Microsoft® Transaction Server (MTS) environment. MSMQ implicitly uses the current MTS transaction if one is available.

BENIFTIS OF USING MTS :
Database Pooling, Transactional operations, Deployment, Security, Remote Execution This allows MTS to reuse database connections. Database connections are put to ?sleep? As opposed to being created and destroyed and are activated upon request.


How to register a component?

Compiling the component, running REGSVR32 MyDLL.dll

Controls which do not have events ?

Shape and line controls are useful for drawing graphical elements on
the surface of a form. These controls don't support any events; they
are strictly for decorative purposes.

EXTRA INFO
The image, shape and line controls are considered to be lightweight controls; that is, they support only a subset of the properties, methods, and events found in the picture box. Because of this, they typically require less system resources and load faster than the picture box control.


What are the Control Categories

a)Intrinsic controls:
such as the command button and frame controls. These controls are contained inside the Visual Basic .exe file. Intrinsic controls are always included in the toolbox

b)ActiveX controls:
which exist as separate files with a .ocx file name extension. These include controls that are available in all editions of Visual Basic (DataCombo, DataList controls, and so on) and those that are available only in the Professional and Enterprise editions (such as Listview, Toolbar, Animation, and Tabbed Dialog). Many third-party ActiveX controls are also available.

c)Insertable Objects:
such as a Microsoft Excel Worksheet object containing a list of all your company's employees, or a Microsoft Project Calendar object containing the scheduling information for a project. Since these can
be added to the toolbox, they can be considered controls.Some of these objects also support Automation (formerly called OLE Automation),which allows you to program another application's objects from within a Visual Basic application.

DIFF between Image and Picture box controls?

The sizing behavior of the image control differs from that of the picture box. It has a Stretch property while the picture box has an AutoSize property. Setting the AutoSize property to True causes a picture box to resize to the dimensions of the picture; setting it to False causes the picture to be cropped (only a portion of the picture is visible). When set to False (the default) , the Stretch property of the image control causes it to resize to the dimensions of the picture.
Setting the Stretch property to True causes the picture to resize to the size of the image control, which may cause the picture to appear
distorted.


Default property of datacontrol ?
connect property

Define the scope of Public, Private, Friend procedures?

The set of public variables, methods, properties, and events described in a class module define the interface for an object. The interface consists of the object members that are available to a programmer who's using the object from code.

You can create private variables, methods, properties, and events that are used by other procedures within the class module but are not part of the object's public interface. Additionally, constants user-defined types, and Declare statements within a class module must always be private.

The Friend keyword makes a procedure private to the project: The procedure is available to any code running within the project, but it is not available to a referencing project.
Describe Database Connection pooling relative to MTS ?

This allows MTS to reuse database connections. Database connections are put to ?sleep? as opposed to being created and destroyed and are activated upon request.

Object pooling is an important design concept required for high-performance applications. A performance optimization based on using collections of preallocated resources, such as objects or database connections. Pooling results in more efficient resource allocation.

Difference between a function and a subroutine ?

A function accepts any number of parameters (possibly zero), does something with them, and returns a value. A subroutine is performs an action, but doesn't return a value.

There are two differences between a function and a subroutine: A)How they are invoked. B)How they are accessed.

A function call has the following syntax ::
function(arg1, arg2, ...)
where: function Is the name of the function. arg1, arg2, ... Are the arguments.

A subroutine call has the following syntax
::subroutine (arg1, arg2, ... {outputfield|'format'})
where: subroutine -->Is the name of the subroutine. arg1, arg2, ... Are the arguments. {outputfield|'format'} Is the name of the output field or its format.

In addition, on some platforms, the functions are available immediately; whereas, the subroutines are available in a special subroutine library that you must access.
Difference between Linked Object and Embedded Object?

Embedding objects -
When you embed an object, a copy of the object is inserted into the destination document. There's no link to the original file. When you change information in the source document, no changes will be reflected in the destination document. The actual data for the object is stored within the destination file. To make changes to the embedded object, double click it and it will launch the original application the source file was in.

Linking objects -
Information is updated when you modify the original source file when you use a linked object. This dynamic updating is very handy for things such as the aforementioned monthly report. You can open up the Excel spreadsheet that is referenced within your Word document.Make changes to the spreadsheet, close Excel, and when you open your Word document... viola! The changes are already there. If that object is linked to ten other Word files, the changes are already in those ten files, too! actually linking or embedding an object is fast and easy.

Difference between listbox and combo box?

A LISTBOX CONTROL displays a list of items from which the user can select one or more. If the number of items exceeds the number that can be displayed, a scroll bar is automatically added to the ListBox control. A COMBOX CONTROL combines the features of a text box and a list box. This control allows the user to select an item either by typing text into the combo box, or by selecting it from the list.
DIFF::Generally, a combo box is appropriate when there is a list of suggested choices, and a list box is appropriate when you want to limit input to what is on the list. A combo box contains an edit field, so choices not on the list can be typed in this field.

Difference between Dynaset and Snapshot?

All Recordset objects are constructed using records (rows) and fields (columns). There are five types of Recordset objects:

Table-type Recordset ::
representation in code of a base table that you can use to add, change, or delete records from a single database table (Microsoft Jet workspaces only).

Dynaset-type Recordset ::
the result of a query that can have updatable records. A dynaset-type Recordset object is a dynamic set of records that you can use to add, change, or delete records from an underlying database table or tables. A dynaset-type Recordset object can contain fields from one or more tables in a database. This type corresponds to an ODBC keyset cursor.

Snapshot-type Recordset ::
a static copy of a set of records that you can use to find data or generate reports. A snapshot-type Recordset object can contain fields from one or more tables in a database but can't be updated. This type corresponds to an ODBC static cursor.

Forward-only-type Recordset::
identical to a snapshot except that no cursor is provided. You can only scroll forward through records. This improves performance in situations where you only need to make a single pass through a result set. This type corresponds to an ODBC forward-only cursor.

Dynamic-type Recordset ::
a query result set from one or more base tables in which you can add, change, or delete records from a row-returning query. Further, records other users add, delete, or edit in the base tables also appear in your Recordset. This type corresponds to an ODBC dynamic cursor (ODBCDirect workspaces only).
Difference Listindex and Tab index?

LIST INDEX::
Returns or sets theindex of the currently selected item in the control. Not available at design time.Default LIST INDEX IS -1 for ComboBox, DirListBox, and DriveListBox controls
TAB INDEX::
Returns or sets thetab order of most objects within their parent form. Visual Basic automatically renumbers the TabIndex of other controls to reflect insertions and deletions. You can make changes atdesign time using theProperties window or atrun time in code.The TabIndex property isn't affected by the ZOrder method.

Difference modal and moduless window?

MODAL forms are forms which require user input before any other actions can be taken place. In other words, a modal form has exclusive focus in that application until it is dismissed. When showing a modal form, the
controls outside this modal form will not take user interaction until the form is closed. The internal MsgBox and InputBox forms are examples of modal forms. To show a form modally, use the syntax:
MyForm.SHOW.vbModal ' a predeclared constant for 1
MODELESS forms are those which are shown but do not require immediate user input. MDI child forms are always modeless. To show a form modeless, use the syntax:: MyForm.SHOW

Difference Object and Class?
Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.
1)A Class is static. All of the attributes of a class are fixed before,during, and after the execution of a program. The attributes of a class don't change.The class to which an object belongs is also (usually) static. If a particular object belongs to a certain class at the time that it is created then it almost certainly will still belong to that class right up until the time that it is destroyed.
2)An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed. Also during that lifetime, the attributes of the object may undergo significant change.So basically the difference between a class and an object is that a class is a general concept while objects are the specific and real instances that embody that concept. When creating an object oriented program we define the classes and the relationships between the classes . We then execute the program to create, update, and destroy the objects which are the specific realization of these classes.

Difference Query unload and unload in form?
Occurs before a form or application closes. When an MDIForm object closes, the QueryUnload event occurs first for the MDI form and then in all MDI child forms. If no form cancels the QueryUnload event, the Unload event occurs first in all other forms and then in an MDI form. When a child form or a Form object closes, the QueryUnload event in that form occurs before the form's Unload event.

Difference Declaration and Instantiation an object?
Dim obj as OBJ.CLASS with either
Set obj = New OBJ.CLASS or
Set obj = CreateObject(?OBJ.CLASS?) or
Set obj = GetObject( ,? OBJ.CLASS?)
or
Dim obj as New OBJ.CLASS

Set object = Nothing
ensure the object is release from the memory.

If this object is a form, you can add set myform = nothing and Form_Unload() event.Maintain a habit of remove the object by using set object = nothing which will benefit at last.
Visual Basic is supposed to automatically release objects when they go out of scope. To free up some memory usage, you can set the object to
nothing.

Draw and explain Sequence Modal of DAO
Connection,Container,Database,DBEngine,Document,Error,Field,Group,Index
Parameter Property,QueryDef,Recordset,Relation,TableDef,User,Workspace

Version |Year |Significant Changes and New Features of Visual Basic?
1 1991 initial release, with drag and drop GUI creation
2 1992 ODBC, object variables
3 1993 Access Engine, OLE 2.0, Crystal Reports, new tools and controls
4 1995 classes, OCXs
5 1997 compiler, ActiveX controls
6 1998 web support, windowless controls, designers, data sources
.NET 2001 XML, SOAP, inheritance, structured exception handling

How can objects on different threads communicate with one another?
Processes communicate with one another through messages, using Microsoft's Remote Procedure Call (RPC) technology to pass information to one another. There is no difference to the caller between a call coming from a process on a remote machine and a call coming from another process on the same machine.

Multithreaded applications must avoid two threading problems: deadlocks and races. A deadlock occurs when each thread is waiting for the other to do something

How can you force new objects to be created on new threads?
The CreateThread function creates a thread to execute within the virtual address space of the calling process.

To create a thread that runs in the virtual address space of another process Creating a new thread is as easy as declaring it and supplying it with a delegate to the method where the thread is to start. When you are ready to begin execution on the thread, call the Thread.Start Method. There are special considerations involved when working with multiple threads of execution.

To create a new thread of execution

Declare the thread.
******************
' Visual Basic
Dim myThread as System.Threading.Thread

// C#
System.Threading.Thread myThread;

Instantiate the thread with the appropriate delegate for the starting point of the thread. Use the AddressOf operator to create the delegate
in Visual Basic, or create a new ThreadStart object in C#.
*******************
' Visual Basic
myThread = New System.Threading.Thread(AddressOf
myStartingMethod)

// C#
myThread = new System.Threading.Thread(new
System.Threading.ThreadStart(myStartingMethod));

call the Thread.Start method to start the thread.
*******************
' Visual Basic
myThread.Start()

// C#
myThread.Start();

How does a DCOM component know where to instantiate itself?
To create a remote instance of a script component, call the CreateObject method, passing it the name of the remote computer as a parameter. If the remotable attribute of a script component's element has been set to "true," the script component can be instantiated remotely from another computer using Distributed COM (DCOM).
Both computers must have basic DCOM installed. Note The ability to use CreateObject for instantiating remote script components requires Visual Basic 6.0 or later or VBScript 5.0 or later. The following Visual Basic example shows how to do this on a computer named "myserver":

Set newS = CreateObject("Component.MyComponent", "myserver")
Note There can be a slight delay when you first instantiate a remote script component while DCOM establishes communication between the computers.

1. You can specify the machine on which you want to create the remote server object in DCOM config ('dcomcnfg').

2. You can specify the machine name when instantiating the remote server object.
In C you can do this with a call to CoGetClassObject or CoCreateInstanceEx (instead of CoCreateInstance, which does not allow you to specify the name of the machine).
In VB you can specify the name in one of the parameters in the call to CreateObject

What type of multi-threading does VB6 implement?
Apartment model threading

How to register a component?
Compiling the component, running REGSVR32 MyDLL.dll

What is Database Connection pooling (relative to MTS)
This allows MTS to reuse database connections. Database connections are
put to "sleep" As opposed to being created and destroyed and are activated upon request.

What is the tool used to configure the port range and protocols for DCOM communications?
DCOMCONFIG.EXE

What is a Type Library and what is it's purpose ?
The type library may represent another Visual Basic project, or any other executable component that exposes a type library.
Visual Basic creates type library information for the classes you create, provides type libraries for the objects it includes, and lets you access the type libraries provided by other applications.

What are binary and project compatibility?
Visual Basic’s Version Compatibility feature is a way of enhancing your components while maintaining backward compatibility with programs that were compiled using earlier versions. The Version Compatibility box, located on the Component tab of the Project Properties dialog box, contains three options:
No Compatibility:
Each time you compile the component, new type library information is generated, including new class IDs and new interface IDs. There is no relation between versions of a component, and programs compiled to use one version cannot use subsequent versions.

Project Compatibility:
Each time you compile the component the type library identifier is kept, so that your test projects can maintain their references to the component project. All class IDs from the previous version are maintained; interface IDs are changed only for classes that are no longer binary-compatible with their earlier counterparts. Note This is a change in Project Compatibility from Visual Basic 5.0, where all class IDs and interface IDs in the project changed if any one class was no longer binary-compatible.

Important For the purpose of releasing compatible versions of a component, Project Compatibility is the same as No Compatibility.

Binary Compatibility:
When you compile the project, if any binary-incompatible changes are detected you will be presented with a warning dialog. If you choose to accept the warning, the component will retain the type library identifier and the class IDs. Interface IDs are changed only for classes that are no longer binary-compatible. This is the same behavior as Project Compatibility.
If, however, you choose to ignore the warning, the component will also maintain the interface IDs. This option is only available when the compiler determines that the change was in the procedure ID or signature of a method.

Note:: When people talk about Version Compatibility, they’re usually referring to Binary Compatibility.
How to set a shortcut key for label?

object.KeyLabel(keycode) [= string]
You would probably create the menu item as follows:
.Add "keyFile", , , "E&xit", , vbAltMask + vbCtrlMask, vbKeyEnd
The default key label for vbKeyEnd is "End". Thus, the shortcut string will be created by default as "Ctrl+Alt+End".

Name the four different cursor and locking types in ADO and describe them briefly ?

CURSORS
The cursor types are listed from least to most resource intensive.
Forward Only - Fastest, can only move forward in recordset
Static - Can move to any record in the recordset. Data is static and never changes.
KeySet - Changes are detectable, records that are deleted by other users are unavailable, and records created by other users are not detected Dynamic - All changes are visible.

LOCKING TYPES
LockPessimistic - Locks the row once after any edits occur.
LockOptimistic - Locks the row only when Update is called.
LockBatchOptimistic - Allows Batch Updates.
LockReadOnly - Read only. Cannot alter the data.


Name the different compatibility types when creating a COM component.
No Compatibility - New GUID (Globally Unique Identifier) created, references from other components will not work Project Compatibility - Default for a new component
Binary Compatibility - GUID does not change references from other components will work
Why is it important to use source control software for source code?
Modification history. Code ownership: Multiple people cannot modify the same code at the same time.

List the ADO objects?
Connection - Connects to a data source; contains the Errors collection
Command - Executes commands to the data source. The only object that can accept parameters for a stored procedure Recordset - The set of data returned from the database.
Under the ADO Command Object, The Parameters collection. collection is responsible for input to stored procedures.

What two methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?
SetComplete and SetAbort.

What is the benefit of wrapping database calls into MTS transactions?
Aborting the transaction will undo and changes that occur within that transaction. This removes the possibility of stranded, or partial data

Describe and In Process vs. Out of Process component. Which is faster?
An in-process component is implemented as a DLL, and runs in the same process space as its client app, enabling the most efficient communication between client and component. Each client app that uses the component starts a new instance of it.
An out of process component is implemented as an EXE, and unlike a dll, runs in its own process space. As a result, exe's are slower then dll's because communications between client and component must be marshaled across process boundaries. A single instance of an out of process component can service many clients.How would you declare and raise custom events in a class?
a) Public Event OnVarChange();
b) RaiseEvent OnVarChange[(arg1, arg2, ... , argn)]

What is the difference between a Property Let and Property Set procedure?
Let - for simple variable
Set - for object

What is the difference between ANSI and UNICODE strings when passed as arguments to a DLL?
ANSI - one byte for a char UNICODE - two bytes per char - works only on NT

What is the difference in passing values ByRef or ByVal to a procedure?
ByRef -pass the address (for string -address of address of first byte)
BY REF IS VERY USEFULL When the contents itself are being modified, when there is large data. Multiple arguments are needed to be returned, instead they can be passed as reference.
ByVal -pass the value (for string -it is the address of first byte)

What is the purpose of the DoEvents command?
Fields execution so that the operating system can process other events. Returns number of open forms. Useful for things like ‘cancel search’ in Windows

Name and define the logical tiers in a traditional 3-tiered architecture?
Presentation logic - front end (HTML, Visual Basic forms)
Business Logic - Applications and components that encapsulate business logic
Data end - databases to store data

What is the difference between a PictureBox and Image control?
Image Control - Use this to display a picture. Use it over the PictureBox because it takes less operating system resources
PictureBox- While it can display pictures, it also acts as an area on which you can print text and graphics. Use it for home-grown graphics or print previews

Under which circumstance does a VB application ignore a Timer event?
When the system is really busy doing something else and when DoEvents is being executed

What does the NewIndex property return?
Used to retrieve the index of the item most recently added to a ListBox or ComboBox control

What is the purpose of the ClipControls property on a form or container?
Returns or sets a value that determines whether graphics methods in Paint events repaint the entire object or only newly exposed areas. Also determines whether the Microsoft Windows operating environment creates a clipping region that excludes non-graphical controls contained by the object. Read-only at run time.
What is the purpose of the AutoRedraw property on a form or container?
Setting AutoRedraw to True automatically redraws the output from these methods in a Form object or PictureBox control when, for example, the object is resized or redisplayed after being hidden by another object

Have you ever used Collections? Collection Classes?
A collection is a set of Repository objects that are all connected to a common source object via a relationship collection. A collection provides a way to connect a group of dependent objects with an object that ‘contains’ them. For example, an Invoice object might have a collection of LineItem objects.

What version control systems have you used?
TLIB 16-Bit add-in

How about any other database engines?
Apollo OLE DB ,Apollo Server ,Apollo SQL ,FUNCky ,R&R Report Writer

What kind of components can you use as DCOM servers?
actve-x components, Com

Dim x, y as integer. What is x and y data type?
X as variant and y as integer.

What is the size of the variant data type?
The Variant data type has a numeric storage size of 16 bytes and can contain data up to the range of a Decimal, or a character storage size of 22 bytes (plus string length), and can store any character text.

What is the return type of Instr and Strcmp?
Instr – integer (Numeric position)
Strcmp - integer ( if both the string are equal they result = 0)
Strcmp (Str1, Str2, Comparetype)
Comparing mode = 0 – Binary Comparing
1 – Textual Comparing

What is the max size allowed for Msgbox Prompt and Input Box?
1024

Max label caption length. –
2,048

Max Text box length –
32,000

Max Control Names length –
255.

Extension in Visual Basic
Frm, bas, cls, res, vbx, ocx, frx, vbp, exe

What is frx?
When some controls like grid and third party control placed in our application then it will create frx in run time.

Name some date function
Dateadd(), Datediff(), Datepart(), Cdate()

What will be the result for 15/4 and 15\4
15/4 = 3.75 and 15\4 = 3

What is keyword used to compare to objects?
ISOperator – Returns Boolean.

How many procedures are in VB?
2. function and sub procedures. Function Will return value but a sub procedure wont return values…

Where will we give the option explicit keyword and for what?
In the general declarations section. To trap undeclared variables.

What is Friend Variable?
Scope sharable between projects.What is binding? What are types of binding?
Assigning variable with defined memory space. Late Binding - Memory size is allotted in later stage.
Ex:- Dim x as object
Early Binding - Memory size is allotted while declaring itself. New Key word is important.
Ex:- Dim x as New Object

What is the difference between Property Get, Set and Let.
Set – Value is assigned to ActiveX Object from the form.
Let – Value is retried to ActiveX Object from the form.
Get- Assigns the value of an expression to a variable or property.

What is Mask Edit and why it is used?
Control. Restricted data input as well as formatted data output.

Drag and Drop state numbers and functions.
State 0 – Source control is being dragged with the range of a target.
1 – Out of the range of a target.
2 – One positon in the target to another.

What are the type of validation available in VB?
Field, Form

With in the form we want to check all the text box control are typed or not? How?
For each currentcontrol in controls if typeof currentcontrol is TextBox then end if next

What is control array and How many we can have it with in the form?
Group of control share the same name. Max 32, 767.What is the default model of the form? And what is it number?
VbModaless – 0 (Zero) – We can able to place another window above this form.

Suppose from form1 to form2 object property settings will arise to ?
Invalid procedure call or argument (Run time error – 5)

What is the diff between the Std and Class Module?
Std Global with in the project. Cls Global through out the all project only thing is we want to set the type lib. Class Modules can be Instantiated.

Different type of Instantiation?
Private – Only for the Specific Module.
Public not creatable – Private & Public
Multi Use - Variable we have to declare.
Single Use – Not possible through dll.
Global Multiuse – Have variable not Required to
Declare. Global Single Use - Only for exe.
How to declare Dll Procedure?
Declare function "" lib "" Alias "" (Arg, …..) as Return type.

What is MDI form? MDI Styles?
We can have only one MDI form for a project. Multiple Document Interface. This form type is VBModal. We have set the Child property of the forms to True to place forms inside this MDI.
Style availables 1. VbCascade 2. VbTitle Horizontal

How many images can be placed in the image list ?
64

Diff type of Datatypes?
LOB (Large Object Data type).
CLOB (Stores Character Objects).
BLOB ( Store Binary Objects such as Graphic, Video Chips and Sound files).
BFILE(Store file pointers to LOB It may Contain filename for photo’s store on CD_ROM).

What is Zorder Method?
Object.Zorder = 1 or 0 Place a Specified mdiform form or control at the front or back of the z-order with n its Graphical Level.

What is diff between the Generic Variable and Specific Variable?
Generic Variable:Create Object Ex:-Ole-Automation . No need refer the object library.
Specific Variable: Binding Procedure Early and Late Binding ( Can be Remove from the Memory).
What are properties available in Clip Board?
No Properties Available. Only the methods they are SetText, GetText, Setdata(), Getformat(), Clear.

What is Dll?
Libraries of procedure external to the application but can be called from the application.

What is Tabstrip control? What is the starting Index value? How to locate it?
It is tab control to place our controls with in the form in multiple sheets.
Index starts with 1. And to identify
If Tabstrip1.SelectedItem.Index = 1 Then
…..
End if

Why we use Treeview Control?
To list the hierarchial list of the node objects. Such of files and Directories.

Why we need OLE-Automation? Advantages?
Enables an application to exposes objects and methods to other Applications.
No need to reserve memory. No need to write functions.
Object library that simplify programming tasks. i.e., No need to Object library. (OLB, TLB).

What is the diff between the Create Object and Get object?
Create Object - To create an instance of an object.
Get Object – To get the reference to an existing object.

Have you create Properties and Methods for your own Controls?
Properties – Public variable of a Class
Method – Public procedure of a classWhat is Collection Objects?
Similarly to arrays but is preferred over an array because of the following reasons.
1. A collection objects uses less Memory than an array.
2. It provides methods to add and delete members.
3. It does not required reason statement when objects are added or deleted.
4. It does not have boundary limitations.

What is Static Variable?
Its Scope will be available through out the life time.

Private Dim x as integer. Is it true?
No. Private cannot be used in front of DIM.

What is Implicit?
Instance of specific copy of a class with its own settings for the properties defined in that class. Note: The implicity defined variable is never equal to nothing.

What are the scope of the class?
Public , private, Friend

Can we able to set Instancing properties like Singleuse, GlobalSingleuse to ActiveXDll?
No.

In project properties if we set Unattended what is it mean?
This cannot have user interface. This can be used for the COM creation.What are the Style Properties of Combo Box?
Simple, Dropdown list – We can type and select.
Dropdown Combo – Only Drop Down.

What are the Style properties of List Box?
Simple –Single Select , Extended. – Multiple Select.

What are the different types of Dialog Box?
Predefined, Custom, User Defined.

What is Parser Bug?
It is difficult to use database objects declared in a module from within a form.

What is the Dll required for running the VB?
Vbrun300.dll

Can We create CGI scripts in VB?
Yes.

How to change the Mouse Pointer?
Screen.MousePointer = VBHourGlass/VBNormal.

How to check the condition in Msgbox?
If(Msgbox("Do you want to delete this Record",VbYesNo)=VbYes)Then End if

What is difference between datagrid and flexgrid?
Datagrid – Editable.
Flexigrid – Non-Editable. (Generally used for Read only purpose.)

What is ADO? What are its objects ?
ActiveX Data Object. ADO can access data from both flat files as well as the databases. I.e., It is encapsulation of DAO, RDO, and OLE that is why we call it as OLE-DB Technology. Objects are Connection, Record Set, Command, Parameter, field, Error, Property.

What is Dataware Control?
Any control bound to Data Control.
Ex:- Textbox, Check Box, Picture Box, Image Control, Label, List box, Combo Box, DB Combo, What are two validate with Data Control?
Data_Validate, Data_Error.

Record set types and Number available in VB?
3. 1- Dynaset, 0 – Table, 2 – Snap Shot.

Referential Integrity (Take care By jet database Engine).
Cascade Delete, Cascade Update – is done setting property of Attributes.
DbRelationDeleteCascade,
DbRelationUpdateCascade.

What are the locks available in Visual Basic?
Locking is the process by which a DBMS restricts access to a row in a multi-user environment
4 types of locks. They are
1.Batch Optimistic
2.Optimistic
3.Pessimistic
4.ReadOnly

What is the diff between RDO and ADO?
RDO is Hierarchy model where as ADO is Object model. ADO can access data from both flat files as well as the data bases. I.e., It is
encapsulation of DAO, RDO , OLE that is why we call it as OLE-DB Technology.

How can we call Stored procedure of Back End in RDO and ADO ?
In RDO – We can call using RDO Query Objects.
In ADO – We can call using Command Objects.

What is the different between Microsoft ODBC Driver and Oracle OBDC Driver?
Microsoft ODBC driver will support all the methods and properties of Visual Basic. Where as the Oracle not.

What are the Technologies for Accessing Database from Visual Basic?
DAO, Data Control, RDO, ODBCDIRECT, ADO, ODBC API.

Calling Stored Procedures in VB?
1. Calling Simply the Procedure with out Arguments "Call ProcedureName}"

If it is with Arguments Means then
Declare the Query Def qy
Set Qy as New Query def
Qy.SQL = "{Call ProcedureName(?,?,?)}"
qy(0)=val(Txt1.Text)
qy(1)=val(Txt2.Text)
qy(2)=val(Txt3.Text)
Set Rs = Qy.OpenresultSet
Txt(1)=Rs.RdoColumns(0)What is MAPI ?
Messaging Application programing Interface.

Different type of Passing Value?
By value, By ref, Optional, Param Array.
Note:- Optional keyword cannot be used while declaring arguments for a function using param array.

What are the different types of error?
Syntax Errors, Runtime , Logic.

What is Seek Method which type of record set is available this?
Only in DbOpenTables.
Syntax: rs.index = "empno"
rs.seek "=" , 10

If with our setting the rs.index then run time error will occur.What is Centralization Error Handling?
Writing funciton and calling it when error occurs.

Handling Error in Calling chain.
This will call the top most error where the error is handled.

To connect the Data Control with Back end What are all the properties to be set?
Data source Name, Record Source Name

How to trap Data Base Error?
Dim x as RDOError
X(0).Des
X(1).Number

What is view Port?
The area under which the container provides the view of the ActiveX Document is known as a view port.

What methods are used for DBGrid in unbound mode?
AddData, EditData, Readdata, WriteData.

How to increase the Date corresponding with month,date,year?
DateSerial(year(Now),Month(Now)+1,1)
Hour, min, sec, month, year, DateSerial, dateadd, datediff, weekday, datevalue, timeserial,timevalue.

Setting the Cursors.
Default Cursor – 0
ODBC Cursor (Client side) – 1
ServerSide Cursors (More Network traffic) - 2Cursor management
Client Batch – Batch up the Multiple SQL Statements in a single string and Send them to the Server at one time.

What are the record set types?
RdOpenFowardOnly 0 (Default used only for the read only purpose)
RdOpenStatic 1
RdOpenDynamic 2
RdOpenKeySet 3 (Normally used for the live project)

Diff types of Lock Types?
RdConcurReadOnly 0 (Default)
RdConcurLock 1 (Pessimistic Locking)
RdConcurRowver 2 (Optimistic Lociking)
RdConcurValues 3
RdConcurBatch 4

What are the RDO Methods and Events?
Methods Events
Begin Trans Validate
Commit Trans Reposition
Rollback Trans Error
Cancel Query Complied
Refresh
Update Controls
Update rowWhat is Static Cursor?
In ADO Snap Shot is called so.

What is Mixed Cursors?
Static + Keyset

What is FireHouse Cursors?
Forward Only Some time Updateable

What is DBSqlPassThrough?
It will By Passing the Jet Query Processor.

What is DBFailError?
Rolls Back updates if any errors Occurs.

DSN Less Connection?
"Server=Oracle; Driver={Microsoft ODBC for Oracle};"

What is RdExecDirect?
Bypasses the Creation of a stored procedure to execute the query. Does not apply to Oracle.

RdoParameter Object RdoParameterConstant
Direction RdparamInput
RdparamInputOutput
RdParamOutput
Name
Type
Value

Some more questions on VB

Prewritten tools for a user interface are provided by
a procedures
b properties
c functions
d controls.

Which one of the following is the correct syntax to make a control called Pic1 visible?

a Pic1.Visible = True
b Visible.Pic1 = True
c Visible.Pic1 = False
d Pic1.Visible = False

How many options can be selected if a Frame contains 4 Option buttons?

a 1.
b 2.
c 3.
d 4.

Which one of the following is a property of a scroll bar control?

a Interval.
b Cancel.
c ForeColor.
d Max.

The FreeFile function is used before a file is opened to

a read a file into memory
b save a record to a file
c returns the next file number
d returns the ne xt file name.

Oracle Interview Questions - Part 1

What are the components of physical database structure of Oracle database?
Oracle database is comprised of three types of files. One or more datafiles, two are more redo log files, and one or more control files.

What are the components of logical database structure of Oracle database?
There are tablespaces and database's schema objects.

What is a tablespace?
A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to grouped related logical structures together.

What is SYSTEM tablespace and when is it created?
Every Oracle database contains a tablespace named SYSTEM, which is automatically created when the database is created. The SYSTEM tablespace always contains the data dictionary tables for the entire database.

Explain the relationship among database, tablespace and data file ?
Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace.

What is schema?
A schema is collection of database objects of a user.

What are Schema Objects?
Schema objects are the logical structures that directly refer to the database's data. Schema objects include tables, views, sequences, synonyms, indexes, clusters, database triggers, procedures, functions packages and database links.

Can objects of the same schema reside in different tablespaces?
Yes.

Can a tablespace hold objects from different schemes?
Yes.

What is Oracle table?
A table is the basic unit of data storage in an Oracle database. The tables of a database hold all of the user accessible data. Table data is stored in rows and columns.

What is an Oracle view?
A view is a virtual table. Every view has a query attached to it. (The query is a SELECT statement that identifies the columns and rows of the table(s) the view uses.)

What is Partial Backup ?
A Partial Backup is any operating system backup short of a full backup, taken while the database is open or shut down.

What is Mirrored on-line Redo Log ?
A mirrored on-line redo log consists of copies of on-line redo log files physically located on separate disks, changes made to one member of the group are made to all members

What is Full Backup ?
A full backup is an operating system backup of all data files, on-line redo log files and control file that constitute ORACLE database and the parameter.

Can a View based on another View ?
Yes.

Can a Tablespace hold objects from different Schemes ?
Yes.

Can objects of the same Schema reside in different tablespace ?
Yes.

What is the use of Control File ?
When an instance of an ORACLE database is started, its control file is used to identify the database and redo log files that must be opened for database operation to proceed. It is also used in database recovery.

Do View contain Data ?
Views do not contain or store data.

What are the Referential actions supported by FOREIGN KEY integrity constraint ?
UPDATE and DELETE Restrict - A referential integrity rule that disallows the update or deletion of referenced data. DELETE Cascade - When a referenced row is deleted all associated dependent rows are deleted.

What are the type of Synonyms?
There are two types of Synonyms Private and Public.

What is a Redo Log ?
The set of Redo Log files YSDATE,UID,USER or USERENV SQL functions, or the pseudo columns LEVEL or ROWNUM.

What is an Index Segment ?
Each Index has an Index segment that stores all of its data.

Explain the relationship among Database, Tablespace and Data file?
Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace

What are the different type of Segments ?
Data Segment, Index Segment, Rollback Segment and Temporary Segment.

What are Clusters ?
Clusters are groups of one or more tables physically stores together to share common columns and are often used together.

What is an Integrity Constrains ?
An integrity constraint is a declarative way to define a business rule for a column of a table.

What is an Index ?
An Index is an optional structure associated with a table to have direct access to rows, which can be created to increase the performance of data retrieval. Index can be created on one or more columns of a table.

What is an Extent ?
An Extent is a specific number of contiguous data blocks, obtained in a single allocation, and used to store a specific type of information.

What is a View ?
A view is a virtual table. Every view has a Query attached to it. (The Query is a SELECT statement that identifies the columns and rows of the table(s) the view uses.)

What is Table ?
A table is the basic unit of data storage in an ORACLE database. The tables of a database hold all of the user accessible data. Table data is stored in rows and columns.

Can a view based on another view?
Yes.

What are the advantages of views?
- Provide an additional level of table security, by restricting access to a predetermined set of rows and columns of a table.
- Hide data complexity.
- Simplify commands for the user.
- Present the data in a different perspective from that of the base table.
- Store complex queries.

What is an Oracle sequence?
A sequence generates a serial list of unique numbers for numerical columns of a database's tables.

What is a synonym?
A synonym is an alias for a table, view, sequence or program unit.

What are the types of synonyms?
There are two types of synonyms private and public.

What is a private synonym?
Only its owner can access a private synonym.

What is a public synonym?
Any database user can access a public synonym.

What are synonyms used for?
- Mask the real name and owner of an object.
- Provide public access to an object
- Provide location transparency for tables, views or program units of a remote database.
- Simplify the SQL statements for database users.

What is an Oracle index?
An index is an optional structure associated with a table to have direct access to rows, which can be created to increase the performance of data retrieval. Index can be created on one or more columns of a table.

How are the index updates?
Indexes are automatically maintained and used by Oracle. Changes to table data are automatically incorporated into all relevant indexes.

What is a Tablespace?
A database is divided into Logical Storage Unit called tablespace. A tablespace is used to grouped related logical structures together

What is Rollback Segment ?
A Database contains one or more Rollback Segments to temporarily store "undo" information.

What are the Characteristics of Data Files ?
A data file can be associated with only one database. Once created a data file can't change size. One or more data files form a logical unit of database storage called a tablespace.

How to define Data Block size ?
A data block size is specified for each ORACLE database when the database is created. A database users and allocated free database space in ORACLE data blocks. Block size is specified in INIT.ORA file and can’t be changed latter.

What does a Control file Contain ?
A Control file records the physical structure of the database. It contains the following information.
Database Name
Names and locations of a database's files and redolog files.
Time stamp of database creation.

What is difference between UNIQUE constraint and PRIMARY KEY constraint ?
A column defined as UNIQUE can contain Nulls while a column defined as PRIMARY KEY can't contain Nulls.

What is Index Cluster ?
A Cluster with an index on the Cluster Key

When does a Transaction end ?
When it is committed or Rollbacked.

What is the effect of setting the value "ALL_ROWS" for OPTIMIZER_GOAL parameter of the ALTER SESSION command ? What are the factors that affect OPTIMIZER in choosing an Optimization approach ?
Answer The OPTIMIZER_MODE initialization parameter Statistics in the Data Dictionary the OPTIMIZER_GOAL parameter of the ALTER SESSION command hints in the statement.

What is the effect of setting the value "CHOOSE" for OPTIMIZER_GOAL, parameter of the ALTER SESSION Command ?
The Optimizer chooses Cost_based approach and optimizes with the goal of best throughput if statistics for atleast one of the tables accessed by the SQL statement exist in the data dictionary. Otherwise the OPTIMIZER chooses RULE_based approach.

How does one create a new database? (for DBA)
One can create and modify Oracle databases using the Oracle "dbca" (Database Configuration Assistant) utility. The dbca utility is located in the $ORACLE_HOME/bin directory. The Oracle Universal Installer (oui) normally starts it after installing the database server software.
One can also create databases manually using scripts. This option, however, is falling out of fashion, as it is quite involved and error prone. Look at this example for creating and Oracle 9i database:
CONNECT SYS AS SYSDBA
ALTER SYSTEM SET DB_CREATE_FILE_DEST='/u01/oradata/';
ALTER SYSTEM SET DB_CREATE_ONLINE_LOG_DEST_1='/u02/oradata/';
ALTER SYSTEM SET DB_CREATE_ONLINE_LOG_DEST_2='/u03/oradata/';
CREATE DATABASE;

What database block size should I use? (for DBA)
Oracle recommends that your database block size match, or be multiples of your operating system block size. One can use smaller block sizes, but the performance cost is significant. Your choice should depend on the type of application you are running. If you have many small transactions as with OLTP, use a smaller block size. With fewer but larger transactions, as with a DSS application, use a larger block size. If you are using a volume manager, consider your "operating system block size" to be 8K. This is because volume manager products use 8K blocks (and this is not configurable).

What are the different approaches used by Optimizer in choosing an execution plan ?
Rule-based and Cost-based.

What does ROLLBACK do ?
ROLLBACK retracts any of the changes resulting from the SQL statements in the transaction.

How does one coalesce free space ? (for DBA)
SMON coalesces free space (extents) into larger, contiguous extents every 2 hours and even then, only for a short period of time.
SMON will not coalesce free space if a tablespace's default storage parameter "pctincrease" is set to 0. With Oracle 7.3 one can manually coalesce a tablespace using the ALTER TABLESPACE ... COALESCE; command, until then use:
SQL> alter session set events 'immediate trace name coalesce level n';
Where 'n' is the tablespace number you get from SELECT TS#, NAME FROM SYS.TS$;
You can get status information about this process by selecting from the SYS.DBA_FREE_SPACE_COALESCED dictionary view.

How does one prevent tablespace fragmentation? (for DBA)
Always set PCTINCREASE to 0 or 100.
Bizarre values for PCTINCREASE will contribute to fragmentation. For example if you set PCTINCREASE to 1 you will see that your extents are going to have weird and wacky sizes: 100K, 100K, 101K, 102K, etc. Such extents of bizarre size are rarely re-used in their entirety. PCTINCREASE of 0 or 100 gives you nice round extent sizes that can easily be reused. E.g.. 100K, 100K, 200K, 400K, etc.

Use the same extent size for all the segments in a given tablespace. Locally Managed tablespaces (available from 8i onwards) with uniform extent sizes virtually eliminates any tablespace fragmentation. Note that the number of extents per segment does not cause any performance issue anymore, unless they run into thousands and thousands where additional I/O may be required to fetch the additional blocks where extent maps of the segment are stored.

Where can one find the high water mark for a table? (for DBA)
There is no single system table, which contains the high water mark (HWM) for a table. A table's HWM can be calculated using the results from the following SQL statements:
SELECT BLOCKS
FROM DBA_SEGMENTS
WHERE OWNER=UPPER(owner) AND SEGMENT_NAME = UPPER(table);
ANALYZE TABLE owner.table ESTIMATE STATISTICS;
SELECT EMPTY_BLOCKS
FROM DBA_TABLES
WHERE OWNER=UPPER(owner) AND SEGMENT_NAME = UPPER(table);
Thus, the tables' HWM = (query result 1) - (query result 2) - 1
NOTE: You can also use the DBMS_SPACE package and calculate the HWM = TOTAL_BLOCKS - UNUSED_BLOCKS - 1.

What is COST-based approach to optimization ?
Considering available access paths and determining the most efficient execution plan based on statistics in the data dictionary for the tables accessed by the statement and their associated clusters and indexes.

What does COMMIT do ?

COMMIT makes permanent the changes resulting from all SQL statements in the transaction. The changes made by the SQL statements of a transaction become visible to other user sessions transactions that start only after transaction is committed.

How are extents allocated to a segment? (for DBA)
Oracle8 and above rounds off extents to a multiple of 5 blocks when more than 5 blocks are requested. If one requests 16K or 2 blocks (assuming a 8K block size), Oracle doesn't round it up to 5 blocks, but it allocates 2 blocks or 16K as requested. If one asks for 8 blocks, Oracle will round it up to 10 blocks.
Space allocation also depends upon the size of contiguous free space available. If one asks for 8 blocks and Oracle finds a contiguous free space that is exactly 8 blocks, it would give it you. If it were 9 blocks, Oracle would also give it to you. Clearly Oracle doesn't always round extents to a multiple of 5 blocks.
The exception to this rule is locally managed tablespaces. If a tablespace is created with local extent management and the extent size is 64K, then Oracle allocates 64K or 8 blocks assuming 8K-block size. Oracle doesn't round it up to the multiple of 5 when a tablespace is locally managed.

Can one rename a database user (schema)? (for DBA)
No, this is listed as Enhancement Request 158508. Workaround:
Do a user-level export of user A
create new user B
Import system/manager fromuser=A touser=B
Drop user A

Define Transaction ?
A Transaction is a logical unit of work that comprises one or more SQL statements executed by a single user.

What is Read-Only Transaction ?
A Read-Only transaction ensures that the results of each query executed in the transaction are consistant with respect to the same point in time.

What is a deadlock ? Explain .
Two processes wating to update the rows of a table which are locked by the other process then deadlock arises. In a database environment this will often happen because of not issuing proper row lock commands. Poor design of front-end application may cause this situation and the performance of server will reduce drastically.
These locks will be released automatically when a commit/rollback operation performed or any one of this processes being killed externally.

What is a Schema ?
The set of objects owned by user account is called the schema.

What is a cluster Key ?
The related columns of the tables are called the cluster key. The cluster key is indexed using a cluster index and its value is stored only once for multiple tables in the cluster.

What is Parallel Server ?
Multiple instances accessing the same database (Only In Multi-CPU environments)

What are the basic element of Base configuration of an oracle Database ?
It consists of
one or more data files.
one or more control files.
two or more redo log files.
The Database contains
multiple users/schemas
one or more rollback segments
one or more tablespaces
Data dictionary tables
User objects (table,indexes,views etc.,)
The server that access the database consists of
SGA (Database buffer, Dictionary Cache Buffers, Redo log buffers, Shared SQL pool)
SMON (System MONito)
PMON (Process MONitor)
LGWR (LoG Write)
DBWR (Data Base Write)
ARCH (ARCHiver)
CKPT (Check Point)
RECO
Dispatcher
User Process with associated PGS

What is clusters ?
Group of tables physically stored together because they share common columns and are often used together is called Cluster.

What is an Index ? How it is implemented in Oracle Database ?
An index is a database structure used by the server to have direct access of a row in a table. An index is automatically created when a unique of primary key constraint clause is specified in create table comman (Ver 7.0)

What is a Database instance ? Explain
A database instance (Server) is a set of memory structure and background processes that access a set of database files.
The process can be shared by all users. The memory structure that are used to store most queried data from database. This helps up to improve database performance by decreasing the amount of I/O performed against data file.

What is the use of ANALYZE command ?
To perform one of these function on an index,table, or cluster:
- To collect statistics about object used by the optimizer and store them in the data dictionary.
- To delete statistics about the object used by object from the data dictionary.
- To validate the structure of the object.
- To identify migrated and chained rows of the table or cluster.

What is default tablespace ?
The Tablespace to contain schema objects created without specifying a tablespace name.

What are the system resources that can be controlled through Profile ?
The number of concurrent sessions the user can establish the CPU processing time available to the user's session the CPU processing time available to a single call to ORACLE made by a SQL statement the amount of logical I/O available to the user's session the amout of logical I/O available to a single call to ORACLE made by a SQL statement the allowed amount of idle time for the user's session the allowed amount of connect time for the user's session.

What is Tablespace Quota ?
The collective amount of disk space available to the objects in a schema on a particular tablespace.

What are the different Levels of Auditing ?
Statement Auditing, Privilege Auditing and Object Auditing.

What is Statement Auditing ?
Statement auditing is the auditing of the powerful system privileges without regard to specifically named objects.

What are the database administrators utilities available ?
SQL * DBA - This allows DBA to monitor and control an ORACLE database. SQL * Loader - It loads data from standard operating system files (Flat files) into ORACLE database tables. Export (EXP) and Import (imp) utilities allow you to move existing data in ORACLE format to and from ORACLE database.

How can you enable automatic archiving ?
Shut the database
Backup the database
Modify/Include LOG_ARCHIVE_START_TRUE in init.ora file.
Start up the database.

What are roles? How can we implement roles ?
Roles are the easiest way to grant and manage common privileges needed by different groups of database users. Creating roles and assigning provides to roles. Assign each role to group of users. This will simplify the job of assigning privileges to individual users.

What are Roles ?
Roles are named groups of related privileges that are granted to users or other roles.

What are the use of Roles ?
REDUCED GRANTING OF PRIVILEGES - Rather than explicitly granting the same set of privileges to many users a database administrator can grant the privileges for a group of related users granted to a role and then grant only the role to each member of the group.
DYNAMIC PRIVILEGE MANAGEMENT - When the privileges of a group must change, only the privileges of the role need to be modified. The security domains of all users granted the group's role automatically reflect the changes made to the role.
SELECTIVE AVAILABILITY OF PRIVILEGES - The roles granted to a user can be selectively enable (available for use) or disabled (not available for use). This allows specific control of a user's privileges in any given situation.
APPLICATION AWARENESS - A database application can be designed to automatically enable and disable selective roles when a user attempts to use the application.

What is Privilege Auditing ?
Privilege auditing is the auditing of the use of powerful system privileges without regard to specifically named objects.

What is Object Auditing ?
Object auditing is the auditing of accesses to specific schema objects without regard to user.

What is Auditing ?
Monitoring of user access to aid in the investigation of database use.

ASP Interview Questions

What is ASP?
ASP stands for Active Server Pages. It is a server side technology which is used to display dynamic content on web pages. For example you could write code that would give your visitors different information, different images or even a totally different page depending on what browser version they are using.

How can you disable the browser to view the code?

Writing codes within the Tag

Question What is a "Virtual Directory"?

Virtual directories are aliases for directory paths on the server. It allows moving files on the disk between different folders, drives or even servers without changing the structure of web pages. It avoids typing an extremely long URL each time to access an ASP page.

Give the comment Tags for the following?

VBScript : REM & ‘(apostrophe)
JavaScript : // (single line comment)
/* */ (Multi-line comments)

Which is the default Scripting Language of ASP (server-side)?

VBScript

Which is the default Data types in VBScript?

Variant is the default data type in VBScript, which can store a value of any type.

What is a variable?

Variable is a memory location through which the actual values are stored/retrieved. Its value can be changed.

What is the maximum size of an array?

Up to 60 dimensions.

What is Querystring collection?

This collection stores any values that are provided in the URL. This can be generated by three methods:
By clicking on an anchor tag
By sending a form to the server by the GET method
Through user-typed HTTP address
It allows you to extract data sent to the server using a GET request.

What are the attributes of the tags? What are their functions?

The two attributes are ACTION and METHOD
The ACTION gives the name of the ASP file that should be opened next by which this file can access the information given in the form The METHOD determines which of the two ways (POST or GET) the browser can send the information to the server

What are the methods in Session Object?

The Session Object has only one method, which is Abandon. It destroys all the objects stored in a Session Object and releases the server resources they occupied.

What is ServerVariables collection?

The ServerVariables collection holds the entire HTTP headers and also additional items of information about the server.

What is the difference between Querystring collection and Form collection?

The main difference is that the Querystring collection gets appended to a URL.

What is a Form collection?
The Form collection holds the values of the form elements submitted with the POST method. This is the only way to generate a Form collection.

What are the ASP Scripting Objects?

The Dictionary object, the FileSystemObject object, TextStream object.

What happens to a HTML page?

The browser makes a HTTP request; the server gives a HTTP response to the browser and the browser converts into a HTML page.

What happens to ASP pages?

The browser makes a HTTP request; the server does the processing and gives a HTML response to the browser.

How can you change the primary scripting language for a page?

Specify

What is application Object?

Shares information among users of an application. Gives a notification when an application starts or ends.

What is the difference between client-side script and server-side script?

Scripts executed only by the browser without contacting the server is called client-side script. It is browser dependent. The scripting code is visible to the user and hence not secure. Scripts executed by the web server and processed by the server is called server-side script.

What is the command to display characters to the HTML page?

Response.Write

Explain the POST & GET Method or Explain the difference between them?

POST METHOD:
The POST method generates a FORM collection, which is sent as a HTTP request body. All the values typed in the form will be stored in the FORM collection.
GET METHOD:
The GET method sends information by appending it to the URL (with a question mark) and stored as A Querystring collection. The Querystring collection is passed to the server as name/value pair.
The length of the URL should be less than 255 characters.

How many global.asa files can an Application have?

Only one global.asa file and it’s placed in the virtual directory’s root.

How many global.asa files can an Application have?

Only one global.asa file and it’s placed in the virtual directory’s root.

What are Scripting Objects?

Objects that can enhance the application are known as the Scripting Objects.

What is the Order of precedence for LOGICAL Operators.
NOT, AND, OR, XOR, EQV, IMP

What is an Err Object?

Name it’s properties and methods.

What are LOCAL and GLOBAL variables?

Local variables lifetime ends when the Procedure ends. Global variables lifetime begins at the start of the script and ends at the end of the script and it can be used by any procedure within the script. Declaring a variable by using the keyword PRIVATE makes the variable global within the script, but if declared using PUBLIC, then all scripts can refer the variable.

Which is the default Scripting Language on the client side?

JavaScript

What is HTML(Hypertext Markup Language)?

It’s a method by which web pages can be built and generally used for formatting and linking text.

What is a Web Server?

It’s a Computer that provides Web services on the Internet or on a local Intranet. It is designed to locate, address and send out simple HTML pages to all other users who access these pages.

What is Session Object?

It stores information about a User’s session. Gives a notification when a user session begins or ends.

What is Server-Side includes?

It provides extra information by which it makes the site easier to manage. It can include text files using the #include statement, retrieve the size and last modification date of a file, defines how variables and error messages are displayed and inserts the values of HTTP variables in the page sent back to the browser.

What is a FileSystemObject object?

It provides access to the physical file system of the web server. It gets and manipulates information about all drives in a server, folders and sub-folders on a drive and files inside a folder.

What is a Scripting Language?

It permits to create more interactive Web Pages. Validation, formatting of web pages can be done. VBScript, JavaScript are some examples.

What is a Dictionary object?

It lets you store and retrieve information in a flexible data structure. Each value or information stored in a Dictionary is associated with a key through which the information can be retrieved.

What is Global.asa file?

It is text file that contains details about an ASP application, such as when it should begin and end.

What is an .ASP file?

It is a Text File that contains the combination of the following:
Text
HTML tags
Script Commands

What is Response Object?

It controls the information sent to the user. The various methods are:
Response.Write - Sends information directly to a browser
Response.Redirect - Directs a user to a URL other than the requested URL
Response.ContentType - Controls the type of content sent
Response.Cookies - Sets cookie values
Response.Buffer - To Buffer information

Naming constraints for a variable ?

It can be up to 255 characters Must start with an alphabet Must not contain an embedded period or full-stop

What is a TextStream object?

It allows you to access(read/write) the contents of text files stored on the web server.

What is IIS?

IIS is a Web Server that provides Web services, not only for web pages but also for ftp sites and video and audio services. It integrates with the database facilities of SQL Server.

What is Request Object?

Gets information from the user. It has five collections by which values can be accessed. They are: Querystring, Form, Cookies, Server Variables & ClientCertificate

What are the special sub-types in VBScript?

EMPTY: has no value
NULL: Value does not exist (conjunction with database)
OBJECT:

What is Cookies collection?

Cookies are text files that store information about the user by which the web server identifies and marks each different visitor to a web site and determines where a user has been before. A cookie can store information only when the user sends it. Individual cookies are limited to 4KB of data. The maximum number of cookies allowed is 300.
Cookies are stored on client’s machine.

What is the difference between Cookies collection and Form/Querystring collection?

Cookie collection does not have the Count property. Cookies can have multiple values for the same cookie name but each value can be referred using a key whereas in a Form/Querystring cookie each value has to be referred using an index value.

What is Server Object?

Controls the ASP execution environment. It can set the amount of time script can run before an error occurs. Converts a virtual path to a physical path on the server. Takes a user supplied string and encode it into proper format for a URL string.

What is Collection?

Collection is a set of name/value pairs where the information supplied by the client is stored.

How will you delete a Cookie?

By setting its Expires property to any date prior to today Response.Cookies("cookie name"). Expires = Date 1.

What is the function of Buffer in Response Object?
Buffer controls the HTML output stream manually.

How are scripts executed?

ASP provides scripting engines that execute the corresponding scripting languages on the server side. Scripts should be encoded within the Delimiters.

What is ASP (Active Server Pages)?

ASP is a server side-scripting environment for building dynamic and interactive web pages. Since the scripts run on the server side, the web server does all the processing.

What are ARRAYS?

Arrays are variables that store items of similar information.DIM ARRAY1(4) (declares an array with the name array1 with 5 elements)

What is Application-scope?

Application-scope means that variables (and objects) can be accessed from any ASP pages that is part of the application.

What is Extranet?

An area of a web site available only to a set of registered visitors.

What is a session?

A user accessing an application is known as a session.

What is ClientCertificate collection?

A ClientCertificate is an encrypted number that is stored in a file on the user’s computer. This stores details of any security certificates included with the request.

What do you need to run ASP?

A browser and a Web server

What is the order of execution for an ASP application?

1) Global.asa
2) Server-side Includes
3) Jscript scripts tagged within

What are the types of HTML?

Static HTML Browser uses HTTP to request HTML file from the Web Server
Dynamic HTML Browser uses HTTP to request an executable application rather than a Static HTML file

What are the properties of Session Object?

SessionID returns the session identification number for each user.
Timeout sets the timeout period assigned to the Session object for any application, in minutes.
CodePage determines the code page that will be used to display content.
LCID a locale identifier, which determines time zone and language, rules for the system

What are the event handlers of Session Object?

Session _OnStart This event will be fired when a new user begins a session with the web site.
Session_OnEnd This event is called whenever a session terminates.

Name the ASP Objects?

Request Object
Response Object
Server Object
Session Object
Application Object

What are the advantages of using ASP?

Minimizes network traffic by limiting the need for the browser and server to talk to each other
Makes for quicker loading time since HTML pages are only downloaded
Allows to run programs in languages that are not supported by the browser
Can provide the client with data that does not reside on the client’s machine
Provides improved security measures since the script cannot be viewed by the browser

What are the methods in Application Object?

Lock prevents clients from modifying the variables stored in the Application object.
Unlock removes the lock from variables stored in the Application object.

What are the methods in Application Object?

Internet Information Server (IIS) on Windows NT
Personal Web Server (PWS) on Windows 95
Peer Web Services on Windows NT

What are the browsers that can access ASP pages?

Internet Explorer (supports VBScript, JavaScript)
Netscape Communicator/ Navigator (supports only JavaScript, VBScript can be also added too)

What are the methods by which output stream is controlled?

Flush sends previous buffered output to the client immediately, but continues processing the script.
Clear erases any already-buffered HTML.
End causes the server to stop processing the script.

What are the methods by which output stream is controlled?

What are the properties used to control the expiration of the page?
Expires specifies the number of minutes before a page cached on a browser expires.
ExpiresAbsolute sets the date and time at which a page cached on a browser expires.

What are the collections of Session Object?
Contents collection contains all the variables established for a session without using the tag.
Static collection contains all the objects created

What is the difference between ASP and HTML? Or Why ASP is better than HTML?

- ASP executes code on the server side whereas the browser interprets HTML.
- ASP can use any scripting languages
- Gets feedback from the user and return information to the user
- Create pages that will be customized to display only things that will be of interest to a particular user
- Can edit contents of a web page by updating a text file or a database rather than the HTML code itself

What are the event handlers of Application Object?

Application_OnStart- This event will be fired when the first visitor hits the page.
Application_OnEnd- This event runs when the server is stopped.

Name some of the ASP components?

Ad Rotator component- a way to manage advertisements on the web site.
Content Linker component - a technique to direct users through a set of pages on a web site by creating a list of URLs and description of the next and previous pages.
Browser Capabilities component - allows to customize the page to the ability of the browser viewing it.
Database Access component - allows to access data from the database

What are the tasks performed by <> tags?

tags provides space for the user to input values
the form has a button to submit information back to the server
It transfers control to another ASP page
It carries the information in the fields to another ASP page

What are the tags necessary to be present within the tag ?

-----tag: Provides input spaces (text boxes, combo boxes, radio button, etc.) on a form called fields. It has three attributes TYPE, NAME and VALUE. TYPE provides the characteristics of the field and the NAME specifies a name to the field by which it can be referred.

What are the collections of Application Object?

* Contents collection - contains all variables added via scripts in global.asa.
* Static collection - contains the names of all objects

How do you create a recordset object in VBScript?

Answer1
//First of all declare a variable to hold the Recordset object, ex-
Dim objRs
//Now, Create this varible as a Recordset object, ex-
Set objRs=Server.CreateObject(ADODB.RECORDSET)
Answer2
” rs.MoveNext
wend
end if
%’>
*. Create Recordset object
*. Place form field value in a variable named “param”
*. Define query by concatenating strings and variable value
*. Open RecordSet Object. Note that the first parameter is the Command Text. The second parameter is the Connection String. The Command Object and Connection Object are created implicitly.
*. Make sure the RecordSet isn’t empty
*. Begin executing a loop which goes through all records in the RecordSet.
*. Write each record’s “firstname” and “lastname” fields to the page on a separate line.
*. Move to Next Record.

Explain the difference between POST and GET Method.

GET requests are string data that is visible to the end user via the URL and a limit of 2kb, POST requests have no limit on total data and the user can’t see the data in a query string.

Why do we use Option Explicit?

Answer1
To avoid multiple variables of the same name.
Answer2:
Correct answer is - This statement force the declaration of variables in VB before using them.

How do you write an SQL insert statement?

insert into tablename (fieldA, fieldB, fieldC)Values(’dataA’, ‘dataB’, ‘dataC’);

How can you have different number of cells for each row of a table in HTML?

using colspan and rowspan

What variable can you use to share info across the whole application for one user?

Use the sessions object

What is string concatenation function in VBScript?

the ampersand symbol and ampersand space underscore across multiple lines

How do you get the value of a combo box in Javascript?

Answer1.
document.forms[’formName’].elements[’comboName’].options[i].value
Answer2.
document.form_name.element_name.value

What is a class in CSS?

Answer1
A class allows you to define different style characteristics to the same HTML element.
Answer2
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”

When inserting strings into a SQL table in ASP what is the risk and how can you prevent it?

SQL Injection, to prevent you probably need to use Stored Procedures instead of inline/incode SQL

Which is the default Data types in VBScript?

Variant.

Software Testing Interview Questions - Manual

What makes a good test engineer?
A good test engineer has a 'test to break' attitude, an ability to take the point of view of the customer, a strong desire for quality, and an attention to detail. Tact and diplomacy are useful in maintaining a cooperative relationship with developers, and an ability to communicate with both technical (developers) and non-technical (customers, management) people is useful. Previous software development experience can be helpful as it provides a deeper understanding of the software development process, gives the tester an appreciation for the developers' point of view, and reduce the learning curve in automated test tool programming. Judgement skills are needed to assess high-risk areas of an application on which to focus testing efforts when time is limited.

What makes a good Software QA engineer?
The same qualities a good tester has are useful for a QA engineer. Additionally, they must be able to understand the entire software development process and how it can fit into the business approach and goals of the organization. Communication skills and the ability to understand various sides of issues are important. In organizations in the early stages of implementing QA processes, patience and diplomacy are especially needed. An ability to find problems as well as to see 'what's missing' is important for inspections and reviews.

What makes a good QA or Test manager?
A good QA, test, or QA/Test(combined) manager should:
• be familiar with the software development process
• be able to maintain enthusiasm of their team and promote a positive atmosphere, despite
• what is a somewhat 'negative' process (e.g., looking for or preventing problems)
• be able to promote teamwork to increase productivity
• be able to promote cooperation between software, test, and QA engineers
• have the diplomatic skills needed to promote improvements in QA processes
• have the ability to withstand pressures and say 'no' to other managers when quality is insufficient or QA processes are not being adhered to
• have people judgement skills for hiring and keeping skilled personnel
• be able to communicate with technical and non-technical people, engineers, managers, and customers.
• be able to run meetings and keep them focused

What's the role of documentation in QA?
Critical. (Note that documentation can be electronic, not necessarily paper.) QA practices should be documented such that they are repeatable. Specifications, designs, business rules, inspection reports, configurations, code changes, test plans, test cases, bug reports, user manuals, etc. should all be documented. There should ideally be a system for easily finding and obtaining documents and determining what documentation will have a particular piece of information. Change management for documentation should be used if possible.

What's the big deal about 'requirements'?
One of the most reliable methods of insuring problems, or failure, in a complex software project is to have poorly documented requirements specifications. Requirements are the details describing an application's externally-perceived functionality and properties. Requirements should be clear, complete, reasonably detailed, cohesive, attainable, and testable. A non-testable requirement would be, for example, 'user-friendly' (too subjective). A testable requirement would be something like 'the user must enter their previously-assigned password to access the application'. Determining and organizing requirements details in a useful and efficient way can be a difficult effort; different methods are available depending on the particular project. Many books are available that describe various approaches to this task. (See the Bookstore section's 'Software Requirements Engineering' category for books on Software Requirements.)
Care should be taken to involve ALL of a project's significant 'customers' in the requirements process. 'Customers' could be in-house personnel or out, and could include end-users, customer acceptance testers, customer contract officers, customer management, future software maintenance engineers, salespeople, etc. Anyone who could later derail the project if their expectations aren't met should be included if possible.
Organizations vary considerably in their handling of requirements specifications. Ideally, the requirements are spelled out in a document with statements such as 'The product shall.....'. 'Design' specifications should not be confused with 'requirements'; design specifications should be traceable back to the requirements.
In some organizations requirements may end up in high level project plans, functional specification documents, in design documents, or in other documents at various levels of detail. No matter what they are called, some type of documentation with detailed requirements will be needed by testers in order to properly plan and execute tests. Without such documentation, there will be no clear-cut way to determine if a software application is performing correctly.
'Agile' methods such as XP use methods requiring close interaction and cooperation between programmers and customers/end-users to iteratively develop requirements. The programmer uses 'Test first' development to first create automated unit testing code, which essentially embodies the requirements.

What steps are needed to develop and run software tests?
The following are some of the steps to consider:
• Obtain requirements, functional design, and internal design specifications and other necessary documents
• Obtain budget and schedule requirements
• Determine project-related personnel and their responsibilities, reporting requirements, required standards and processes (such as release processes, change processes, etc.)
• Identify application's higher-risk aspects, set priorities, and determine scope and limitations of tests
• Determine test approaches and methods - unit, integration, functional, system, load, usability tests, etc.
• Determine test environment requirements (hardware, software, communications, etc.)
• Determine testware requirements (record/playback tools, coverage analyzers, test tracking, problem/bug tracking, etc.)
• Determine test input data requirements
• Identify tasks, those responsible for tasks, and labor requirements
• Set schedule estimates, timelines, milestones
• Determine input equivalence classes, boundary value analyses, error classes
• Prepare test plan document and have needed reviews/approvals
• Write test cases
• Have needed reviews/inspections/approvals of test cases
• Prepare test environment and testware, obtain needed user manuals/reference documents/configuration guides/installation guides, set up test tracking processes, set up logging and archiving processes, set up or obtain test input data
• Obtain and install software releases
• Perform tests
• Evaluate and report results
• Track problems/bugs and fixes
• Retest as needed
• Maintain and update test plans, test cases, test environment, and testware through life cycle

What's a 'test plan'?
A software project test plan is a document that describes the objectives, scope, approach, and focus of a software testing effort. The process of preparing a test plan is a useful way to think through the efforts needed to validate the acceptability of a software product. The completed document will help people outside the test group understand the 'why' and 'how' of product validation. It should be thorough enough to be useful but not so thorough that no one outside the test group will read it. The following are some of the items that might be included in a test plan, depending on the particular project:
• Title
• Identification of software including version/release numbers
• Revision history of document including authors, dates, approvals
• Table of Contents
• Purpose of document, intended audience
• Objective of testing effort
• Software product overview
• Relevant related document list, such as requirements, design documents, other test plans, etc.
• Relevant standards or legal requirements
• Traceability requirements
• Relevant naming conventions and identifier conventions
• Overall software project organization and personnel/contact-info/responsibilties
• Test organization and personnel/contact-info/responsibilities
• Assumptions and dependencies
• Project risk analysis
• Testing priorities and focus
• Scope and limitations of testing
• Test outline - a decomposition of the test approach by test type, feature, functionality, process, system, module, etc. as applicable
• Outline of data input equivalence classes, boundary value analysis, error classes
• Test environment - hardware, operating systems, other required software, data configurations, interfaces to other systems
• Test environment validity analysis - differences between the test and production systems and their impact on test validity.
• Test environment setup and configuration issues
• Software migration processes
• Software CM processes
• Test data setup requirements
• Database setup requirements
• Outline of system-logging/error-logging/other capabilities, and tools such as screen capture software, that will be used to help describe and report bugs
• Discussion of any specialized software or hardware tools that will be used by testers to help track the cause or source of bugs
• Test automation - justification and overview
• Test tools to be used, including versions, patches, etc.
• Test script/test code maintenance processes and version control
• Problem tracking and resolution - tools and processes
• Project test metrics to be used
• Reporting requirements and testing deliverables
• Software entrance and exit criteria
• Initial sanity testing period and criteria
• Test suspension and restart criteria
• Personnel allocation
• Personnel pre-training needs
• Test site/location
• Outside test organizations to be utilized and their purpose, responsibilties, deliverables, contact persons, and coordination issues
• Relevant proprietary, classified, security, and licensing issues.
• Open issues
• Appendix - glossary, acronyms, etc.
(See the Bookstore section's 'Software Testing' and 'Software QA' categories for useful books with more information.)

What's a 'test case'?
• A test case is a document that describes an input, action, or event and an expected response, to determine if a feature of an application is working correctly. A test case should contain particulars such as test case identifier, test case name, objective, test conditions/setup, input data requirements, steps, and expected results.
• Note that the process of developing test cases can help find problems in the requirements or design of an application, since it requires completely thinking through the operation of the application. For this reason, it's useful to prepare test cases early in the development cycle if possible.

What should be done after a bug is found?
The bug needs to be communicated and assigned to developers that can fix it. After the problem is resolved, fixes should be re-tested, and determinations made regarding requirements for regression testing to check that fixes didn't create problems elsewhere. If a problem-tracking system is in place, it should encapsulate these processes. A variety of commercial problem-tracking/management software tools are available (see the 'Tools' section for web resources with listings of such tools). The following are items to consider in the tracking process:
• Complete information such that developers can understand the bug, get an idea of it's severity, and reproduce it if necessary.
• Bug identifier (number, ID, etc.)
• Current bug status (e.g., 'Released for Retest', 'New', etc.)
• The application name or identifier and version
• The function, module, feature, object, screen, etc. where the bug occurred
• Environment specifics, system, platform, relevant hardware specifics
• Test case name/number/identifier
• One-line bug description
• Full bug description
• Description of steps needed to reproduce the bug if not covered by a test case or if the developer doesn't have easy access to the test case/test script/test tool
• Names and/or descriptions of file/data/messages/etc. used in test
• File excerpts/error messages/log file excerpts/screen shots/test tool logs that would be helpful in finding the cause of the problem
• Severity estimate (a 5-level range such as 1-5 or 'critical'-to-'low' is common)
• Was the bug reproducible?
• Tester name
• Test date
• Bug reporting date
• Name of developer/group/organization the problem is assigned to
• Description of problem cause
• Description of fix
• Code section/file/module/class/method that was fixed
• Date of fix
• Application version that contains the fix
• Tester responsible for retest
• Retest date
• Retest results
• Regression testing requirements
• Tester responsible for regression tests
• Regression testing results
A reporting or tracking process should enable notification of appropriate personnel at various stages. For instance, testers need to know when retesting is needed, developers need to know when bugs are found and how to get the needed information, and reporting/summary capabilities are needed for managers.

What is 'configuration management'?
Configuration management covers the processes used to control, coordinate, and track: code, requirements, documentation, problems, change requests, designs, tools/compilers/libraries/patches, changes made to them, and who makes the changes. (See the 'Tools' section for web resources with listings of configuration management tools. Also see the Bookstore section's 'Configuration Management' category for useful books with more information.)

What if the software is so buggy it can't really be tested at all?
The best bet in this situation is for the testers to go through the process of reporting whatever bugs or blocking-type problems initially show up, with the focus being on critical bugs. Since this type of problem can severely affect schedules, and indicates deeper problems in the software development process (such as insufficient unit testing or insufficient integration testing, poor design, improper build or release procedures, etc.) managers should be notified, and provided with some documentation as evidence of the problem.

How can it be known when to stop testing?
This can be difficult to determine. Many modern software applications are so complex, and run in such an interdependent environment, that complete testing can never be done. Common factors in deciding when to stop are:
• Deadlines (release deadlines, testing deadlines, etc.)
• Test cases completed with certain percentage passed
• Test budget depleted
• Coverage of code/functionality/requirements reaches a specified point
• Bug rate falls below a certain level
• Beta or alpha testing period ends

What if there isn't enough time for thorough testing?
Use risk analysis to determine where testing should be focused.
Since it's rarely possible to test every possible aspect of an application, every possible combination of events, every dependency, or everything that could go wrong, risk analysis is appropriate to most software development projects. This requires judgement skills, common sense, and experience. (If warranted, formal methods are also available.) Considerations can include:
• Which functionality is most important to the project's intended purpose?
• Which functionality is most visible to the user?
• Which functionality has the largest safety impact?
• Which functionality has the largest financial impact on users?
• Which aspects of the application are most important to the customer?
• Which aspects of the application can be tested early in the development cycle?
• Which parts of the code are most complex, and thus most subject to errors?
• Which parts of the application were developed in rush or panic mode?
• Which aspects of similar/related previous projects caused problems?
• Which aspects of similar/related previous projects had large maintenance expenses?
• Which parts of the requirements and design are unclear or poorly thought out?
• What do the developers think are the highest-risk aspects of the application?
• What kinds of problems would cause the worst publicity?
• What kinds of problems would cause the most customer service complaints?
• What kinds of tests could easily cover multiple functionalities?
• Which tests will have the best high-risk-coverage to time-required ratio?

What if the project isn't big enough to justify extensive testing?
Consider the impact of project errors, not the size of the project. However, if extensive testing is still not justified, risk analysis is again needed and the same considerations as described previously in 'What if there isn't enough time for thorough testing?' apply. The tester might then do ad hoc testing, or write up a limited test plan based on the risk analysis.

What can be done if requirements are changing continuously?
A common problem and a major headache.
• Work with the project's stakeholders early on to understand how requirements might change so that alternate test plans and strategies can be worked out in advance, if possible.
• It's helpful if the application's initial design allows for some adaptability so that later changes do not require redoing the application from scratch.
• If the code is well-commented and well-documented this makes changes easier for the developers.
• Use rapid prototyping whenever possible to help customers feel sure of their requirements and minimize changes.
• The project's initial schedule should allow for some extra time commensurate with the possibility of changes.
• Try to move new requirements to a 'Phase 2' version of an application, while using the original requirements for the 'Phase 1' version.
• Negotiate to allow only easily-implemented new requirements into the project, while moving more difficult new requirements into future versions of the application.
• Be sure that customers and management understand the scheduling impacts, inherent risks, and costs of significant requirements changes. Then let management or the customers (not the developers or testers) decide if the changes are warranted - after all, that's their job.
• Balance the effort put into setting up automated testing with the expected effort required to re-do them to deal with changes.
• Try to design some flexibility into automated test scripts.
• Focus initial automated testing on application aspects that are most likely to remain unchanged.
• Devote appropriate effort to risk analysis of changes to minimize regression testing needs.
• Design some flexibility into test cases (this is not easily done; the best bet might be to minimize the detail in the test cases, or set up only higher-level generic-type test plans)
• Focus less on detailed test plans and test cases and more on ad hoc testing (with an understanding of the added risk that this entails).

What if the application has functionality that wasn't in the requirements?
It may take serious effort to determine if an application has significant unexpected or hidden functionality, and it would indicate deeper problems in the software development process. If the functionality isn't necessary to the purpose of the application, it should be removed, as it may have unknown impacts or dependencies that were not taken into account by the designer or the customer. If not removed, design information will be needed to determine added testing needs or regression testing needs. Management should be made aware of any significant added risks as a result of the unexpected functionality. If the functionality only effects areas such as minor improvements in the user interface, for example, it may not be a significant risk.

How can Software QA processes be implemented without stifling productivity?
By implementing QA processes slowly over time, using consensus to reach agreement on processes, and adjusting and experimenting as an organization grows and matures, productivity will be improved instead of stifled. Problem prevention will lessen the need for problem detection, panics and burn-out will decrease, and there will be improved focus and less wasted effort. At the same time, attempts should be made to keep processes simple and efficient, minimize paperwork, promote computer-based processes and automated tracking and reporting, minimize time required in meetings, and promote training as part of the QA process. However, no one - especially talented technical types - likes rules or bureacracy, and in the short run things may slow down a bit. A typical scenario would be that more days of planning and development will be needed, but less time will be required for late-night bug-fixing and calming of irate customers.

What if an organization is growing so fast that fixed QA processes are impossible?
This is a common problem in the software industry, especially in new technology areas. There is no easy solution in this situation, other than:
• Hire good people
• Management should 'ruthlessly prioritize' quality issues and maintain focus on the customer
• Everyone in the organization should be clear on what 'quality' means to the customer

How does a client/server environment affect testing?
Client/server applications can be quite complex due to the multiple dependencies among clients, data communications, hardware, and servers. Thus testing requirements can be extensive. When time is limited (as it usually is) the focus should be on integration and system testing. Additionally, load/stress/performance testing may be useful in determining client/server application limitations and capabilities. There are commercial tools to assist with such testing. (See the 'Tools' section for web resources with listings that include these kinds of test tools.)

How can World Wide Web sites be tested?
Web sites are essentially client/server applications - with web servers and 'browser' clients. Consideration should be given to the interactions between html pages, TCP/IP communications, Internet connections, firewalls, applications that run in web pages (such as applets, javascript, plug-in applications), and applications that run on the server side (such as cgi scripts, database interfaces, logging applications, dynamic page generators, asp, etc.). Additionally, there are a wide variety of servers and browsers, various versions of each, small but sometimes significant differences between them, variations in connection speeds, rapidly changing technologies, and multiple standards and protocols. The end result is that testing for web sites can become a major ongoing effort. Other considerations might include:
• What are the expected loads on the server (e.g., number of hits per unit time?), and what kind of performance is required under such loads (such as web server response time, database query response times). What kinds of tools will be needed for performance testing (such as web load testing tools, other tools already in house that can be adapted, web robot downloading tools, etc.)?
• Who is the target audience? What kind of browsers will they be using? What kind of connection speeds will they by using? Are they intra- organization (thus with likely high connection speeds and similar browsers) or Internet-wide (thus with a wide variety of connection speeds and browser types)?
• What kind of performance is expected on the client side (e.g., how fast should pages appear, how fast should animations, applets, etc. load and run)?
• Will down time for server and content maintenance/upgrades be allowed? how much?
• What kinds of security (firewalls, encryptions, passwords, etc.) will be required and what is it expected to do? How can it be tested?
• How reliable are the site's Internet connections required to be? And how does that affect backup system or redundant connection requirements and testing?
• What processes will be required to manage updates to the web site's content, and what are the requirements for maintaining, tracking, and controlling page content, graphics, links, etc.?
• Which HTML specification will be adhered to? How strictly? What variations will be allowed for targeted browsers?
• Will there be any standards or requirements for page appearance and/or graphics throughout a site or parts of a site??
• How will internal and external links be validated and updated? how often?
• Can testing be done on the production system, or will a separate test system be required? How are browser caching, variations in browser option settings, dial-up connection variabilities, and real-world internet 'traffic congestion' problems to be accounted for in testing?
• How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the system and do they require testing?
• How are cgi programs, applets, javascripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested?
Some sources of site security information include the Usenet newsgroup 'comp.security.announce' and links concerning web site security in the 'Other Resources' section.
Some usability guidelines to consider - these are subjective and may or may not apply to a given situation (Note: more information on usability testing issues can be found in articles about web site usability in the 'Other Resources' section):
• Pages should be 3-5 screens max unless content is tightly focused on a single topic. If larger, provide internal links within the page.
• The page layouts and design elements should be consistent throughout a site, so that it's clear to the user that they're still within a site.
• Pages should be as browser-independent as possible, or pages should be provided or generated based on the browser-type.
• All pages should have links external to the page; there should be no dead-end pages.
• The page owner, revision date, and a link to a contact person or organization should be included on each page.
Many new web site test tools have appeared in the recent years and more than 280 of them are listed in the 'Web Test Tools' section.

How is testing affected by object-oriented designs?
Well-engineered object-oriented design can make it easier to trace from code to internal design to functional design to requirements. While there will be little affect on black box testing (where an understanding of the internal design of the application is unnecessary), white-box testing can be oriented to the application's objects. If the application was well-designed this can simplify test design.

What is Extreme Programming and what's it got to do with testing?
Extreme Programming (XP) is a software development approach for small teams on risk-prone projects with unstable requirements. It was created by Kent Beck who described the approach in his book 'Extreme Programming Explained' (See the Softwareqatest.com Books page.). Testing ('extreme testing') is a core aspect of Extreme Programming. Programmers are expected to write unit and functional test code first - before the application is developed. Test code is under source control along with the rest of the code. Customers are expected to be an integral part of the project team and to help develope scenarios for acceptance/black box testing. Acceptance tests are preferably automated, and are modified and rerun for each of the frequent development iterations. QA and test personnel are also required to be an integral part of the project team. Detailed requirements documentation is not used, and frequent re-scheduling, re-estimating, and re-prioritizing is expected. For more info see the XP-related listings in the Softwareqatest.com 'Other Resources' section.

What is 'Software Quality Assurance'?
Software QA involves the entire software development PROCESS - monitoring and improving the process, making sure that any agreed-upon standards and procedures are followed, and ensuring that problems are found and dealt with. It is oriented to 'prevention'. (See the Bookstore section's 'Software QA' category for a list of useful books on Software Quality Assurance.)

What is 'Software Testing'?
Testing involves operation of a system or application under controlled conditions and evaluating the results (eg, 'if the user is in interface A of the application while using hardware B, and does C, then D should happen'). The controlled conditions should include both normal and abnormal conditions. Testing should intentionally attempt to make things go wrong to determine if things happen when they shouldn't or things don't happen when they should. It is oriented to 'detection'. (See the Bookstore section's 'Software Testing' category for a list of useful books on Software Testing.)
• Organizations vary considerably in how they assign responsibility for QA and testing. Sometimes they're the combined responsibility of one group or individual. Also common are project teams that include a mix of testers and developers who work closely together, with overall QA processes monitored by project managers. It will depend on what best fits an organization's size and business structure.

What are some recent major computer system failures caused by software bugs?
• A major U.S. retailer was reportedly hit with a large government fine in October of 2003 due to web site errors that enabled customers to view one anothers' online orders.
• News stories in the fall of 2003 stated that a manufacturing company recalled all their transportation products in order to fix a software problem causing instability in certain circumstances. The company found and reported the bug itself and initiated the recall procedure in which a software upgrade fixed the problems.
• In August of 2003 a U.S. court ruled that a lawsuit against a large online brokerage company could proceed; the lawsuit reportedly involved claims that the company was not fixing system problems that sometimes resulted in failed stock trades, based on the experiences of 4 plaintiffs during an 8-month period. A previous lower court's ruling that "...six miscues out of more than 400 trades does not indicate negligence." was invalidated.
• In April of 2003 it was announced that the largest student loan company in the U.S. made a software error in calculating the monthly payments on 800,000 loans. Although borrowers were to be notified of an increase in their required payments, the company will still reportedly lose $8 million in interest. The error was uncovered when borrowers began reporting inconsistencies in their bills.
• News reports in February of 2003 revealed that the U.S. Treasury Department mailed 50,000 Social Security checks without any beneficiary names. A spokesperson indicated that the missing names were due to an error in a software change. Replacement checks were subsequently mailed out with the problem corrected, and recipients were then able to cash their Social Security checks.
• In March of 2002 it was reported that software bugs in Britain's national tax system resulted in more than 100,000 erroneous tax overcharges. The problem was partly attibuted to the difficulty of testing the integration of multiple systems.
• A newspaper columnist reported in July 2001 that a serious flaw was found in off-the-shelf software that had long been used in systems for tracking certain U.S. nuclear materials. The same software had been recently donated to another country to be used in tracking their own nuclear materials, and it was not until scientists in that country discovered the problem, and shared the information, that U.S. officials became aware of the problems.
• According to newspaper stories in mid-2001, a major systems development contractor was fired and sued over problems with a large retirement plan management system. According to the reports, the client claimed that system deliveries were late, the software had excessive defects, and it caused other systems to crash.
• In January of 2001 newspapers reported that a major European railroad was hit by the aftereffects of the Y2K bug. The company found that many of their newer trains would not run due to their inability to recognize the date '31/12/2000'; the trains were started by altering the control system's date settings.
• News reports in September of 2000 told of a software vendor settling a lawsuit with a large mortgage lender; the vendor had reportedly delivered an online mortgage processing system that did not meet specifications, was delivered late, and didn't work.
• In early 2000, major problems were reported with a new computer system in a large suburban U.S. public school district with 100,000+ students; problems included 10,000 erroneous report cards and students left stranded by failed class registration systems; the district's CIO was fired. The school district decided to reinstate it's original 25-year old system for at least a year until the bugs were worked out of the new system by the software vendors.
• In October of 1999 the $125 million NASA Mars Climate Orbiter spacecraft was believed to be lost in space due to a simple data conversion error. It was determined that spacecraft software used certain data in English units that should have been in metric units. Among other tasks, the orbiter was to serve as a communications relay for the Mars Polar Lander mission, which failed for unknown reasons in December 1999. Several investigating panels were convened to determine the process failures that allowed the error to go undetected.
• Bugs in software supporting a large commercial high-speed data network affected 70,000 business customers over a period of 8 days in August of 1999. Among those affected was the electronic trading system of the largest U.S. futures exchange, which was shut down for most of a week as a result of the outages.
• In April of 1999 a software bug caused the failure of a $1.2 billion U.S. military satellite launch, the costliest unmanned accident in the history of Cape Canaveral launches. The failure was the latest in a string of launch failures, triggering a complete military and industry review of U.S. space launch programs, including software integration and testing processes. Congressional oversight hearings were requested.
• A small town in Illinois in the U.S. received an unusually large monthly electric bill of $7 million in March of 1999. This was about 700 times larger than its normal bill. It turned out to be due to bugs in new software that had been purchased by the local power company to deal with Y2K software issues.
• In early 1999 a major computer game company recalled all copies of a popular new product due to software problems. The company made a public apology for releasing a product before it was ready.

Why is it often hard for management to get serious about quality assurance?
Solving problems is a high-visibility process; preventing problems is low-visibility. This is illustrated by an old parable:
In ancient China there was a family of healers, one of whom was known throughout the land and employed as a physician to a great lord. The physician was asked which of his family was the most skillful healer. He replied,
"I tend to the sick and dying with drastic and dramatic treatments, and on occasion someone is cured and my name gets out among the lords."
"My elder brother cures sickness when it just begins to take root, and his skills are known among the local peasants and neighbors."
"My eldest brother is able to sense the spirit of sickness and eradicate it before it takes form. His name is unknown outside our home."

Why does software have bugs?
• miscommunication or no communication - as to specifics of what an application should or shouldn't do (the application's requirements).
• software complexity - the complexity of current software applications can be difficult to comprehend for anyone without experience in modern-day software development. Windows-type interfaces, client-server and distributed applications, data communications, enormous relational databases, and sheer size of applications have all contributed to the exponential growth in software/system complexity. And the use of object-oriented techniques can complicate instead of simplify a project unless it is well-engineered.
• programming errors - programmers, like anyone else, can make mistakes.
• changing requirements (whether documented or undocumented) - the customer may not understand the effects of changes, or may understand and request them anyway - redesign, rescheduling of engineers, effects on other projects, work already completed that may have to be redone or thrown out, hardware requirements that may be affected, etc. If there are many minor changes or any major changes, known and unknown dependencies among parts of the project are likely to interact and cause problems, and the complexity of coordinating changes may result in errors. Enthusiasm of engineering staff may be affected. In some fast-changing business environments, continuously modified requirements may be a fact of life. In this case, management must understand the resulting risks, and QA and test engineers must adapt and plan for continuous extensive testing to keep the inevitable bugs from running out of control - see 'What can be done if requirements are changing continuously?' in Part 2 of the FAQ.
• time pressures - scheduling of software projects is difficult at best, often requiring a lot of guesswork. When deadlines loom and the crunch comes, mistakes will be made.
• egos - people prefer to say things like:
'no problem'
'piece of cake'
'I can whip that out in a few hours'
'it should be easy to update that old code'
instead of:
'that adds a lot of complexity and we could end up
making a lot of mistakes'
'we have no idea if we can do that; we'll wing it'
'I can't estimate how long it will take, until I
take a close look at it'
'we can't figure out what that old spaghetti code
did in the first place'

If there are too many unrealistic 'no problem's', the result is bugs.

• poorly documented code - it's tough to maintain and modify code that is badly written or poorly documented; the result is bugs. In many organizations management provides no incentive for programmers to document their code or write clear, understandable, maintainable code. In fact, it's usually the opposite: they get points mostly for quickly turning out code, and there's job security if nobody else can understand it ('if it was hard to write, it should be hard to read').
• software development tools - visual tools, class libraries, compilers, scripting tools, etc. often introduce their own bugs or are poorly documented, resulting in added bugs.

How can new Software QA processes be introduced in an existing organization?
• A lot depends on the size of the organization and the risks involved. For large organizations with high-risk (in terms of lives or property) projects, serious management buy-in is required and a formalized QA process is necessary.
• Where the risk is lower, management and organizational buy-in and QA implementation may be a slower, step-at-a-time process. QA processes should be balanced with productivity so as to keep bureaucracy from getting out of hand.
• For small groups or projects, a more ad-hoc process may be appropriate, depending on the type of customers and projects. A lot will depend on team leads or managers, feedback to developers, and ensuring adequate communications among customers, managers, developers, and testers.
• The most value for effort will be in (a) requirements management processes, with a goal of clear, complete, testable requirement specifications embodied in requirements or design documentation and (b) design inspections and code inspections.

What is verification? validation?
Verification typically involves reviews and meetings to evaluate documents, plans, code, requirements, and specifications. This can be done with checklists, issues lists, walkthroughs, and inspection meetings. Validation typically involves actual testing and takes place after verifications are completed. The term 'IV & V' refers to Independent Verification and Validation.

What is a 'walkthrough'?
A 'walkthrough' is an informal meeting for evaluation or informational purposes. Little or no preparation is usually required.

What's an 'inspection'?
An inspection is more formalized than a 'walkthrough', typically with 3-8 people including a moderator, reader, and a recorder to take notes. The subject of the inspection is typically a document such as a requirements spec or a test plan, and the purpose is to find problems and see what's missing, not to fix anything. Attendees should prepare for this type of meeting by reading thru the document; most problems will be found during this preparation. The result of the inspection meeting should be a written report. Thorough preparation for inspections is difficult, painstaking work, but is one of the most cost effective methods of ensuring quality. Employees who are most skilled at inspections are like the 'eldest brother' in the parable in 'Why is it often hard for management to get serious about quality assurance?'. Their skill may have low visibility but they are extremely valuable to any software development organization, since bug prevention is far more cost-effective than bug detection.

What kinds of testing should be considered?
• Black box testing - not based on any knowledge of internal design or code. Tests are based on requirements and functionality.
• White box testing - based on knowledge of the internal logic of an application's code. Tests are based on coverage of code statements, branches, paths, conditions.
• unit testing - the most 'micro' scale of testing; to test particular functions or code modules. Typically done by the programmer and not by testers, as it requires detailed knowledge of the internal program design and code. Not always easily done unless the application has a well-designed architecture with tight code; may require developing test driver modules or test harnesses.
• incremental integration testing - continuous testing of an application as new functionality is added; requires that various aspects of an application's functionality be independent enough to work separately before all parts of the program are completed, or that test drivers be developed as needed; done by programmers or by testers.
• integration testing - testing of combined parts of an application to determine if they function together correctly. The 'parts' can be code modules, individual applications, client and server applications on a network, etc. This type of testing is especially relevant to client/server and distributed systems.
• functional testing - black-box type testing geared to functional requirements of an application; this type of testing should be done by testers. This doesn't mean that the programmers shouldn't check that their code works before releasing it (which of course applies to any stage of testing.)
• system testing - black-box type testing that is based on overall requirements specifications; covers all combined parts of a system.
• end-to-end testing - similar to system testing; the 'macro' end of the test scale; involves testing of a complete application environment in a situation that mimics real-world use, such as interacting with a database, using network communications, or interacting with other hardware, applications, or systems if appropriate.
• sanity testing or smoke testing - typically an initial testing effort to determine if a new software version is performing well enough to accept it for a major testing effort. For example, if the new software is crashing systems every 5 minutes, bogging down systems to a crawl, or corrupting databases, the software may not be in a 'sane' enough condition to warrant further testing in its current state.
• regression testing - re-testing after fixes or modifications of the software or its environment. It can be difficult to determine how much re-testing is needed, especially near the end of the development cycle. Automated testing tools can be especially useful for this type of testing.
• acceptance testing - final testing based on specifications of the end-user or customer, or based on use by end-users/customers over some limited period of time.
• load testing - testing an application under heavy loads, such as testing of a web site under a range of loads to determine at what point the system's response time degrades or fails.
• stress testing - term often used interchangeably with 'load' and 'performance' testing. Also used to describe such tests as system functional testing while under unusually heavy loads, heavy repetition of certain actions or inputs, input of large numerical values, large complex queries to a database system, etc.
• performance testing - term often used interchangeably with 'stress' and 'load' testing. Ideally 'performance' testing (and any other 'type' of testing) is defined in requirements documentation or QA or Test Plans.
• usability testing - testing for 'user-friendliness'. Clearly this is subjective, and will depend on the targeted end-user or customer. User interviews, surveys, video recording of user sessions, and other techniques can be used. Programmers and testers are usually not appropriate as usability testers.
• install/uninstall testing - testing of full, partial, or upgrade install/uninstall processes.
• recovery testing - testing how well a system recovers from crashes, hardware failures, or other catastrophic problems.
• security testing - testing how well the system protects against unauthorized internal or external access, willful damage, etc; may require sophisticated testing techniques.
• compatability testing - testing how well software performs in a particular hardware/software/operating system/network/etc. environment.
• exploratory testing - often taken to mean a creative, informal software test that is not based on formal test plans or test cases; testers may be learning the software as they test it.
• ad-hoc testing - similar to exploratory testing, but often taken to mean that the testers have significant understanding of the software before testing it.
• user acceptance testing - determining if software is satisfactory to an end-user or customer.
• comparison testing - comparing software weaknesses and strengths to competing products.
• alpha testing - testing of an application when development is nearing completion; minor design changes may still be made as a result of such testing. Typically done by end-users or others, not by programmers or testers.
• beta testing - testing when development and testing are essentially completed and final bugs and problems need to be found before final release. Typically done by end-users or others, not by programmers or testers.
• mutation testing - a method for determining if a set of test data or test cases is useful, by deliberately introducing various code changes ('bugs') and retesting with the original test data/cases to determine if the 'bugs' are detected. Proper implementation requires large computational resources.

What are 5 common problems in the software development process?
• poor requirements - if requirements are unclear, incomplete, too general, or not testable, there will be problems.
• unrealistic schedule - if too much work is crammed in too little time, problems are inevitable.
• inadequate testing - no one will know whether or not the program is any good until the customer complains or systems crash.
• featuritis - requests to pile on new features after development is underway; extremely common.
• miscommunication - if developers don't know what's needed or customer's have erroneous expectations, problems are guaranteed.

What are 5 common solutions to software development problems?
• solid requirements - clear, complete, detailed, cohesive, attainable, testable requirements that are agreed to by all players. Use prototypes to help nail down requirements.
• realistic schedules - allow adequate time for planning, design, testing, bug fixing, re-testing, changes, and documentation; personnel should be able to complete the project without burning out.
• adequate testing - start testing early on, re-test after fixes or changes, plan for adequate time for testing and bug-fixing.
• stick to initial requirements as much as possible - be prepared to defend against changes and additions once development has begun, and be prepared to explain consequences. If changes are necessary, they should be adequately reflected in related schedule changes. If possible, use rapid prototyping during the design phase so that customers can see what to expect. This will provide them a higher comfort level with their requirements decisions and minimize changes later on.
• communication - require walkthroughs and inspections when appropriate; make extensive use of group communication tools - e-mail, groupware, networked bug-tracking tools and change management tools, intranet capabilities, etc.; insure that documentation is available and up-to-date - preferably electronic, not paper; promote teamwork and cooperation; use protoypes early on so that customers' expectations are clarified.

What is software 'quality'?

Quality software is reasonably bug-free, delivered on time and within budget, meets requirements and/or expectations, and is maintainable. However, quality is obviously a subjective term. It will depend on who the 'customer' is and their overall influence in the scheme of things. A wide-angle view of the 'customers' of a software development project might include end-users, customer acceptance testers, customer contract officers, customer management, the development organization's management/accountants/testers/salespeople, future software maintenance engineers, stockholders, magazine columnists, etc. Each type of 'customer' will have their own slant on 'quality' - the accounting department might define quality in terms of profits while an end-user might define quality as user-friendly and bug-free.

What is 'good code'?
'Good code' is code that works, is bug free, and is readable and maintainable. Some organizations have coding 'standards' that all developers are supposed to adhere to, but everyone has different ideas about what's best, or what is too many or too few rules. There are also various theories and metrics, such as McCabe Complexity metrics. It should be kept in mind that excessive use of standards and rules can stifle productivity and creativity. 'Peer reviews', 'buddy checks' code analysis tools, etc. can be used to check for problems and enforce standards.

For C and C++ coding, here are some typical ideas to consider in setting rules/standards; these may or may not apply to a particular situation:
• minimize or eliminate use of global variables.
• use descriptive function and method names - use both upper and lower case, avoid abbreviations, use as many characters as necessary to be adequately descriptive (use of more than 20 characters is not out of line); be consistent in naming conventions.
• use descriptive variable names - use both upper and lower case, avoid abbreviations, use as many characters as necessary to be adequately descriptive (use of more than 20 characters is not out of line); be consistent in naming conventions.
• function and method sizes should be minimized; less than 100 lines of code is good, less than 50 lines is preferable.
• function descriptions should be clearly spelled out in comments preceding a function's code.
• organize code for readability.
• use whitespace generously - vertically and horizontally
• each line of code should contain 70 characters max.
• one code statement per line.
• coding style should be consistent throught a program (eg, use of brackets, indentations, naming conventions, etc.)
• in adding comments, err on the side of too many rather than too few comments; a common rule of thumb is that there should be at least as many lines of comments (including header blocks) as lines of code.
• no matter how small, an application should include documentaion of the overall program function and flow (even a few paragraphs is better than nothing); or if possible a separate flow chart and detailed program documentation.
• make extensive use of error handling procedures and status and error logging.
• for C++, to minimize complexity and increase maintainability, avoid too many levels of inheritance in class heirarchies (relative to the size and complexity of the application). Minimize use of multiple inheritance, and minimize use of operator overloading (note that the Java programming language eliminates multiple inheritance and operator overloading.)
• for C++, keep class methods small, less than 50 lines of code per method is preferable.
• for C++, make liberal use of exception handlers

What is 'good design'?
'Design' could refer to many things, but often refers to 'functional design' or 'internal design'. Good internal design is indicated by software code whose overall structure is clear, understandable, easily modifiable, and maintainable; is robust with sufficient error-handling and status logging capability; and works correctly when implemented. Good functional design is indicated by an application whose functionality can be traced back to customer and end-user requirements. (See further discussion of functional and internal design in 'What's the big deal about requirements?' in FAQ #2.) For programs that have a user interface, it's often a good idea to assume that the end user will have little computer knowledge and may not read a user manual or even the on-line help; some common rules-of-thumb include:
• the program should act in a way that least surprises the user
• it should always be evident to the user what can be done next and how to exit
• the program shouldn't let the users do something stupid without warning them.

What is SEI? CMM? ISO? IEEE? ANSI? Will it help?
• SEI = 'Software Engineering Institute' at Carnegie-Mellon University; initiated by the U.S. Defense Department to help improve software development processes.
• CMM = 'Capability Maturity Model', developed by the SEI. It's a model of 5 levels of organizational 'maturity' that determine effectiveness in delivering quality software. It is geared to large organizations such as large U.S. Defense Department contractors. However, many of the QA processes involved are appropriate to any organization, and if reasonably applied can be helpful. Organizations can receive CMM ratings by undergoing assessments by qualified auditors.

Level 1 - characterized by chaos, periodic panics, and heroic efforts required by individuals to successfully complete projects. Few if any processes in place; successes may not be repeatable.

Level 2 - software project tracking, requirements management, realistic planning, and configuration management processes are in place; successful practices can be repeated.

Level 3 - standard software development and maintenance processes are integrated throughout an organization; a Software Engineering Process Group is is in place to oversee software processes, and training programs are used to ensure understanding and compliance.

Level 4 - metrics are used to track productivity, processes, and products. Project performance is predictable, and quality is consistently high.

Level 5 - the focus is on continouous process improvement. The impact of new processes and technologies can be predicted and effectively implemented when required.

Perspective on CMM ratings: During 1997-2001, 1018 organizations were assessed. Of those, 27% were rated at Level 1, 39% at 2, 23% at 3, 6% at 4, and 5% at 5. (For ratings during the period 1992-96, 62% were at Level 1, 23% at 2, 13% at 3, 2% at 4, and
0.4% at 5.) The median size of organizations was 100 software engineering/maintenance personnel; 32% of organizations were U.S. federal contractors or agencies. For those rated at
Level 1, the most problematical key process area was in Software Quality Assurance.

• ISO = 'International Organisation for Standardization' - The ISO 9001:2000 standard (which replaces the previous standard of 1994) concerns quality systems that are assessed by outside auditors, and it applies to many kinds of production and manufacturing organizations, not just software. It covers documentation, design, development, production, testing, installation, servicing, and other processes. The full set of standards consists of: (a)Q9001-2000 - Quality Management Systems: Requirements; (b)Q9000-2000 - Quality Management Systems: Fundamentals and Vocabulary; (c)Q9004-2000 - Quality Management Systems: Guidelines for Performance Improvements. To be ISO 9001 certified, a third-party auditor assesses an organization, and certification is typically good for about 3 years, after which a complete reassessment is required. Note that ISO certification does not necessarily indicate quality products - it indicates only that documented processes are followed. Also see http://www.iso.ch/ for the latest information. In the U.S. the standards can be purchased via the ASQ web site at http://e-standards.asq.org/

• IEEE = 'Institute of Electrical and Electronics Engineers' - among other things, creates standards such as 'IEEE Standard for Software Test Documentation' (IEEE/ANSI Standard 829), 'IEEE Standard of Software Unit Testing (IEEE/ANSI Standard 1008), 'IEEE Standard for Software Quality Assurance Plans' (IEEE/ANSI Standard 730), and others.

• ANSI = 'American National Standards Institute', the primary industrial standards body in the U.S.; publishes some software-related standards in conjunction with the IEEE and ASQ (American Society for Quality).

• Other software development process assessment methods besides CMM and ISO 9000 include SPICE, Trillium, TickIT. and Bootstrap.

What is the 'software life cycle'?

The life cycle begins when an application is first conceived and ends when it is no longer in use. It includes aspects such as initial concept, requirements analysis, functional design, internal design, documentation planning, test planning, coding, document preparation, integration, testing, maintenance, updates, retesting, phase-out, and other aspects.

Will automated testing tools make testing easier?
• Possibly. For small projects, the time needed to learn and implement them may not be worth it. For larger projects, or on-going long-term projects they can be valuable.
• A common type of automated tool is the 'record/playback' type. For example, a tester could click through all combinations of menu choices, dialog box choices, buttons, etc. in an application GUI and have them 'recorded' and the results logged by a tool. The 'recording' is typically in the form of text based on a scripting language that is interpretable by the testing tool. If new buttons are added, or some underlying code in the application is changed, etc. the application might then be retested by just 'playing back' the 'recorded' actions, and comparing the logging results to check effects of the changes. The problem with such tools is that if there are continual changes to the system being tested, the 'recordings' may have to be changed so much that it becomes very time-consuming to continuously update the scripts. Additionally, interpretation and analysis of results (screens, data, logs, etc.) can be a difficult task. Note that there are record/playback tools for text-based interfaces also, and for all types of platforms.
• Other automated tools can include:
code analyzers - monitor code complexity, adherence to standards, etc.
coverage analyzers - these tools check which parts of the code have been exercised by a test, and may be oriented to code statement coverage, condition coverage, path coverage, etc.
memory analyzers - such as bounds-checkers and leak detectors.
load/performance test tools - for testing client/server and web applications under various load
levels.
web test tools - to check that links are valid, HTML code usage is correct, client-side and server-side programs work, a web site's interactions are secure.

other tools - for test case management, documentation management, bug reporting, and configuration management.

Some more questions on testing

Which one of the following is NOT a benefit of testing?
a Identification of errors.
b Confirmation of recovery procedures.
c Confirmation that software complies with the specification.
d Introduction of new errors due to inadequate reporting.

A test plan should include the
a expected inputs for stated outputs
b user instructions
c screen layouts
d expected outputs for stated inputs.

The purpose of performance testing is to
a prove response times are acceptable
b prove printed output is acceptable
c find errors in software
d test with invalid input data.

Debugging tools are used during testing to resolve
a compilation errors
b specification errors
c known logical errors
d known syntax errors.

Which one of the following could be a potential hazard in the workplace?
a Anti-glare computer screens.
b Trailing cables.
c Planned furniture layout.
d Uncluttered desks.

Software Testing Interview Questions - Win Runner

1) Advantages of Automation Tools in Testing?
a) Minimum requirement of human resource.
b) Accurary.
c) Reliable
d) Less time consuming-Faster than manual testing.
e) Reusable
f) Programmable

2) What is the latest version of WinRunner?
Latest version of WinRunner is 8.0

3) What is the language used in WinRunner?
TSL-Test Scipt Language (Similar to C)

4) Explain the Testing Process in WinRunner?
a) Create a Rapid Test Script Wizard.The Wizard automatically generates a series of tests,Which you can immediately run on your Application.
b) Additional tests can either be created or recorded
c) Debug the test
d) Run the test on new version to verufy the application behavior.

5)What are the components of WinRunner?
a)Test Window : This is a window where the TSL script is generated/programmed.
b)GUI Spy tool in WinRunner lets you spy on the GUI objets by recording the Properties.

6) How does WinRunner identify GUI objects?
The WR examines the GUI objects, and saves the object descriptions in a GUI Map File Later on when you run tests, Win Runner uses this file to identify and locate objects.Win Runner learns desctiption of a GUI object, it looks at the object's physical.Eeach GUI objects has many properties such as "class", "label","width", "height","handle",and "enable" to name a few However, Win Runner only learns the properties that uniquely distinguish an object from all other objects in the application
For example, when Win Runner looks at an Ok button, it might see that the butto9n is located in an Open window, belongs to the pushbutton object class, and has the test label "OK'.

7) What is GUI Spy?
GUI Spy tool in WinRunner lets you spy on the GUI object by recording the propreties.
path: Tools/GUI Spy and start recording.

8) What are all captured in GUI Spy?
a) class to which the object relates.
b)label.
c)Description of the object.

9) What is Rapid Test Script Wizard?
it performs two tasks.
a)It systematically opens the windows in your application and learns a description of Every GUI object.The wizard stores this information in a GUI map file.
b) It automatically generates tests base on the information it learned as it navigated through the application.

10) What is a User Interface test?
The User Interface test compiles an AUT in accordance with microsoft standards.
A user interface test checks the following:
. GUI objects do not overlap
. GUI objects are aligned in windows
. Text labels on GUI objects begin with capital letters
. Text labels on GUI objects are clearly visible
. OK and Cancel buttons appear in every window
. A system menu is available in every window.

11) What are the different modes in learning an application under Rapid test script wizard?
a) Express
b) Comprehensive.

12) What are the different reocd modes?
a) Analog
b) Context Sensitive

13) What is Context Sensitive Mode?
Context Sensitive mode records the operations you perform in terms of the GUI Objects in your application. Win Runner identifies each objects you click (such as a window, menu, list, or button), and the tupe of operation you perform (such as Press,enable, move, or select)

14) What is Analog mode?
In Analog mode, WinRunner records the exact coordinates traveled buy the mouse, as well as mouse clicks and keyboard input.

15) When Context Sensitive mode is to be chosen?
a) The application contains GUI objects
b) Does not require exact mouse movements.

16) When Analog mode is to be chosen?
a) The application contains bitmap areas.
b) Does require exact mouse movements.

17) What are the different run modes?
i) verify: Use verify Mode When rnning a test to check the behaviour of your application,and when your want to save the test results.
ii) Debug: Use Debug Mode when you want to check that the test script runs smoothly without errors in syntax.
iii) Update: Use Update mode when your want to create new expected results for a GUI checkpoint or bitmap checkpoint.

18) What is Synchronization?
When you run tests. your application may not alwayus respond to input with the Same speed .For example, it might take a few seconds:
. to retrive information from a database
. for a window to pop up
. for a progress bar to reach 100%
. for a status message to appear

Win Runner waits a set amount of time for an application to respond to input. The default amount of time that win Runner waits is up to 10 seconds. If the application responds slowly during a test run, WinRunner's default wait time may not be enough, and WinRunner may try to continue the test before the application is ready. The test run, will then unexpectedly fail. If your discover a synchronization problem between the test and uyour application, you can either:

. Increase the default time that the WinRunner waits. to do so, your change thevalue of the timeout test option tin the Options dialog box (Settings Options): This method affects all your tests and slows down many other Context Sensitive operations.

. Insert a synchronization point into the test scpipt at the exact point that the problem occuts.A synchronization point tells WinRunner to pause the test run in order to wait for a specified response in the application.

19) How to change synchronization options?
In Settings / Options click the run tab- Increase the timeout seconds. Or Create wait bitmap option.

20) What is GUI Checkpoint?
A GUI checkpoint examines the bahavior of object's properties

21) What is a checklist?
A checklist contains information about GUI and the selected properties to check.

22) What are the prerequisites for running a test?
a) Make sure that the application under test is Open on the desktop.
b) Check the verity mode
c) Choose run from top
d) Run the test
e) Review the results.

23) When a bitmap check is failed?
When the screen settings are changed.

24) How to add functions in WinRunner?
You can quickly add these functions to a test script using WinRunner's visual Programming tool, the Functiong Genetator.
The Function Generator enables you to add TSL Functions in two ways:
a) You can point to a GUI object and let Win Runner "suggest" an appropriate Function. You can then insert this function into the test script.
b) You can select a function from a list. Functions are presented both by category and alphabetically

25) What is tl_step?
In most cases when you run a test, WinRunner reports an overall test result of Pass or fail. By adding tl_step statements to your test script. You can determine whether a perticular operation within the test passed of failled, and send a Message to the report.

Software Testing Interview Questions - Load Runner

1. What is load testing?
Load testing is to test that if the application works fine with the loads that result from large number of simultaneous users, transactions and to determine weather it can handle peak usage periods.

2. What is Performance testing?
Timing for both read and update transactions should be gathered to determine whether system functions are being performed in an acceptable timeframe. This should be done standalone and then in a multi user environment to determine the effect of multiple transactions on the timing of a single transaction.

3. Did u use LoadRunner? What version?
Yes. Version 7.2.

4. Explain the Load testing process?
Step 1: Planning the test. Here, we develop a clearly defined test plan to ensure the test scenarios we develop will accomplish load-testing objectives. Step 2: Creating Vusers. Here, we create Vuser scripts that contain tasks performed by each Vuser, tasks performed by Vusers as a whole, and tasks measured as transactions. Step 3: Creating the scenario. A scenario describes the events that occur during a testing session. It includes a list of machines, scripts, and Vusers that run during the scenario. We create scenarios using LoadRunner Controller. We can create manual scenarios as well as goal-oriented scenarios. In manual scenarios, we define the number of Vusers, the load generator machines, and percentage of Vusers to be assigned to each script. For web tests, we may create a goal-oriented scenario where we define the goal that our test has to achieve. LoadRunner automatically builds a scenario for us. Step 4: Running the scenario.

We emulate load on the server by instructing multiple Vusers to perform tasks simultaneously. Before the testing, we set the scenario configuration and scheduling. We can run the entire scenario, Vuser groups, or individual Vusers. Step 5: Monitoring the scenario.

We monitor scenario execution using the LoadRunner online runtime, transaction, system resource, Web resource, Web server resource, Web application server resource, database server resource, network delay, streaming media resource, firewall server resource, ERP server resource, and Java performance monitors. Step 6: Analyzing test results. During scenario execution, LoadRunner records the performance of the application under different loads. We use LoadRunner’s graphs and reports to analyze the application’s performance.

5. When do you do load and performance Testing?
We perform load testing once we are done with interface (GUI) testing. Modern system architectures are large and complex. Whereas single user testing primarily on functionality and user interface of a system component, application testing focuses on performance and reliability of an entire system. For example, a typical application-testing scenario might depict 1000 users logging in simultaneously to a system. This gives rise to issues such as what is the response time of the system, does it crash, will it go with different software applications and platforms, can it hold so many hundreds and thousands of users, etc. This is when we set do load and performance testing.

6. What are the components of LoadRunner?
The components of LoadRunner are The Virtual User Generator, Controller, and the Agent process, LoadRunner Analysis and Monitoring, LoadRunner Books Online.

7. What Component of LoadRunner would you use to record a Script?
The Virtual User Generator (VuGen) component is used to record a script. It enables you to develop Vuser scripts for a variety of application types and communication protocols.

8. What Component of LoadRunner would you use to play Back the script in multi user mode?
The Controller component is used to playback the script in multi-user mode. This is done during a scenario run where a vuser script is executed by a number of vusers in a group.

9. What is a rendezvous point?
You insert rendezvous points into Vuser scripts to emulate heavy user load on the server. Rendezvous points instruct Vusers to wait during test execution for multiple Vusers to arrive at a certain point, in order that they may simultaneously perform a task. For example, to emulate peak load on the bank server, you can insert a rendezvous point instructing 100 Vusers to deposit cash into their accounts at the same time.

10. What is a scenario?
A scenario defines the events that occur during each testing session. For example, a scenario defines and controls the number of users to emulate, the actions to be performed, and the machines on which the virtual users run their emulations.

11. Explain the recording mode for web Vuser script?
We use VuGen to develop a Vuser script by recording a user performing typical business processes on a client application. VuGen creates the script by recording the activity between the client and the server. For example, in web based applications, VuGen monitors the client end of the database and traces all the requests sent to, and received from, the database server. We use VuGen to: Monitor the communication between the application and the server; Generate the required function calls; and Insert the generated function calls into a Vuser script.

12. Why do you create parameters?
Parameters are like script variables. They are used to vary input to the server and to emulate real users. Different sets of data are sent to the server each time the script is run. Better simulate the usage model for more accurate testing from the Controller; one script can emulate many different users on the system.

13. What is correlation?Explain the difference between automatic correlation and manual correlation?
Correlation is used to obtain data which are unique for each run of the script and which are generated by nested queries. Correlation provides the value to avoid errors arising out of duplicate values and also optimizing the code (to avoid nested queries). Automatic correlation is where we set some rules for correlation. It can be application server specific. Here values are replaced by data which are created by these rules. In manual correlation, the value we want to correlate is scanned and create correlation is used to correlate.

14. How do you find out where correlation is required? Give few examples from your projects?
Two ways: First we can scan for correlations, and see the list of values which can be correlated. From this we can pick a value to be correlated. Secondly, we can record two scripts and compare them. We can look up the difference file to see for the values which needed to be correlated. In my project, there was a unique id developed for each customer, it was nothing but Insurance Number, it was generated automatically and it was sequential and this value was unique. I had to correlate this value, in order to avoid errors while running my script. I did using scan for correlation.

15. Where do you set automatic correlation options?
Automatic correlation from web point of view can be set in recording options and correlation tab. Here we can enable correlation for the entire script and choose either issue online messages or offline actions, where we can define rules for that correlation. Automatic correlation for database can be done using show output window and scan for correlation and picking the correlate query tab and choose which query value we want to correlate. If we know the specific value to be correlated, we just do create correlation for the value and specify how the value to be created.

16. What is a function to capture dynamic values in the web Vuser script?
Web_reg_save_param function saves dynamic data information to a parameter.

17. When do you disable log in Virtual User Generator, When do you choose standard and extended logs?
Once we debug our script and verify that it is functional, we can enable logging for errors only. When we add a script to a scenario, logging is automatically disabled. Standard Log Option: When you select

Standard log, it creates a standard log of functions and messages sent during script execution to use for debugging. Disable this option for large load testing scenarios. When you copy a script to a scenario, logging is automatically disabled Extended Log Option: Select

extended log to create an extended log, including warnings and other messages. Disable this option for large load testing scenarios. When you copy a script to a scenario, logging is automatically disabled. We can specify which additional information should be added to the extended log using the Extended log options.

18. How do you debug a LoadRunner script?
VuGen contains two options to help debug Vuser scripts-the Run Step by Step command and breakpoints. The Debug settings in the Options dialog box allow us to determine the extent of the trace to be performed during scenario execution. The debug information is written to the Output window. We can manually set the message class within your script using the lr_set_debug_message function. This is useful if we want to receive debug information about a small section of the script only.

19. How do you write user defined functions in LR? Give me few functions you wrote in your previous project?
Before we create the User Defined functions we need to create the external library (DLL) with the function. We add this library to VuGen bin directory. Once the library is added then we assign user defined function as a parameter. The function should have the following format: __declspec (dllexport) char* (char*, char*)Examples of user defined functions are as follows:GetVersion, GetCurrentTime, GetPltform are some of the user defined functions used in my earlier project.

20. What are the changes you can make in run-time settings?
The Run Time Settings that we make are: a) Pacing - It has iteration count. b) Log - Under this we have Disable Logging Standard Log and c) Extended Think Time - In think time we have two options like Ignore think time and Replay think time. d) General - Under general tab we can set the vusers as process or as multithreading and whether each step as a transaction.

21. Where do you set Iteration for Vuser testing?
We set Iterations in the Run Time Settings of the VuGen. The navigation for this is Run time settings, Pacing tab, set number of iterations.

22. How do you perform functional testing under load?
Functionality under load can be tested by running several Vusers concurrently. By increasing the amount of Vusers, we can determine how much load the server can sustain.

23. What is Ramp up? How do you set this?
This option is used to gradually increase the amount of Vusers/load on the server. An initial value is set and a value to wait between intervals can be specified. To set Ramp Up, go to ‘Scenario Scheduling Options’

24. What is the advantage of running the Vuser as thread?
VuGen provides the facility to use multithreading. This enables more Vusers to be run per generator. If the Vuser is run as a process, the same driver program is loaded into memory for each Vuser, thus taking up a large amount of memory. This limits the number of Vusers that can be run on a single generator. If the Vuser is run as a thread, only one instance of the driver program is loaded into memory for the given number of Vusers (say 100). Each thread shares the memory of the parent driver program, thus enabling more Vusers to be run per generator.

25. If you want to stop the execution of your script on error, how do you do that? The lr_abort function aborts the execution of a Vuser script. It instructs the Vuser to stop executing the Actions section, execute the vuser_end section and end the execution. This function is useful when you need to manually abort a script execution as a result of a specific error condition. When you end a script using this function, the Vuser is assigned the status "Stopped". For this to take effect, we have to first uncheck the “Continue on error” option in Run-Time Settings.

26. What is the relation between Response Time and Throughput?
The Throughput graph shows the amount of data in bytes that the Vusers received from the server in a second. When we compare this with the transaction response time, we will notice that as throughput decreased, the response time also decreased. Similarly, the peak throughput and highest response time would occur approximately at the same time.

27. Explain the Configuration of your systems?
The configuration of our systems refers to that of the client machines on which we run the Vusers. The configuration of any client machine includes its hardware settings, memory, operating system, software applications, development tools, etc. This system component configuration should match with the overall system configuration that would include the network infrastructure, the web server, the database server, and any other components that go with this larger system so as to achieve the load testing objectives.

28. How do you identify the performance bottlenecks?
Performance Bottlenecks can be detected by using monitors. These monitors might be application server monitors, web server monitors, database server monitors and network monitors. They help in finding out the troubled area in our scenario which causes increased response time. The measurements made are usually performance response time, throughput, hits/sec, network delay graphs, etc.

29. If web server, database and Network are all fine where could be the problem?
The problem could be in the system itself or in the application server or in the code written for the application.

30. How did you find web server related issues?
Using Web resource monitors we can find the performance of web servers. Using these monitors we can analyze throughput on the web server, number of hits per second that occurred during scenario, the number of http responses per second, the number of downloaded pages per second.

31. How did you find database related issues?
By running “Database” monitor and help of “Data Resource Graph” we can find database related issues. E.g. You can specify the resource you want to measure on before running the controller and than you can see database related issues

32. Explain all the web recording options?

33. What is the difference between Overlay graph and Correlate graph?
Overlay Graph: It overlay the content of two graphs that shares a common x-axis. Left Y-axis on the merged graph show’s the current graph’s value & Right Y-axis show the value of Y-axis of the graph that was merged. Correlate Graph: Plot the Y-axis of two graphs against each other. The active graph’s Y-axis becomes X-axis of merged graph. Y-axis of the graph that was merged becomes merged graph’s Y-axis.

34. How did you plan the Load? What are the Criteria?
Load test is planned to decide the number of users, what kind of machines we are going to use and from where they are run. It is based on 2 important documents, Task Distribution Diagram and Transaction profile. Task Distribution Diagram gives us the information on number of users for a particular transaction and the time of the load. The peak usage and off-usage are decided from this Diagram. Transaction profile gives us the information about the transactions name and their priority levels with regard to the scenario we are deciding.

35. What does vuser_init action contain?
Vuser_init action contains procedures to login to a server.

36. What does vuser_end action contain?
Vuser_end section contains log off procedures.

37. What is think time? How do you change the threshold?
Think time is the time that a real user waits between actions. Example: When a user receives data from a server, the user may wait several seconds to review the data before responding. This delay is known as the think time. Changing the Threshold: Threshold level is the level below which the recorded think time will be ignored. The default value is five (5) seconds. We can change the think time threshold in the Recording options of the Vugen.

38. What is the difference between standard log and extended log?
The standard log sends a subset of functions and messages sent during script execution to a log. The subset depends on the Vuser type Extended log sends a detailed script execution messages to the output log. This is mainly used during debugging when we want information about: Parameter substitution. Data returned by the server. Advanced trace.

39. Explain the following functions: - lr_debug_message
The lr_debug_message function sends a debug message to the output log when the specified message class is set.
lr_output_message
The lr_output_message function sends notifications to the Controller Output window and the Vuser log file.
lr_error_message
The lr_error_message function sends an error message to the LoadRunner Output window. lrd_stmt
The lrd_stmt function associates a character string (usually a SQL statement) with a cursor. This function sets a SQL statement to be processed.
lrd_fetch

The lrd_fetch function fetches the next row from the result set.

40. Throughput
If the throughput scales upward as time progresses and the number of Vusers increase, this indicates that the bandwidth is sufficient. If the graph were to remain relatively flat as the number of Vusers increased, it would be reasonable to conclude that the bandwidth is constraining the volume of data delivered.

41. Types of Goals in Goal-Oriented Scenario
Load Runner provides you with five different types of goals in a goal oriented scenario:
o The number of concurrent Vusers
o The number of hits per second
o The number of transactions per second
o The number of pages per minute
o The transaction response time that you want your scenario

42. Analysis Scenario (Bottlenecks):
In Running Vuser graph correlated with the response time graph you can see that as the number of Vusers increases, the average response time of the check itinerary transaction very gradually increases. In other words, the average response time steadily increases as the load increases. At 56 Vusers, there is a sudden, sharp increase in the average response time. We say that the test broke the server. That is the mean time before failure (MTBF). The response time clearly began to degrade when there were more than 56 Vusers running simultaneously.

43. What is correlation? Explain the difference between automatic correlation and manual correlation?
Correlation is used to obtain data which are unique for each run of the script and which are generated by nested queries. Correlation provides the value to avoid errors arising out of duplicate values and also optimizing the code (to avoid nested queries). Automatic correlation is where we set some rules for correlation. It can be application server specific. Here values are replaced by data which are created by these rules. In manual correlation, the value we want to correlate is scanned and create correlation is used to correlate.

44. Where do you set automatic correlation options?
Automatic correlation from web point of view, can be set in recording options and correlation tab. Here we can enable correlation for the entire script and choose either issue online messages or offline actions, where we can define rules for that correlation. Automatic correlation for database, can be done using show output window and scan for correlation and picking the correlate query tab and choose which query value we want to correlate. If we know the specific value to be correlated, we just do create correlation for the value and specify how the value to be created.

45. What is a function to capture dynamic values in the web vuser script?
Web_reg_save_param function saves dynamic data information to a parameter.

C Interview Questions

What is function overloading and operator overloading?

Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading. When an overloaded function is called, the C++ compiler selects the proper function by examining the number, types and order of the arguments in the call. Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types.

Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesn't add anything fundamental to the language (but they can improve understandability and reduce maintenance costs).

How do you find out if a linked-list has an end? (i.e. the list is not a cycle)

You can find out by using 2 pointers. One of them goes 2 nodes each time. The second one goes at 1 nodes each time. If there is a cycle, the one that goes 2 nodes each time will eventually meet the one that goes slower. If that is the case, then you will know the linked-list is a cycle.

What is the difference between realloc() and free()?

The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer.

What are the advantages of inheritance?

It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.

What is the difference between declaration and definition?

The declaration tells the compiler that at some later point we plan to present the definition of this declaration.
E.g.: void stars () //function declaration
The definition contains the actual implementation.
E.g.: void stars () // declarator
{
for(int j=10; j > =0; j--) //function body
cout << *;
cout <<>

How do you write a function that can reverse a linked-list?

void reverselist(void)
{
if(head==0)
return;
if(head->next==0)
return;
if(head->next==tail)
{
head->next = 0;
tail->next = head;
}
else
{
node* pre = head;
node* cur = head->next;
node* curnext = cur->next;
head->next = 0;
cur-> next = head;

for(; curnext!=0; )
{
cur->next = pre;
pre = cur;
cur = curnext;
curnext = curnext->next;
}
curnext->next = cur;
}
}

What do you mean by inline function?

The idea behind inline functions is to insert the code of a called function at the point where the function is called. If done carefully, this can improve the application's performance in exchange for increased compile time and possibly (but not always) an increase in the size of the generated binary executables.

Write a program that ask for user input from 5 to 9 then calculate the average

#include "iostream.h"
int main() {
int MAX = 4;
int total = 0;
int average;
int numb;
for (int i=0; icout << "Please enter your input between 5 and 9: ";
cin >> numb;
while ( numb<5>9) {
cout << "Invalid input, please re-enter: ";
cin >> numb;
}
total = total + numb;
}
average = total/MAX;
cout << "The average number is: " <<>return 0;
}

What is public, protected, private?

  • Public, protected and private are three access specifiers in C++.
  • Public data members and member functions are accessible outside the class.
  • Protected data members and member functions are only available to derived classes.
  • Private data members and member functions can’t be accessed outside the class. However there is an exception can be using friend classes.
Write a function that swaps the values of two integers, using int* as the argument type.
void swap(int* a, int*b) {
int t;
t = *a;
*a = *b;
*b = t;
}

Tell how to check whether a linked list is circular.

Create two pointers, each set to the start of the list. Update each as follows:
while (pointer1) {
pointer1 = pointer1->next;
pointer2 = pointer2->next; if (pointer2) pointer2=pointer2->next;
if (pointer1 == pointer2) {
print (\"circular\n\");
}
}

OK, why does this work?
If a list is circular, at some point pointer2 will wrap around and be either at the item just before pointer1, or the item before that. Either way, it’s either 1 or 2 jumps until they meet.

What is polymorphism?

Polymorphism is the idea that a base class can be inherited by several classes. A base class pointer can point to its child class and a base class array can store different child class objects.

Does c++ support multilevel and multiple inheritance?
Yes.

What are the advantages of inheritance?
• It permits code reusability.
• Reusability saves time in program development.
• It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.
What is the difference between declaration and definition?
The declaration tells the compiler that at some later point we plan to present the definition of this declaration.
E.g.: void stars () //function declaration
The definition contains the actual implementation.
E.g.: void stars () // declarator
{
for(int j=10; j>=0; j--) //function body
cout<<”*”;
cout<

When should you use multiple inheritance?

There are three acceptable answers: "Never," "Rarely," and "When the problem domain cannot be accurately modeled any other way."

What is the difference between an ARRAY and a LIST?

Answer1
Array is collection of homogeneous elements.
List is collection of heterogeneous elements.

For Array memory allocated is static and continuous.
For List memory allocated is dynamic and Random.

Array: User need not have to keep in track of next memory allocation.
List: User has to keep in Track of next location where memory is allocated.

Answer2
Array uses direct access of stored members, list uses sequencial access for members.

//With Array you have direct access to memory position 5
Object x = a[5]; // x takes directly a reference to 5th element of array

//With the list you have to cross all previous nodes in order to get the 5th node:
list mylist;
list::iterator it;

for( it = list.begin() ; it != list.end() ; it++ )
{
if( i==5)
{
x = *it;
break;
}
i++;
}

What is virtual constructors/destructors?

Answer1
Virtual destructors:

If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching the pointer type) is called on the object.
There is a simple solution to this problem declare a virtual base-class destructor.
This makes all derived-class destructors virtual even though they don’t have the same name as the base-class destructor. Now, if the object in the hierarchy is destroyed explicitly by applying the delete operator to a base-class pointer to a derived-class object, the destructor for the appropriate class is called. Virtual constructor: Constructors cannot be virtual. Declaring a constructor as a virtual function is a syntax error.

Answer2
Virtual destructors: If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching the pointer type) is called on the object.
There is a simple solution to this problem – declare a virtual base-class destructor. This makes all derived-class destructors virtual even though they don’t have the same name as the base-class destructor. Now, if the object in the hierarchy is destroyed explicitly by applying the delete operator to a base-class pointer to a derived-class object, the destructor for the appropriate class is called.

Virtual constructor: Constructors cannot be virtual. Declaring a constructor as a virtual function is a syntax error.

What is a template?

Templates allow to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until certain point they fulfill the functionality of a macro. Its prototype is any of the two following ones:

template function_declaration; template function_declaration;

The only difference between both prototypes is the use of keyword class or typename, its use is indistinct since both expressions have exactly the same meaning and behave exactly the same way.

You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. new() and malloc()

Answer1
1.) “new and delete” are preprocessors while “malloc() and free()” are functions. [we dont use brackets will calling new or delete].
2.) no need of allocate the memory while using “new” but in “malloc()” we have to use “sizeof()”.
3.) “new” will initlize the new memory to 0 but “malloc()” gives random value in the new alloted memory location [better to use calloc()]

Answer2
new() allocates continous space for the object instace
malloc() allocates distributed space.
new() is castless, meaning that allocates memory for this specific type,
malloc(), calloc() allocate space for void * that is cated to the specific class type pointer.

What is the difference between class and structure?

Structure: Initially (in C) a structure was used to bundle different type of data types together to perform a particular functionality. But C++ extended the structure to contain functions also. The major difference is that all declarations inside a structure are by default public.
Class: Class is a successor of Structure. By default all the members inside the class are private.

What is RTTI?

Runtime type identification (RTTI) lets you find the dynamic type of an object when you have only a pointer or a reference to the base type. RTTI is the official way in standard C++ to discover the type of an object and to convert the type of a pointer or reference (that is, dynamic typing). The need came from practical experience with C++. RTTI replaces many homegrown versions with a solid, consistent approach.

What is encapsulation?

Packaging an object’s variables within its methods is called encapsulation.

What is an object?

Object is a software bundle of variables and related methods. Objects have state and behavior.


Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW methods for two objects CIRCLE and SQUARE

Answer1
POLYMORPHISM : A phenomenon which enables an object to react differently to the same function call.
in C++ it is attained by using a keyword virtual

Example
public class SHAPE
{
public virtual void SHAPE::DRAW()=0;
}
Note here the function DRAW() is pure virtual which means the sub classes must implement the DRAW() method and SHAPE cannot be instatiated

public class CIRCLE::public SHAPE
{
public void CIRCLE::DRAW()
{
// TODO drawing circle
}
}
public class SQUARE::public SHAPE
{
public void SQUARE::DRAW()
{
// TODO drawing square
}
}
now from the user class the calls would be like
globally
SHAPE *newShape;

When user action is to draw
public void MENU::OnClickDrawCircle(){
newShape = new CIRCLE();
}

public void MENU::OnClickDrawCircle(){
newShape = new SQUARE();
}

the when user actually draws
public void CANVAS::OnMouseOperations(){
newShape->DRAW();
}

Answer2
class SHAPE{
public virtual Draw() = 0; //abstract class with a pure virtual method
};

class CIRCLE{
public int r;
public virtual Draw() { this->drawCircle(0,0,r); }
};

class SQURE
public int a;
public virtual Draw() { this->drawRectangular(0,0,a,a); }
};

Each object is driven down from SHAPE implementing Draw() function in its own way.

How can you tell what shell you are running on UNIX system?

You can do the Echo $RANDOM. It will return a undefined variable if you are from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5 digit random numbers if you are from the Korn shell. You could also do a ps -l and look for the shell with the highest PID.

What is namespace?

Namespaces allow us to group a set of global classes, objects and/or functions under a name. To say it somehow, they serve to split the global scope in sub-scopes known as namespaces.
The form to use namespaces is:
namespace identifier { namespace-body }
Where identifier is any valid identifier and namespace-body is the set of classes, objects and functions that are included within the namespace. For example:
namespace general { int a, b; } In this case, a and b are normal variables integrated within the general namespace. In order to access to these variables from outside the namespace we have to use the scope operator ::. For example, to access the previous variables we would have to put:
general::a general::b
The functionality of namespaces is specially useful in case that there is a possibility that a global object or function can have the same name than another one, causing a redefinition error.

What do you mean by inheritance?

Inheritance is the process of creating new classes, called derived classes, from existing classes or base classes. The derived class inherits all the capabilities of the base class, but can add embellishments and refinements of its own.

What is a COPY CONSTRUCTOR and when is it called?

A copy constructor is a method that accepts an object of the same class and copies it’s data members to the object on the left part of assignement:
class Point2D{
int x; int y;
public int color;
protected bool pinned;
public Point2D() : x(0) , y(0) {} //default (no argument) constructor
public Point2D( const Point2D & ) ;
};
Point2D::Point2D( const Point2D & p )
{
this->x = p.x;
this->y = p.y;
this->color = p.color;
this->pinned = p.pinned;
}
main(){
Point2D MyPoint;
MyPoint.color = 345;
Point2D AnotherPoint = Point2D( MyPoint ); // now AnotherPoint has color = 345

What is Boyce Codd Normal form?

A relation schema R is in BCNF with respect to a set F of functional dependencies if for all functional dependencies in F+ of the form a-> , where a and b is a subset of R, at least one of the following holds:
* a- > b is a trivial functional dependency (b is a subset of a)
* a is a superkey for schema R

What is virtual class and friend class?

Friend classes are used when two or more classes are designed to work together and need access to each other's implementation in ways that the rest of the world shouldn't be allowed to have. In other words, they help keep private things private. For instance, it may be desirable for class DatabaseCursor to have more privilege to the internals of class Database than main() has.

What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

virtual

What do you mean by binding of data and functions?

Encapsulation.

What are 2 ways of exporting a function from a DLL?

1.Taking a reference to the function from the DLL instance.
2. Using the DLL ’s Type Library.

What is the difference between an object and a class?

Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.
- A Class is static. All of the attributes of a class are fixed before, during, and after the execution of a program. The attributes of a class don't change.
- The class to which an object belongs is also (usually) static. If a particular object belongs to a certain class at the time that it is created then it almost certainly will still belong to that class right up until the time that it is destroyed.
- An Object on the other hand has a limited lifespan. Objects are created and eventually destroyed. Also during that lifetime, the attributes of the object may undergo significant change.

Describe PRIVATE, PROTECTED and PUBLIC – the differences and give examples.

class Point2D{
int x; int y;
public int color;
protected bool pinned;
public Point2D() : x(0) , y(0) {} //default (no argument) constructor
};
Point2D MyPoint;
You cannot directly access private data members when they are declared (implicitly) private:
MyPoint.x = 5; // Compiler will issue a compile ERROR
//Nor yoy can see them:
int x_dim = MyPoint.x; // Compiler will issue a compile ERROR
On the other hand, you can assign and read the public data members:
MyPoint.color = 255; // no problem
int col = MyPoint.color; // no problem
With protected data members you can read them but not write them: MyPoint.pinned = true; // Compiler will issue a compile ERROR
bool isPinned = MyPoint.pinned; // no problem


Suppose that data is an array of 1000 integers. Write a single function call that will sort the 100 elements data [222] through data [321].

quicksort ((data + 222), 100);

What is a class?

Class is a user-defined data type in C++. It can be created to solve a particular kind of problem. After creation the user need not know the specifics of the working of a class.

What is friend function?

As the name suggests, the function acts as a friend to a class. As a friend of a class, it can access its private and protected members. A friend function is not a member of the class. But it must be listed in the class definition.

Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?

Mergesort always makes recursive calls to sort subarrays that are about half size of the original array, resulting in O(n log n) time.

What is abstraction?

Abstraction is of the process of hiding unwanted details from the user.

What are virtual functions?

A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually of the derived class, even if the object is accessed by a base pointer rather than a derived pointer. This allows algorithms in the base class to be replaced in the derived class, even if users don't know about the derived class.

What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator.

An internal iterator is implemented with member functions of the class that has items to step through. .An external iterator is implemented as a separate class that can be "attach" to the object that has items to step through. .An external iterator has the advantage that many difference iterators can be active simultaneously on the same object.

What is a scope resolution operator?

A scope resolution operator (::), can be used to define the member functions of a class outside the class.

What do you mean by pure virtual functions?

A pure virtual member function is a member function that the base class forces derived classes to provide. Normally these member functions have no implementation. Pure virtual functions are equated to zero.

class Shape { public: virtual void draw() = 0; };

What is polymorphism? Explain with an example?

"Poly" means "many" and "morph" means "form". Polymorphism is the ability of an object (or reference) to assume (be replaced by) or become many different forms of object.
Example: function overloading, function overriding, virtual functions. Another example can be a plus ‘+’ sign, used for adding two integers or for using it to concatenate two strings.

How can you quickly find the number of elements stored in a a) static array b) dynamic array ?
Why is it difficult to store linked list in an array?
How can you find the nodes with repetetive data in a linked list?

Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable but aac or bcd are unacceptable.
Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique.

What’s the output of the following program? Why?

#include
main()
{
typedef union
{
int a;
char b[10];
float c;
}
Union;
Union x,y = {100};
x.a = 50;
strcpy(x.b,\"hello\");
x.c = 21.50;
printf(\"Union x : %d %s %f \n\",x.a,x.b,x.c );
printf(\"Union y :%d %s%f \n\",y.a,y.b,y.c);
}
Given inputs X, Y, Z and operations | and & (meaning bitwise OR and AND, respectively)
What is output equal to in

output = (X & Y) | (X & Z) | (Y & Z)

What problems might the following macro bring to the application?

#define sq(x) x*x

Anything wrong with this code?
T *p = new T[10];
delete p;


Everything is correct, Only the first element of the array will be deleted”, The entire array will be deleted, but only the first element destructor will be called.

Anything wrong with this code?
T *p = 0;
delete p;


Yes, the program will crash in an attempt to delete a null pointer.

How do you decide which integer type to use?

It depends on our requirement. When we are required an integer to be stored in 1 byte (means less than or equal to 255) we use short int, for 2 bytes we use int, for 8 bytes we use long int.
A char is for 1-byte integers, a short is for 2-byte integers, an int is generally a 2-byte or 4-byte integer (though not necessarily), a long is a 4-byte integer, and a long long is a 8-byte integer.

What’s the best way to declare and define global variables?

The best way to declare global variables is to declare them after including all the files so that it can be used in all the functions.

What does extern mean in a function declaration?

Using extern in a function declaration we can make a function such that it can used outside the file in which it is defined.
An extern variable, function definition, or declaration also makes the described variable or function usable by the succeeding part of the current source file. This declaration does not replace the definition. The declaration is used to describe the variable that is externally defined.
If a declaration for an identifier already exists at file scope, any extern declaration of the same identifier found within a block refers to that same object. If no other declaration for the identifier exists at file scope, the identifier has external linkage.

Why are arrays usually processed with for loop?

The real power of arrays comes from their facility of using an index variable to traverse the array, accessing each element with the same expression a[i]. All the is needed to make this work is a iterated statement in which the variable i serves as a counter, incrementing from 0 to a.length -1. That is exactly what a loop does.

What is an HTML tag?

An HTML tag is a syntactical construct in the HTML language that abbreviates specific instructions to be executed when the HTML script is loaded into a Web browser. It is like a method in Java, a function in C++, a procedure in Pascal, or a subroutine in FORTRAN.


What can I safely assume about the initial values of variables which are not explicitly initialized?

It depends on complier which may assign any garbage value to a variable if it is not initialized.

What is the difference between char a[] = “string”; and char *p = “string”;?

In the first case 6 bytes are allocated to the variable a which is fixed, where as in the second case if *p is assigned to some other value the allocate memory can change.

What’s the auto keyword good for?

Answer1
Not much. It declares an object with automatic storage duration. Which means the object will be destroyed at the end of the objects scope. All variables in functions that are not declared as static and not dynamically allocated have automatic storage duration by default.
For example
int main()
{
int a; //this is the same as writing “auto int a;”
}

Answer2
Local variables occur within a scope; they are “local” to a function. They are often called automatic variables because they automatically come into being when the scope is entered and automatically go away when the scope closes. The keyword auto makes this explicit, but local variables default to auto auto auto auto so it is never necessary to declare something as an auto auto auto auto.

What is the difference between char a[] = “string”; and char *p = “string”; ?

Answer1
a[] = “string”;
char *p = “string”;

The difference is this:
p is pointing to a constant string, you can never safely say
p[3]=’x';
however you can always say a[3]=’x';
char a[]=”string”; - character array initialization.
char *p=”string” ; - non-const pointer to a const-string.( this is permitted only in the case of char pointer in C++ to preserve backward compatibility with C.)

Answer2
a[] = “string”;
char *p = “string”;
a[] will have 7 bytes. However, p is only 4 bytes. P is pointing to an adress is either BSS or the data section (depending on which compiler — GNU for the former and CC for the latter).

Answer3
char a[] = “string”;
char *p = “string”;

for char a[]…….using the array notation 7 bytes of storage in the static memory block are taken up, one for each character and one for the terminating nul character.
But, in the pointer notation char *p………….the same 7 bytes required, plus N bytes to store the pointer variable “p” (where N depends on the system but is usually a minimum of 2 bytes and can be 4 or more)……

How do I initialize a pointer to a function?

This is the way to initialize a pointer to a function
void fun(int a)
{
}
void main()
{
void (*fp)(int);
fp=fun;
fp(1);
}


Explain the scope resolution operator.

It permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope.

What are the differences between a C++ struct and C++ class?

The default member and base-class access specifiers are different.

How many ways are there to initialize an int with a constant?

Two.
There are two formats for initializers in C++ as shown in the example that follows. The first format uses the traditional C notation. The second format uses constructor notation.
int foo = 123;
int bar (123);

How does throwing and catching exceptions differ from using setjmp and longjmp?

The throw operation calls the destructors for automatic objects instantiated since entry to the try block.

How do you link a C++ program to C functions?

By using the extern "C" linkage specification around the C function declarations.

How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

Answer1
If you want the code to be even slightly readable, you will use typedefs.
typedef char* (*functiontype_one)(void);
typedef functiontype_one (*functiontype_two)(void);
functiontype_two myarray[N]; //assuming N is a const integral

Answer2
char* (* (*a[N])())()
Here a is that array. And according to question no function will not take any parameter value.

What does extern mean in a function declaration?

It tells the compiler that a variable or a function exists, even if the compiler hasn’t yet seen it in the file currently being compiled. This variable or function may be defined in another file or further down in the current file.


What is a default constructor?

Default constructor WITH arguments class B { public: B (int m = 0) : n (m) {} int n; }; int main(int argc, char *argv[]) { B b; return 0; }

What is a conversion constructor?

A constructor that accepts one argument of a different type.

What is the difference between a copy constructor and an overloaded assignment operator?

A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class.


When is a template a better solution than a base class?

When you are designing a generic class to contain or otherwise manage objects of other types, when the format and behavior of those other types are unimportant to their containment or management, and particularly when those other types are unknown (thus, the genericity) to the designer of the container or manager class.

What is a mutable member?

One that can be modified by the class even when the object of the class or the member function doing the modification is const.

What is an explicit constructor?

A conversion constructor declared with the explicit keyword. The compiler does not use an explicit constructor to implement an implied conversion of types. It’s purpose is reserved explicitly for construction.

What is the Standard Template Library (STL)?

A library of container templates approved by the ANSI committee for inclusion in the standard C++ specification.
A programmer who then launches into a discussion of the generic programming model, iterators, allocators, algorithms, and such, has a higher than average understanding of the new technology that STL brings to C++ programming.

Explain the ISA and HASA class relationships. How would you implement each in a class design?

A specialized class "is" a specialization of another class and, therefore, has the ISA relationship with the other class. An Employee ISA Person. This relationship is best implemented with inheritance. Employee is derived from Person. A class may have an instance of another class. For example, an employee "has" a salary, therefore the Employee class has the HASA relationship with the Salary class. This relationship is best implemented by embedding an object of the Salary class in the Employee class.


Describe run-time type identification.

The ability to determine at run time the type of an object by using the typeid operator or the dynamic_cast operator.

What problem does the namespace feature solve?

Multiple providers of libraries might use common global identifiers causing a name collision when an application tries to link with two or more such libraries. The namespace feature surrounds a library’s external declarations with a unique namespace that eliminates the potential for those collisions.
This solution assumes that two library vendors don’t use the same namespace identifier, of course.

Are there any new intrinsic (built-in) data types?

Yes. The ANSI committee added the bool intrinsic type and its true and false value keywords.

Will the following program execute?
void main()
{
void *vptr = (void *) malloc(sizeof(void));
vptr++;
}


Answer1
It will throw an error, as arithmetic operations cannot be performed on void pointers.

Answer2
It will not build as sizeof cannot be applied to void* ( error “Unknown size” )

Answer3
How can it execute if it won’t even compile? It needs to be int main, not void main. Also, cannot increment a void *.

Answer4
According to gcc compiler it won’t show any error, simply it executes. but in general we can’t do arthematic operation on void, and gives size of void as 1

Answer5
The program compiles in GNU C while giving a warning for “void main”. The program runs without a crash. sizeof(void) is “1? hence when vptr++, the address is incremented by 1.

Answer6
Regarding arguments about GCC, be aware that this is a C++ question, not C. So gcc will compile and execute, g++ cannot. g++ complains that the return type cannot be void and the argument of sizeof() cannot be void. It also reports that ISO C++ forbids incrementing a pointer of type ‘void*’.

Answer7
in C++
voidp.c: In function `int main()’:
voidp.c:4: error: invalid application of `sizeof’ to a void type
voidp.c:4: error: `malloc’ undeclared (first use this function)
voidp.c:4: error: (Each undeclared identifier is reported only once for each function it appears in.)
voidp.c:6: error: ISO C++ forbids incrementing a pointer of type `void*’
But in c, it work without problems

void main()
{
char *cptr = 0?2000;
long *lptr = 0?2000;
cptr++;
lptr++;
printf(” %x %x”, cptr, lptr);
}Will it execute or not?


Answer1
For Q2: As above, won’t compile because main must return int. Also, 0×2000 cannot be implicitly converted to a pointer (I assume you meant 0×2000 and not 0?2000.)

Answer2
Not Excute.
Compile with VC7 results following errors:
error C2440: ‘initializing’ : cannot convert from ‘int’ to ‘char *’
error C2440: ‘initializing’ : cannot convert from ‘int’ to ‘long *’
Not Excute if it is C++, but Excute in C.
The printout:
2001 2004


In C++, what is the difference between method overloading and method overriding?

Overloading a method (or function) in C++ is the ability for functions of the same name to be defined as long as these methods have different signatures (different set of parameters). Method overriding is the ability of the inherited class rewriting the virtual method of the base class.

What methods can be overridden in Java?

In C++ terminology, all public methods in Java are virtual. Therefore, all Java methods can be overwritten in subclasses except those that are declared final, static, and private.

What are the defining traits of an object-oriented language?

The defining traits of an object-oriented langauge are:
* encapsulation
* inheritance
* polymorphism

Write a program that ask for user input from 5 to 9 then calculate the average

int main()
{
int MAX=4;
int total =0;
int average=0;
int numb;
cout<<"Please enter your input from 5 to 9";
cin>>numb;
if((numb <5)&&(numb>9))
cout<<"please re type your input";
else
for(i=0;i<=MAX; i++)
{
total = total + numb;
average= total /MAX;
}
cout<<"The average number is"<return 0;
}

Assignment Operator - What is the diffrence between a "assignment operator" and a "copy constructor"?

Answer1.
In assignment operator, you are assigning a value to an existing object. But in copy constructor, you are creating a new object and then assigning a value to that object. For example:
complex c1,c2;
c1=c2; //this is assignment
complex c3=c2; //copy constructor

Answer2.
A copy constructor is used to initialize a newly declared variable from an existing variable. This makes a deep copy like assignment, but it is somewhat simpler:
There is no need to test to see if it is being initialized from itself.
There is no need to clean up (eg, delete) an existing value (there is none).
A reference to itself is not returned.

"mutable" Keyword - What is "mutable"?

Answer1.
"mutable" is a C++ keyword. When we declare const, none of its data members can change. When we want one of its members to change, we declare it as mutable.

Answer2.
A "mutable" keyword is useful when we want to force a "logical const" data member to have its value modified. A logical const can happen when we declare a data member as non-const, but we have a const member function attempting to modify that data member. For example:
class Dummy {
public:
bool isValid() const;
private:
mutable int size_ = 0;
mutable bool validStatus_ = FALSE;
// logical const issue resolved
};
bool Dummy::isValid() const
// data members become bitwise const
{
if (size > 10) {
validStatus_ = TRUE; // fine to assign
size = 0; // fine to assign
}
}

Answer2.
"mutable" keyword in C++ is used to specify that the member may be updated or modified even if it is member of constant object. Example:
class Animal {
private:
string name;
string food;
mutable int age;
public:
void set_age(int a);
};
void main() {
const Animal Tiger(’Fulffy’,'antelope’,1);
Tiger.set_age(2);
// the age can be changed since its mutable
}

What is the difference between Mutex and Binary semaphore?

semaphore is used to synchronize processes. where as mutex is used to provide synchronization between threads running in the same process.

RTTI - What is RTTI?

Answer1.
RTTI stands for "Run Time Type Identification". In an inheritance hierarchy, we can find out the exact type of the objet of which it is member. It can be done by using:
1) dynamic id operator
2) typecast operator

Answer2.
RTTI is defined as follows: Run Time Type Information, a facility that allows an object to be queried at runtime to determine its type. One of the fundamental principles of object technology is polymorphism, which is the ability of an object to dynamically change at runtime.

STL Containers - What are the types of STL containers?

There are 3 types of STL containers:
1. Adaptive containers like queue, stack
2. Associative containers like set, map
3. Sequence containers like vector, deque

Virtual Destructor - What is the need for “Virtual Destructor?

Destructors are declared as virtual because if do not declare it as virtual the base class destructor will be called before the derived class destructor and that will lead to memory leak because derived class’s objects will not get freed.Destructors are declared virtual so as to bind objects to the methods at runtime so that appropriate destructor is called.

Differences of C and C++
Could you write a small program that will compile in C but not in C++?

In C, if you can a const variable e.g.
const int i = 2;
you can use this variable in other module as follows
extern const int i;
C compiler will not complain.

But for C++ compiler u must write
extern const int i = 2;
else error would be generated.

Bitwise Operations - Given inputs X, Y, Z and operations | and & (meaning bitwise OR and AND, respectively), what is output equal to in?
output = (X & Y) | (X & Z) | (Y & Z);



SAP-ABAP interview questions

SAP TERMINOLOGY

Master data is a collection of information about a person or an object, e.g. a cost object, vendor, or G/L account. For example, a vendor master record contains not only general information such as the vendor's name and address, but also specific information, such as payment terms and delivery instructions. Generally for end users, master data is reference data that you will look up and use, but not create or change.

Transactional data is data related to a single business event such as a purchase requisition or a request for payment. When you create a requisition, for example, SAP creates an electronic document for that particular transaction. SAP gives the transaction a document number and adds the document to the transaction data that is already in the system. Whenever you complete a transaction in SAP, that is, when you create, change, or print a document in SAP, this document number appears at the bottom of the screen.

Workflow A routing tool in SAP that forwards documents for review or approval. For example, a requisition that needs to be approved is sent to the appropriate approver's inbox.Workflow is also used to route journal vouchers, credit card charges, and other documents in SAP.

Cost Object: A Cost Object collects expenses and revenues for a particular purpose, such as a research project. In SAP there are three types of cost objects: Cost Center, Internal Order, and WBS (Work Breakdown Structure) Element (see below for definition).

Cost Center: General or operating Cost Objects are known in SAP as Cost Centers. Cost Centers are budgeted on the fiscal year.

Internal Order: A non-sponsored Cost Object (for example, funding from the MIT Provost) used to track costs over periods other than fiscal years. Internal Orders are often created to track gifts or endowments at MIT.

WBS Element: WBS Elements are funded by outside sponsors and are used to track costs of a particular research project over the entire span of its activity. They may also be created to track other sponsored activities, such as gifts.

G/L Account: G/L accounts are also called Cost Elements in SAP. They are a classification by expense or revenue type. In the CO (Controlling) module of SAP, the term Cost Element is used. In the FI
(Financial) module, the term G/L Account is used. These terms are used interchangeably for reporting, requisitions, and journal vouchers.
Database tables and open SQL Add a single record to a database table insert into values Inserting all lines from an internal table into a database table: insert from table Delete all records Select * from zmellemtab. delete zmellemtab. endselect. Deleting records using records from an internal table delete employees from table itab.

Q & A BASIS LAYER

What are the central interfaces of the R/3 system ?
- Presentation interface
Database interface
Operating system interface

Which interface controls what is shown on the p.c. ?
- Presentation interface

Which interface converts SQL requirements in the SAP development system to those of the database ?
- Database interface

What is SAP dispatcher ?
- SAP dispatcher is the control agent which manages the resources for the R/3 applications.

What are the functions of dispatcher ?
- Equal distribution of transaction load to the work processes
Management of buffer areas in main memory Integration of the presentation levels
Organization of communication activies

What is a work process ?
- A work process is where individual dialog steps are actually processed and the work is done. Each work process handles one type of request.

Name various work processes of R/3 system ?
1) Dialog or Online ( processes only one request at a time )
2) Background ( started at a specified time ) 3) Update ( primary or secondary ) 4) Enque( lock mechanism ) 5) Spool ( generated online or during back ground processing For printing )

What are the types of Update requests ?
- An update request can be divided into one primary (V1) and several Secondary update components (V2). Time-critical operations are placed in V1 component and those whose timing are less critical are placed in V2 components. If a V1 update fails, V2 components will not be processed.

What are the roll and page areas ?
- Roll and page areas are SAP R/3 buffers used to store user contexts ( process requests ) . The SAP dispatcher assigns process requests to work processes as they are received. If the work process is unavailable the process requests are queued in the roll and page areas. Paging area holds data from the application programs. Roll area holds data from previous dialog steps and data that characterizes user.

What is a Spool request ?
- Spool requests are generated during dialog or b