affiliate marketing Interview Qns: 2010

Sunday, November 14, 2010

Dot Net Qns

1.What is .NET Framework?
Ans:
.NET Framework is a common environment for building, deploying, and running Web applications and Web Services.

The .NET Framework has two main components: the common language runtime and the .NET Framework class library.

common language runtime(CLR)

CLR takes care of code management at program execution and provides various beneficial services such as memory management, thread management, security management, code verification, compilation, and other system services.

Class Library

Comprehensive object-oriented collection of reusable types that can be assembled to build a wide range of applications and services

2.What is Serialization

Ans: It is the process of saving the state of an object by converting it to a stream of bytes. The object can then be persisted to file, database, or even memory.

Purpose: The purpose of the serialization is to save the state of an object in order to have the ability to recreate the same object when required. It is an important to let the user save work and then be able to continue from that point at a later time. Used to creating a clone of an object
3. What is Assembly?

a. Assemblies are the building blocks of .NET Framework applications

b. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality.

i.What are the contents of assembly?
In general, a static assembly can consist of four elements:

· The assembly manifest, which contains assembly metadata.

· Type metadata.

· Microsoft intermediate language (MSIL) code that implements the types.

· A set of resources.

ii. What are the different types of assemblies?

Ans:Private, Public/Shared, Satellite

4. Which namespace is the base class for .net Class library?

Ans: system.object

5. What is Garbage Collection in .Net? Garbage collection process?

Garbage collection is the process of detecting when objects are no longer in use and automatically destroying those objects, thus freeing memory.

Garbage collection does not happen immediately, but instead the garbage collector will occasionally make a sweep of the heap to determine which objects should be allocated for destruction

6. What is Remoting?

The process of communication between different operating system processes, regardless of whether they are on the same computer. The .NET remoting system is an architecture designed to simplify communication between objects living in different application domains, whether on the same computer or not, and between different contexts, whether in the same application domain or not.

7.What is Webservices?

Web Services are applications delivered as a service on the Web. Web services allow for programmatic access of business logic over the Web

ASP.Net with VB.Net

1.Where does the Web page belong in the .NET Framework class hierarchy?
Ans: System.Web.UI.Page

2.What’s the difference between Response.Write() and Response.Output.Write()?

Ans: The latter one allows you to write formattedoutput

3.What data type does the RangeValidator control support?

Ans: Integer,String and Date.

4.Explain the differences between Server-side and Client-side code?

Ans: Server-side code runs on the server. Client-side code runs in the clients’ browser.

5.What type of code (server or client) is found in a Code-Behind class?

Ans: Server-side code.

6.Should validation (did the user enter a real date) occur server-side or client-side? Why?

Ans:Client-side. This reduces an additional request to the server to validate the users input.


7.What is the difference between Server.Transfer and Response.Redirect?

Ans:Server.Transfer is used to post a form to another page. Response.Redirect is used to redirect the user to another page or site.


8.Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?

Ans:

i. A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.

ii· A DataSet is designed to work without any continuing connection to the original data source.

iii· Data in a DataSet is bulk-loaded, rather than being loaded on demand.

iv· There's no concept of cursor types in a DataSet.

v· DataSets have no current record pointer You can use For Each loops to move through the data.

vi· You can store many edits in a DataSet, and write them to the original data source in a single operation.

vii· Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.

9.Describe the difference between inline and code behind.

Ans:Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page

10.Which method do you invoke on the DataAdapter control to load your generated dataset with data?

Ans:The .Fill() method

11.Name two properties common in every validation control?

Ans:ControlToValidate property and Text property

Question on ASP.Net with C#

  1. How big is the datatype int in .NET?

    Ans: 32 bits.

  2. How big is the char?

    Ans:16 bits (Unicode).

  1. Explain encapsulation.

    Ans:The implementation is hidden, the interface is exposed.

  1. Where are the value-type variables allocated in the computer RAM?

    Ans.Stack.

  2. How do you convert a string into an integer in .NET?

    Ans.Int32.Parse(string), Convert.ToInt32()

  3. Is goto statement supported in C#? How about Java?

    Ans:Gotos are supported in C# to the fullest. In Java goto is a reserved keyword that provides absolutely no functionality.

Name any 2 of the 4 .NET authentification methods

Ans:

i. Windows: Basic, digest, or Integrated Windows Authentication (NTLM or Kerberos).
ii.Microsoft Passport authentication
iii.Forms authentication
iv.Client Certificate authentication

  1. What is main difference between Global.asax and Web.Config?

Ans:

Global.asax

i.ASP.NET uses the global.asax to establish any global objects that your Web application uses

ii.The .asax extension denotes an application file rather than .aspx for a page file.

iii.Each ASP.NET application can contain at most one global.asax file

Web.Config

i.The web.config is an XML-formatted text file that resides in the Web site’s root directory.

ii.Through Web.config you can specify settings like custom 404 error pages, authentication and authorization settings for the Web site, compilation options for the ASP.NET Web pages, if tracing should be enabled, etc.

3. can specify application-wide settings in the web.config file


9.What are the access-specifiers available in c#?
Ans: Private, Protected, Public, Internal, Protected Internal.

10.What is Method overloading?
Ans:Method overloading occurs when a class contains two methods with the same name, but different signatures

Assembly

a. Assemblies are the building blocks of .NET Framework applications

b. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality.

i.What are the contents of assembly?

In general, a static assembly can consist of four elements:

· The assembly manifest, which contains assembly metadata.

· Type metadata.

· Microsoft intermediate language (MSIL) code that implements the types.

· A set of resources.

ii. What are the different types of assemblies?

Ans:Private, Public/Shared, Satellite

What is Serialization

It is the process of saving the state of an object by converting it to a stream of bytes. The object can then be persisted to file, database, or even memory.
Purpose:
The purpose of the serialization is to save the state of an object in order to have the ability to recreate the same object when required. It is an important to let the user save work and then be able to continue from that point at a later time. Used to creating a clone of an object

.What is .NET Framework?

.NET Framework is a common environment for building, deploying, and running Web applications and Web Services.

The .NET Framework has two main components: the common language runtime and the .NET Framework class library.

common language runtime(CLR)

CLR takes care of code management at program execution and provides various beneficial services such as memory management, thread management, security management, code verification, compilation, and other system services.

Class Library

Comprehensive object-oriented collection of reusable types that can be assembled to build a wide range of applications and services

Thursday, November 4, 2010

More Utility Programs

IEHMOVE
This program really duplicates the functions of IEBGENER and IEBCOPY. It creates copies of
sequential or partioned files. There are several advantages to use IEHMOVE over IEBGENER, which can be found, once you are familiar using both the utilities.

IEHPROGM
Its primary purpose is to catalog, uncatalog, scratch, rename datasets. It can also create index for a generation data group.

SORT/MERGE
This program can sort or merge the records of standard sequential files.

IEHLIST

This program has three functions: (1) To list the directory of a PDS(Partitioned Data Sets), (2) To list entries in a VTOC(Volume Table of Contents), (3) List catalog entries.

IEFBR14

It is basically a “DO NOTHING” program that allows you to process file dispositions through the JCL. Thus with this program, you can catalog, uncatalog, delete, scratch or create null files

IEBUPDTE

Its primary purpose is to update libraries, it is primarily used to make changes to source libraries. Nevertheless, many shops use a library maintenance system, such as SCLM, PANVALET, LIBRARIAN, ENDEVOR instead of the IBM utility. But if a shop does not use one of these, this utility comes into action.

this utility is used to perform the following functions:

•Create a new source library
•Add a new member to a source library
•Change an existing library member
•Catalog a JCL procedure


Although this utility can perform some other functions, these are the most commonly needed activities performed by this utility. The use of this utility is limited to the staff members who are responsible for the source library management. This utility was extensively used when most of the mainframes also used IBM source management package called SOURCE or some other in-house developed source management package, which will respond to this utility. After development of highly resourceful library management software packages, such as PANVALET, LIBRARIAN, ENDEVOR, SCLM, SRCEPARK, most of the information technology departments do not see any need to use this utility. Concerning cataloging a JCL procedure, IEBGENER is mostly used by production support staff with proper authority to update the production library for the installations, who use a PDS to store all their production procs, jcls, sysin members. It also has a drawback because of its inability to delete anything from the source library. This utility is rarely used in a data processing shop these days, since a large volume of shops stopped using IBM SOURCE Management package for a number of years. This current trend of non-IBM source management package has significantly reduced the use of this utility.

This utility uses four standard DD statements. SYSPRINT usually defines the system message files like any other job. SYSUT1 and SYSUT2 defines the library before processing and after processing, which normally remains the same, since when an add, replace operation occurs, the library remains the same, and the necessary control statements. Since we are using Source Control Library Management(SCLM) in this project, there is no possibility for this utility to be used. A handout may be distributed at a later date.


IEBPTPCH

This program is used to print or punch sequential or partitioned dataset. This program is not much in use these days when card input has been virtually eliminated from the industry


· Print a sequential file or a member of a PDS

· Punch a sequential file or a member of a PDS

· Format the printed or punched output

This utility prints a sequential file or a member or a PDS, which is again a sequential file itself. This can be easily done by IEBGENER at this time.

This utility was very much in use, approximately in the sixties or mid-seventies, when keypunch cards were used as input or output data. A flat file could be converted into a pack of 80-column card output to be taken elsewhere for any further processing. A flat file could also be created on the disk using 80-column card input. A stack of cards could be converted into a printed output which assisted the programmer to have a better desk check whether any card has been punched wrong. The use of this utility has been reduced drastically after the elimination of cards from the data-processing industry.

The following JCLs will give a reasonable idea about how this utility was used.

//GP4ABC JOB (RR, 1235,,,,8,,U),’MR. XYZ’,CLASS=S,

// MSGCLASS=G,MSGLEVEL=1,NOTIFY=GP4ABC

//***********************************************************

//* THIS PROGRAM PRINTS A FLAT FILE.

//***********************************************************

//STEP1 EXEC PGM=IEBPTPCH

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD DSN=TSCBAXC.ANNSALES.DATA,DISP=SHR

//SYSUT2 DD SYSOUT=*

//SYSIN DD *

PRINT

In this example,

SYSUT1 is the input data

SYSUT2 is the output data, which will go to print

PRINT is the control statement which communicates to the utility about what kind of processing needs to be done.

//***********************************************************

//* THIS PROGRAM CREATES A PUNCHED OUTPUT FROM A FLAT //* FILE.

//***********************************************************

//STEP2 EXEC PGM=IEBPTPCH

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD DSN=TSCBAXC.ANNSALES.DATA,DISP=SHR

//SYSUT2 DD SYSOUT=*

//SYSIN DD *

PUNCH TYPORG=PS

In this example,

SYSUT1 is the input data

SYSUT2 is the output data, which will go to print

PUNCH is the control statement which communicates to the utility that a batch of punched card needs to be created from the flat file.

TYPORG=PS this control statement states that the input file is a physical sequential file.

//***********************************************************

//* THIS PROGRAM PUNCHES TWO MEMBERS OF A PDS.

//***********************************************************

//STEP1 EXEC PGM=IEBPTPCH

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD DSN=TSCBAXC.ANNSALES.DATA,DISP=SHR

//SYSUT2 DD SYSOUT=*

//SYSIN DD *

PUNCH TYPORG=PO,MAXNAME=2 ç Type of processing

MEMBER NAME=HDRREC ç Member 1 to be printed

MEMBER NAME=TLRREC ç Member 2 to be printed


IEBISAM

This program is used to copy, print or unload ISAM files. For any application involving ISAM files, this is an extremely important tool.

IEBDG

This program is used to generate test-data to simplify program testing. It can also be used to create an ISAM file from a sequential file that an IEBISAM, another utility cannot.

The following is the sample of a JCL statement to execute this utility program.

//GP4ABC JOB (RR, 1235,,,,8,,U),’MR. XYZ’,CLASS=S,

// MSGCLASS=G,MSGLEVEL=1,NOTIFY=GP4ABC

//*

//***********************************************************

//* THIS PROGRAM CREATES TEST DATA AS SPECIFIED IN THE //* CONTROL STATEMENT

//***********************************************************

//STEP1 EXEC PGM=IEBDG

//SYSPRINT DD SYSOUT=*

//TSTFILE1 DD DSN=TSGBAXC.SACRED.DATA,

// DISP=(NEW,CATLG),

// UNIT=SYSDA,

// SPACE=(CYL,(20,2),RLSE),

// DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160)

//SYSIN DD DUMMY

DSD OUTPUT = (TSTFILE1)

FD NAME=PARTNBR,LENGTH=30,FORMAT=ZD,INDEX=1

FD NAME=REST,LENGTH=50,FORMAT=AN

CREATE QUANTITY=100,NAME=(PARTNBR,REST)

END

TSTFILE - Specifies the test file to be created and the name is specified in

DSN with all the parameters necessary for a new file, such as

DISP, UNIT, SPACE and DCB

In the control statements:

DSD Data Set Description


FD Field Description, where the first field PARTNBR is 30 Bytes long

FD Field Description, where the second field REST is 50 Bytes long

INDEX A number which needs to be included at the end of every field

CREATE QUANTITY = 100 specifies the number of records to be generated by the program and also the associated field names, such as PARTNBR and REST.

This utility has a drawback of not providing a wide variety of field contents, where the same field in two records will have entirely non-related data.

IT IS REALLY OBSOLETE THESE DAYS, SINCE ALL INSTALLATIONS DEPEND ON SOME OTHER WAYS OF CREATING TEST DATA.


IEBCOPY

Its primary purpose is to make copies of partitioned datasets. It is often used to create backup copies of important libraries, merge several libraries together or even compress a library file that contains unused space

The following is the sample of a JCL statement to execute this utility program.

//GP4ABC JOB (RR, 1235,,,,8,,U),’MR. XYZ’,CLASS=S,

// MSGCLASS=G,MSGLEVEL=1,NOTIFY=GP4ABC

//*

//***********************************************************

//* THIS PROGRAM COPIES ONE FILE TO A BACKUP

//***********************************************************

//STEP1 EXEC PGM=IEBCOPY

//SYSPRINT DD SYSOUT=*

//COPYLIB DD DSN=TSGBAXC.SACRED.DATA,DISP=SHR

//BKUPLIB DD DSN=TSGBAXC.BKUP.SACRED.DATA,

// DISP=(,CATLG,DELETE),

// UNIT=DISK,

// SPACE=(CYL,(20,2),RLSE),

// DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=6160)

//SYSUT3 DD UNIT=SYSDA,

// SPACE=(TRK,(1,1))

//SYSUT4 DD UNIT=SYSDA,

// SPACE=(TRK,(1,1))

//SYSIN DD *

COPY OUTDD=BKUPLIB,INDD=COPYLIB




COPYLIB - Is the data that needs to be copied to a backup

BKUPLIB - Is the backup library where COPYLIB was copied or

backed up

SYSUT3 - IBM advised mandatory DDNAME for this process

SYSUT4 - IBM advised mandatory DDNAME for this process


OUTDD - Shows the receiving library in this process, the right

operand must match the DDNAME in the body of the

JCL.

INDD - Shows the sending library in this process, the right

operand must match the DDNAME in the body of the

JCL.






The following JCL is an example for data compression.




//GP4ABC JOB (RR, 1235,,,,8,,U),’MR. XYZ’,CLASS=S,

// MSGCLASS=G,MSGLEVEL=1,NOTIFY=GP4ABC

//*

//***********************************************************

//* THIS PROGRAM COMPRESSES THE LIBRARY WHERE UNUSED //* SPACES ARE AVAILABLE.

//***********************************************************

//STEP1 EXEC PGM=IEBCOPY

//SYSPRINT DD SYSOUT=*

//COPYLIB DD DSN=TSGBAXC.SACRED.DATA,DISP=SHR

//SYSUT3 DD UNIT=SYSDA,

// SPACE=(TRK,(1,1))

//SYSUT4 DD UNIT=SYSDA,

// SPACE=(TRK,(1,1))

//SYSIN DD *

COPY OUTDD=COPYLIB,INDD=COPYLIB

In this example,

COPYLIB - Is the data that needs to be compressed

SYSUT3 - IBM advised mandatory DDNAME for this process

SYSUT4 - IBM advised mandatory DDNAME for this process

OUTDD - Shows the library name after compression

INDD - Shows the library name before compression, which is

same as OUTDD



It can be observed that in both the cases, the same DDNAME has been used, which IEBCOMPR will understand as a case of compression.

This utility can also be used for selective copying or backup where the whole PDS need not be copied or backed up. The control statement will prompt the utility which are the members need to be copied.



The following JCL is an example for selective copying.

//GP4ABC JOB (RR, 1235,,,,8,,U),’MR. XYZ’,CLASS=S,

// MSGCLASS=G,MSGLEVEL=1,NOTIFY=GP4ABC

//*

//***********************************************************

//* THIS PROGRAM WILL COPY ONLY DESIRED MEMBERS.

//***********************************************************

//STEP1 EXEC PGM=IEBCOPY

//SYSPRINT DD SYSOUT=*

//COPYLIB DD DSN=TSGBAXC.SACRED.DATA,DISP=SHR

//ARXLIB DD DSN=TSGBAXC.SELECT.SACRED.DATA,

// DISP=(,CATLG,DELETE),

// UNIT=DISK,

// SPACE=(CYL,(20,2),RLSE),

// DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=6160)

//SYSUT3 DD UNIT=SYSDA,

// SPACE=(TRK,(1,1))

//SYSUT4 DD UNIT=SYSDA,

// SPACE=(TRK,(1,1))

//SYSIN DD *

COPY OUTDD=ARXLIB,INDD=COPYLIB

SELECT MEMBER= BDREC,CRMREC,ARXREC,OIREC

In this example,


COPYLIB - Is the source library

ARXLIB - Is the target library

SYSUT3 - IBM advised mandatory DDNAME for this process

SYSUT4 - IBM advised mandatory DDNAME for this process

OUTDD - Shows the receiving library DDNAME

INDD - Shows the sending library DDNAME

SELECT - Shows the desired members need to be copied or backed

up