VSAM Interview Questions

VSAM Interview Questions

Virtual Storage Access Method (VSAM) FAQ’s

Q1)     What are the types of VSAM datasets?

A1)     Entry sequenced datasets (ESDS),  key sequenced datasets (KSDS) and relative record dataset (RRDS).

Q2)     How are records stored in an ESDS, entry sequenced dataset?

A5)     They are stored without respect to the contents of the records and in the order in which they are included in the file.

Q3)     What is a CI, control interval?

A3)     A control interval is the unit of information that  VSAM transfers between virtual and auxiliary storage.

Q4)     What are the distinctive features of a ksds, key sequenced dataset?

A4)     The index and the distributed free space.

Q5)     What is a CA, control area?

A5)     A group of control intervals makes up a control area.

Q6)     What is a sequence set?

A6)     This is the part of the index that points to the CA and CI of the record being accessed.

Q7)     What is the index set?

A7)     This is the other part of the index.  It has multiple levels with pointers that ultimately reach to the sequence set.

Q8)     What is a cluster?

A8)      A cluster is the combination of the index, sequence set and data portions of the dataset.  The operating system gives program access to the cluster, ie. to all parts of the dataset simultaneously.

Q9)     What is the catalog?

Q9)     The catalog contains the names of all datasets, VSAM and non-VSAM. It is used to access these datasets.

Q10)   What is an alternate index?

Q10)   An AIX is a file that allows access to a VSAM dataset by a key other than the primary one.

Q11)   What is a path?

Q11)   A path is a file that allows you to access a file by alternate index – the path provides an association between the AIX and the base cluster.

Q12)   What is the upgrade set?

Q12)   The upgrade set is the list of all AIXes that VSAM must maintain for a specific base cluster, so that when data in the base cluster is updated, the AIX files are also updated.

Q13)   What is free space?

Q13)   Free space is reserved within the data component of a KSDS to accommodate inserting new records.

Q14)   What is a VSAM split?

Q14)   If there isn’t enough space in the control interval VSAM performs a control interval split by moving some records to the free control intervals.  If there isn’t a free control interval VSAM performs a control area split by allocating a new control area and moving half of the control intervals to it.

Q15)   What is the base cluster?

Q15)   The base cluster consists of the data component and the index component for the primary index of a KSDS.

Q16)   Do primary key values have to be unique?  Do alternate key values have to be unique?

Q16)   Primary key values must be unique; alternate key values need not be.

Q17)   In the COBOL SELECT statement what is the ORGANIZATION for a KSDS?

Q17)   The ORGANIZATION is INDEXED.

Q18)    In the COBOL SELECT statement for a KSDS what are the three possibilities for ACCESS?

Q18)   ACCESS can be SEQUENTIAL, RANDOM or DYNAMIC.

Q19)   What is the COBOL RECORD KEY clause?

Q19)   The RECORD KEY in the SELECT clause identifies the files primary key as it will be known to the program.

Q20)   What is the purpose of the FILE STATUS clause in the SELECT statement?

Q20)   The FILE STATUS field identifies the field that VSAM uses to provide information about each I/O operation for the file.

Q21)   If you wish to use the REWRITE command haw must the VSAM file be opened?

Q21)   It must be opened as I/O.

Q22)   Explain the meaning and syntax for the START command.

Q22)   The START command is used read other than the next VSAM record.  A value must be moved into the RECORD KEY.  The KEY clause is optional, but it can be used to specify a relational (equal, less than, etc.) operator.

Q23)   What is the meaning of dynamic processing?

Q23)   It’s rarely used.  It means one program uses both sequential and random processing for a VSAM KSDS file.

Q24)   Name some common VSAM error conditions and codes.

Q24)   They are end of file (10), duplicate key (22), record not found (23), VSAM logic error (90), open problem (92) and space problem (93).

Q25)   What is the VSAM-code field?

Q25)   It is a COBOL II enhancement to VSAM batch processing expanding the FILE STATUS field.  It is defined in WORKING-STORAGE as a six byte group item with three two byte elements, the normal return code, the function code and the feedback code.

Q26)   What is a VSAM slot?

Q26)   A relative record dataset (RRDS) consists of a specified number of areas called slots. Each slot is identified by a relative record number (RRN) which indicates its relative position in the file.

Q27)   What is the utility program closely associated with VSAM?

Q27)   IDCAMS, the access method services utility.

Q28)   There are at least seven IDCAMS commands; name and explain each of them ?.

Q28)    ALTER modifies information for a catalog, alternate index, cluster or path.  BLDINDEX builds the alternate index, of course.  DEFINE is used for ALTERNATEINDEX, CLUSTER or PATH. DELETE removes the catalog entry for a catalog, cluster, alternate index or path. LISTCAT lists information about the dataset.  PRINT prints the dataset contents.  REPRO copies records from one file to another.

Q29)   What are the three levels of definition for the VSAM DEFINE?

Q29)   They are DEFINE CLUSTER, DATA and INDEX.

Q30)   What is the significance of the SHAREOPTIONS parameter?

Q30)   It specifies how the file may be shared between jobs and between batch and CICS environments.

Q31)   What is the meaning of the DEFINE MODEL parameter?

Q31)   It specifies whether Daniela Pestova or Yamila – oops! Wrong models!  The MODEL parameter allows you to model your cluster by modeling it after an existing cluster.

Q32)   What is File Status in VSAM?

Q32)   The FILE STATUS clause of the FILE-CONTROL paragraph  allows  for  each  file  to  be  associated with a file status key (i.e.,  the 2-character  data item specified in the FILE STATUS  clause).  If  the  FILE  STATUS clause is specified for a given file,  a value indicating the status of each I/O operation against that file is placed in the  associated  file  status key.  This value is stored in the file status key as soon as the I/O operation is completed (and before execution of any EXCEPTION/ERROR declarative  or  INVALIDKEY/AT  END phrase associated  with the I/O request).

Note: This element may behave differently when the CMPR2 compiler option is used. The file status  key  is divided

into  two  status  keys:  the  first character  is known as file status key 1; the second character is file status key 2.

Q33)   What’s a LDS (Linear Data Set) and what’s it used for?

Q33)   LDS is a VSAM dataset in name only. It has unstructured 4k (4096 bytes) fixed size CI’s which do not contain control fields and therefore from VSAM’s standpoint they do not contain any logical records. There is no free space, and no access from Cobol. Can be accessed by DB2 and IMS fast path datasets. LDS is essentially a table of data maintained on disk. The ‘table entries’ must be created via a user program and can only be      logically accessed via a user program. When passed, the entire LDS must be mapped into storage, and then data is accessed via base and displacement type processing.

Q34)   What is IDCAMS ?

Q34)   IDCAMS is the Access Method Services program. You run the IDCAMS program and supply AMS commands thru SYSIN. (examples of AMS commands are DELETE, DEFINE, REPRO etc..).

Q35)   Can AMS commands be run from the TSO prompt ?

Q35)   Yes

Q36)   Syntax of  AMS modal commands ?

Q36)   Note: these can be used only under IDCAMS and not from the TSO prompt.

IF LASTCC(or MAXCC)  >(or <,= etc..) value –

THEN –

DO –

command set (such as DELETE, DEFINE etc..)

ELSE –

DO –

command set

LASTCC  – Condition code from the last function (such as delete) executed

MAXCC – Max condition code that was returned by any of the prev functions

SET is also a valid AMS command. SET LASTCC (or MAXCC) = value

The maximum condition code is 16. A cond code of 4 indicates a warning. A cond code of 8 is usually encountered on a DELETE of a dataset that is not present.

Q37)   Under IDCAMS , multiple functions can be executed, each of which returns a cond code. What will be the condition code returned to the operating system ?

Q37)   The maximum condition code generated is returned as the condition code of the IDCAMS step.

Q38)   What is Control Interval, Control Area?

Q38)   Control Interval is analogous to a physical block for QSAM files. It is the unit of I/O.  Must be between 512 bytes to 32 k. Usually either 2K or 4K. A larger control interval increases performance for sequential processing while the reverse is true for random access. Under CICS when a record is locked, the entire CI gets locked.

Control Area is a group of control intervals. CA is used during allocation. CA size is calculated based on the

allocation type (cyl, tracks or records) and can be max of 1 cylinder

Q39)   What is FREESPACE ?

Q39)   Coded in the DEFINE as FREESPACE(ci ca) where ci is the percentage of each control interval to be left free for insertions, ca is the percentage of control intervals in each control area to be left empty.

Q40)   How do you decide on optimum values for CI, FREESPACE etc…?

Q40)   CI size should be based on record length, type of processing. Usually CI is 4K. If record length is larger(>1K), chose 6K or 8K. FREESPACE should be large if more number of insertions are envisaged. Usual values are (20 20) when heavy updates are expected. CI size can be calculated.

Q41)   Would you specify FREESPACE for an ESDS?

Q41)   No. Because you cannot insert records in an ESDS, also when you rewrite a record, it must be of the same length. Thus putting any value for freespace does not make any sense.

Q42)   What is SHAREOPTS ?

Q42)   SHAREOPTS is a parameter in the DEFINE and specifies how an object can be shared among users. It is coded as SHAREOPTS(a b), where a is the cross region share option ie how two or more jobs on a single system can share the file, while b is the cross system share option ie how two or more jobs on different MVS’s can share the file. Usual value is (2 3).

Q43)   What is the meaning of each of the values in SHAREOPTS(2 3)?

Q43)    Value of 2 for cross region means that the file can be processed simultaneously by multiple users provided only one of them is an updater. Value of 3 for cross system means that any number of jobs can process the file for input or output (VSAM does nothing to ensure integrity).

Q44)   How do you define a KSDS ?

Q44)   DEFINE CLUSTER(cluster name) with the INDEXED parameter. Also specify the ds name for the DATA component & the ds INDEX component. Other important parms are RECORDSIZE, KEYS, SHAREOPTIONS.

Q45)   How do you define an ALTINDX ? How do you use ALTINDXs in batch, CICS pgm’s ?

Q45)   DEFINE ALTERNATEINDEX. Important paramters are RELATE where you specify the base cluster name, KEYS, RECORDSIZE,SHAREOPTIONS,UNIQUEKEY(or NONUNIQUEKEY), DATA(ds name for the data component), INDEX(ds name for the index component). Then DEFINE PATH. Important paramters are NAME (ds name for the path), PATHENTRY (ds name of the alternate index name), UPDATE(or NOUPDATE) which specifies whether an alt index is updated when a update to the base cluster takes place. Then BLDINDEX. Parameters are INDATASET(ds name of base cluster), OUTDATASET(ds name of AIX).

Q46)   Using Alternate Indexes in Batch pgms:

Q46)   In the JCL, you must have DD stmts for the cluster and for the path(s). In the COBOL Program, SELECT .. ASSIGN TO ddname for base cluster RECORD KEY IS… ALTERNATE RECORD KEY IS..

Q47)   Using Alternate Indexes in CICS pgms:

Q47)   FCT entries must be created for both base cluster & the path. To read using the alternate index, use the dd name of the path in CICS file control commands.

Q48)   What happens when you open an empty VSAM file in a COBOL program for input?

Q48)   A VSAM file that has never contained a record is treated as unavailable. Attempting to open for input will fail. An empty file can be opened for output only. When you open for output, COBOL will write a dummy record to the file & then delete it out.

Q49)   How do you initialize a VSAM file before any operation? a VSAM with alternate index?

Q49)   Can write a dummy program that just opens the file for output and then closes it.

Q50)   What does a file status of 02 on a VSAM indicate?

Q50)   Duplicate alternate key . Happens on both input and output operation

Q51)   How do you calculate record size of an alternate cluster?  Give your values for both unique and nonunique.

Q51)   Unique Case:  5 + ( alt-key-length + primary-key )

Non unique Case: 5 + ( alt-key-length + n * primary-key ) where n = number of duplicate records for the alternate key

Q52)   What is the difference between sequential files and ESDS files?

Q52)   Sequential (QSAM) files can be created on tape while ESDS files cannot.  Also, you can have ALTINDEX for an ESDS while no such facility exists for QSAM files.

Q53)   How do you load a VSAM data set with records ?

Q53)   Using the REPRO command.

Q54)   How do you define a GDG ?

Q54)   Use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, another dataset must be defined whose DCB parameters are used when new generations of the GDG are created. This dataset is known as the model dataset. The ds name of this model dataset must be the same as that of the GDG, so use a disp of keep rather than catlg and also specify space=(trk,0)

Q55)   Do all versions of the GDG have to be of the same record length ?

Q55)    No,  the DCB of the model dataset can be overridden when you allocate new versions.

Q56)   How are different versions of GDG named ?

Q56)   base-file-name.GnnnnnV00 where nnnn= generation number (upto 255).  nnnn will be 0000 for the 1st generation.

Q57)   Suppose 3 generations of a GDG exist. How would you reference the 1st generation in the JCL? – GS

Q57)   Use GDG name(-2).

Q58)   Suppose a generation of GDG gets created in a particular step of a proc. How would you refer the current  generation in a subsequent step? What would be the disposition of  this generation now? – GS

Q58)   Relative generation numbers are updated only at the end of the job, not at the end of a step. To allocate a new generation, we would be using (+1) with a DISP of  (NEW,CATLG,DELETE). To refer to this in a subsequent step in the same job, we would again use (+1) but with a DISP of SHR or OLD.

Q59)   What more info you should give in the DD statement while defining the next generation of a GDG? – GS

Q59)   Give (+1) as the generation number, give (new,catlg) for disp, give space parameter, can give the DCB  parameter if you want to override the dcb of the model dataset.

Q60)   Assuming that the DEFINE JCL is not available, how do you get info about a VSAM file’s organisation?

Q60)   Use the LISTCAT command.

Q61)   During processing of a VSAM file, some system error occurs and it is subsequently unusable . What do you do ?

Q61)   Run VERIFY.

Q62)   How do you fix the problem associated with VSAM out of space condition?

Q62)   Define new VSAM dataset allocated with more space.

Use IDCAMS to REPRO the old VSAM file to new VSAM dataset.

Use IDCAMS to ALTER / rename the old VSAM dataset or se IDCAMS to DELETE the old VSAM dataset.

Use IDCAMS to ALTER / rename the new VSAM dataset to the name of the original VSAM dataset.

Q63)   What is the meaning of VSAM RETURN-CODE 28?

Q63)   Out of space condition is raised.

Q64)   On which datasets You can have ALT INDEX?.

Q64)   only on KSDS and ESDS – not RRDS

Q65)   How many Alternate Indexes you can have on a dataset?

Q65)   255 – but you must be a nut to have so many ALT Indexes on a dataset!

Q66)   Is it slower if you access a record through ALT INDEX as compared to Primary INDEX?

Q66)   Yes. Why? Because the alternate key would first locate the primary key, which in turn locates the actual record. Needs twice the number of I/Os.

Q67)   What is RECOVERY and SPEED parameters in DEFINE CLUSTER command?

Q67)    RECOVERY (default) and SPEED are mutually exclusive. Recovery preformats the control areas during the initial dataset load, if the job fails, you can restart but you must have a recovery routine already written to restart the job. SPEED does not preformat the CAs. It is recommended that you specify SPEED to speed up your initial data load.

Q68)   Describe SHAREOPTIONS parameter (SHR) in Define Cluster command.

Q68)   It defines the cross-region and cross-system sharing capabilities of the dataset. Syntax is SHR(Crvalue, CSvalue) value 1 means multiple read OR single write (read integrity) 2 means multiple read AND single write  (Write integrity) 3 means Multiple read AND multiple write 4 is same as 3, which refreshes the buffer with every random access. default is SHR(1 3).

Q69)   What does the KEYRANGES parameter in Define Cluster commend do?

A69)   It divides a large dataset into several volumes according to the Key ranges specified. e.g., KEYRANGES ((0000001 2999999) (3000000 5999999)). if the activity on the key ranges are evenly distributed, concurrent access is possible, which is a performance improvement.

Q70)   What are the optional parameters to the input dataset While loading the empty cluster with the data records?

A70)   1)FROMADDRESS(address) 2)TOADDRESS(address) where ‘address’ specifies the RBA value of the key of the input record. 3)FROMNUMBER(rrn) 4)TONUMBER(rrn) where ‘rrn’ specifies the relative record number of the RRDS record 5)FROMKEY(key) 6)TOKEY(key) where ‘key’ specifies the key of the input record 7)SKIP(number) 8)COUNT(number) where ‘number’ specifies the number of records to skip or copy Ex: REPRO INFILE(DD1) OUTFILE(DD2) SKIP(9000) COUNT(700) – Skips the first 9000 records and begins copying at 9001 and copies 700 records from DD1 to DD2.

Q71)    What is IDCAMS? and what is the purpose of it?.

A71)   IDCAMS is an access method services utility used for creating, deleting, altering VSAM files and copying sequential file to a VSAM file, etc.

Q72)    How to delete a member using JCL.

A72)   Using IDCAMS a member can be deleted. DELETE ‘XXX.YYY(member)

Q73)    What is the Difference between LDS & ESDS ?

A73)   These two datasets are VSAM datasets. ESDS maintains control information. But LDS does not maintains the control information.

Q74)    Is a delete operation possible in an ESDS?B. Is rewrite operation possible in ESDS ?

A74)   No delete operation is not possible in VSAM ESDS.B. Yes rewrite operation is possible in an ESDS.

Q75)    What is an alternate index and path ?

A75)   An alternate index is an another way of accessing key sequenced data record stored in a base cluster and path is the linkage which connect alternate index to its base cluster.

Q76)    How many buffers are allotted to VSAM KSDS and ESDS?

A76)   2 data buffers by default for ESDS. For KSDS it allots 2 data buffers and 1 index buffers. each buffer is about 4k.

Q77)    what’s the biggest disadvantage of using a VSAM dataset?

A77)   FREE SPACE(FPSC)

Q78)    what’s the device independent method to indicate where a Record is Stored?

A78)   By USING RBA(Relative Byte Address).

Q79)   How many times secondary space allocated?

A79)   122 TIMES

Q80)   what is the RRN for the first record in RRDS?

A80)   The answer is : 1

Q81)   what is a Base Cluster?

A81)   The Index and data components of a KSDS

Q82)    If FSPC(100 100) is specified does it mean that both the control interval and control area will be left empty because 100 % of both CI and ca are specified to be empty?

A82)   No, they would not be left empty. one record will be written in each CI and 1 CI will be written for each ca.

testing important interview questions

1.     Define software?
Software is a set of instructions used to acquire inputs and to manipulate them to produce the desired output in terms of functions and performance as determined by the user of the software.
2.     Define testing?
Testing is a process of executing a program with the intent of finding of an error.
3.     What are the types of software?

There are two types of software. There are
System Software
Application Software

4.     What is the difference between system and application software?

Computer software is often divided into two categories :
System software : This software includes the operating system and all utilities that enable the computer to function.
Application software : These consist of programs that do real work for users.

5.     Define process?
A process is a series of steps involving activities, constraints, and resources that produce an intended output of some kind.

6.     What is a Software Process?
A software process is the related set of activities and processes that are involved in developing and evolving a software system.
7.     What is the difference between verification and validation?

Verification is the process of determining whether the output of one phase of software development confirms to that of its previous phase.
Validation is the process of determining whether a fully developed system confirms to its requirement specifications.

8.     What are the types of maintenance?

There are four types of maintenance. There are
Corrective Maintenance
Adaptive Maintenance
Perfective Maintenance
Preventive Maintenance

9.     What is SQA?
Software Quality Assurance is a set of activities designed to evaluate the process by which software is developed and/or maintained.
10.     What is the difference between software engineering and system engineering?

System Engineering is concerned with all aspects of computer based systems development including hardware, software and process engineering.
System Engineering are involves in system specification architectural design intergration and deployment.

11.     What are the categories of defects?

There are three main categories of defects:
Wrong
Missing
Extra

12.     What are the types of Errors?

Errors can be classified into two categories :
Syntax Error
Logic Error

13.     What is the difference between syntax and logical errors?

Syntax Error : A syntax error is a program statement that violates one or more rules of the language in which it is written.
Logic Error : A logic error deals with incorrect data fields, out–of–range terms, and invalid combinations.

14.     What is fault?
A fault is a condition that causes a system to fail in performing its required function.
15.     What is failure?
Failure is the inability of the software to perform a required function to its specification.

16.     What is a bug?
A software bug may be defined as a coding error that causes an unexpected defect, fault, flaw, or imperfection in a computer program. In other words, if a program does not perform as intended, it is most likely a bug.
17.     What is test log?
A test log is used by the test team to record what occurred during test execution.
18.     What is the difference between static and dynamic testing?

Static testing : is performed using the software documentation. The code is not executing during static testing.
Dynamic testing : requires the code to be in an executable state to perform the tests.

19.     What is debugging?
Debugging is a process that developers go through to identify the cause of bugs or defects in code and undertake corrections.
20.     What is a maturity level?
A maturity level specifies the level of performance expected from an organization.

21.     Define Metrics?
The continuous application of measurement based techniques to the software development process and its products to supply meaningful and timely management information, together with the use of those techniques to improve that process and its products.
22.     What is the difference between system and real time software?

System Software : System software is a collection of programs used to run the system as an assistance to other software programs. The compliers, editors, utilities, operating system components, drivers, and interfaces are examples of system software. This software resides in the computer system and consumes its resources. A computer system without system software cannot function.
Real time Software : Real time software deals with a changing environment. First, it collects the input and converts it from analog to a digital, control component that responds to the external environment and performs the action.

23.     What is verification?
Verification ensures the product is designed to deliver all functionality to the customer; it 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.
24.     What is meant by validation?
Validation ensures that functionality, as defined in requirements, is the intended behavior of the product; validation typically involves actual testing and takes place after verifications are completed.
25.     What is error tracking?
Error tracking is an activity that provides a means for assessing the status of a current project.

26.     What is white box testing?
White box testing is a test case design method that uses the control structure of the procedural design to derive test cases. It is otherwise called as structural testing.
27.     What is Black box testing?
Black box testing is a test case design method that focuses on the functional requirements of the software. It is otherwise called as functional testing.
28.     What is the difference between coupling and cohension?

Cohension is a measure of the relative functional strength of a module.
Coupling is a measure of the relative interdependence among modules.

29.     What is Software reliability?
Software reliability is defined as the probability of failure free operation of a computer program in a specified environment for a specified time.
30.     What are the categories of metrics?

There are three types of metrics are :
Product Metrics
Process Metrics
Project Metrics

31.     What is meant by unit testing?
Unit testing is the process of testing a particular complied program, i.e., a window, a report, an interface, etc. independently as a stand alone component/program. The types and degrees of unit tests can vary among modified and newly created programs. Unit testing is mostly performed by the programmers who are also responsible for the creation of the necessary unit test data.
32.     What are the categories of debugging?

The various categories for debugging are :
Brute force debugging
Backtracking
Cause elimination
Program slicing
Fault tree analysis

33.     What is incremental testing?
Incremental testing is partial testing of an incomplete product. The goal of incremental testing is to provide an early feedback to software developers.
34.     What is regression testing?
Regression testing is not a level of testing, but it is the retesting of software that occurs when changes are made to ensure that the new version of the software has retained the capabilities of the old version and that no new defects have been introduced due to the changes.
35.     What is the difference between black box and white box testing?

Black box testing is a testing strategy based solely on requirements and specifications. Black box testing requires no knowledge of internal paths, structures, or implementation of the software being tested.
White box testing is a testing strategy based on internal paths, code structures, and implementation of the software being tested. White box testing generally requires detailed programming skills.

36.     What are the characteristic of process?

Any process has the following characteristics:
The process prescribes all of the major process activities.
The process uses resources, subject to a set of constraints (such as a schedule), and produces intermediate and final products.
The process may be composed of sub processes that are linked in some way. The process may be defined as a hierarchy of processes, organized so that each sub process has its own process model.
Each process activity has entry and exit criteria, so that we know when the activity begins and ends.
The activities are organized in a sequence, so that it is clear when one activity is performed relative to the other activities.
Every process has a set of guiding principles that explain the goals of each activity.

37.     What are the advantages of waterfall model?

The various advantages of the waterfall model include:
It is a linear model.
It is a segmental model.
It is systematic and sequential.
It is a simple one.
It has proper documentation.

38.     What is RAD?
The RAD (Rapid Application Development Model) model is proposed when requirements and solutions can be modularized as independent system or software components, each of which can be developed by different teams. After these smaller system components are developed, they are integrated to produce the large software system solution.
39.     What is system integration testing?
Testing of software components that have been distributed across multiple platforms (e.g., client, web server, application server, and database server) to produce failures caused by system integration defects (i.e. defects involving distribution and back office integration).
40.     What are the types of attributes?

Simple Attribute
Composite Attribute
Single Valued Attribute
Multivalued Attribute
Derived Attribute

41.     What is acceptance testing?
Testing the system with the intent of confirming readiness of the product and customer acceptance. Also known as User Acceptance Testing.
42.     What are the types of system testing?

There are essentially three main kinds of system testing :
Alpha testing
Beta testing
Acceptance testing

43.     What is the difference between alpha, beta and acceptance testing?

Alpha Testing : Alpha testing refers to the system testing carried out by the test team within the development organization.
Beta Testing : Beta testing is the system testing performed by a selected group of friendly customers.
Acceptance Testing : Acceptance testing is the system testing performed by the customer to determine whether to accept or reject the delivery of the system.

44.     What are the advantages of black box testing?

The advantages of this type of testing include :
The test is unbiased because the designer and the tester are independent of each other.
The tester does not need knowledge of any specific programming languages.
The test is done from the point-of-view of the user, not the designer.
Test cases can be designed as soon as the specifications are complete.

45.     What are the advantages of white box testing?

The various advantages of white box testing include :
Forces test developer to reason carefully about implementation
Approximates the partitioning done by execution equivalence
Reveals errors in hidden code

46.     What is a test case?
A test case is a set of instructions designed to discover a particular type of error or defect in the software system by inducing a failure.
47.     What is a software review?
A software review can be defined as a filter for the software engineering process. The purpose of any review is to discover errors in the analysis, design, and coding, testing and implementation phases of the softwaredevelopment cycle. The other purpose of a review is to see whether procedures are applied uniformly and in a manageable manner.
48.     What are the types of reviews?

Reviews are one of two types : informal technical reviews and formal technical reviews.
Informal Technical Review : An informal meeting and informal desk checking.
Formal Technical Review : A formal software quality assurance activity through various approaches, such as structured walkthroughs, inspections, etc.

49.     What is data flow diagrams(DFD)?
Data Flow Diagrams (DFD) are also known as data flow graphs or bubble charts. A DFD serves the purpose of clarifying system requirements and identifying major transformations. DFDs show the flow of data through a system. It is an important modeling tool that allows us to picture a system as a network of functional processes.
50.     What is reverse engineering?
Reverse engineering is the process followed in order to find difficult, unknown, and hidden information about a software system. It is becoming important, since several software

Testing base on interview questions

1)      What is the difference between the QA and software testing?

The role of QA (Quality Assurance) is to monitor the quality of the process to produce a quality of a product. While the software testing, is the process of ensuring the final product and check the functionality of final product and to see whether the final product meets the user’s requirement.

2)      What is Testware?

Testware is the subset of software, which helps in performing the testing of application.  It is a term given to the combination of software application and utilities which is required for testing a software package.

3)      What is the difference between build and release?

Build: It is a number given to Installable software that is given to testing team by the development team.

Release: It is a number given to Installable software that is handed over to customer by the tester or developer.

4)      What are the automation challenges that QA team faces while testing?

Exploitation of automation tool
Frequency of use of test case
Reusability of Automation script
Adaptability of test case for automation

5)      What is bug leakage and bug release?

Bug release is when software or an application is handed over to the testing team knowing that the defect is present in a release.  During this the priority and severity of bug is low, as bug can be removed before the final handover.

Bug leakage is something, when the bug is discovered by the end users or customer, and missed by the testing team to detect, while testing the software.

QA Interview Questions

6)      What is data driven testing?

Data driven testing is an automation testing part, which tests the output or input values. These values are read directly from the data files. The data files may include csv files, excel files, data pools and many more. It is performed when the values are changing by the time.

7)      Explain the steps for Bug Cycle?

Once the bug is identified by the tester, it is assigned to the development manager in open status
If the bug is a valid defect the development team will fix it and if it is not a valid defect, the defect will be ignored and marked as rejected
The next step will be to check whether it is in scope, if it is happen so that, the bug is not the part of the current release then the defects are postponed
If the defect or bug is raised earlier then the tester will assigned a DUPLICATE status
When bug is assigned to developer to fix, it will be given a IN-PROGRESS status
Once the defect is repaired, the status will changed to FIXED at the end the tester will give CLOSED status if it passes the final test.

8)      What does the test strategy include?

The test strategy includes introduction, resource, scope and schedule for test activities, test tools, test priorities, test planning and the types of test that has to be performed.

9)      Mention the different types of software testing?

Unit testing
Integration testing and regression testing
Shakeout testing
Smoke testing
Functional testing
Performance testing
White box and Black box testing
Alpha and Beta testing
Load testing and stress testing
System testing

10)   What is branch testing and what is boundary testing?

The testing of all the branches of the application, which is tested once, is known as branch testing.  While the testing, which is focused on the limit conditions of the software is known as boundary testing.

11)   What are the contents in test plans and test cases?

Testing objectives
Testing scope
Testing the frame
The environment
Reason for testing
The criteria for entrance and exit
Deliverables
Risk factors

12)   What is Agile testing and what is the importance of Agile testing?

Agile testing is software testing, which involves the testing of the software from the customer point of view.  The importance of this testing is that, unlike normal testing process, this testing does not wait for development team to complete the coding first and then doing testing. The coding and testing both goes simultaneously.  It requires continuous customer interaction.

It works on SDLC ( Systems Development Life Cycle) methodologies, it means that the task is divided into different segments and compiled at the end of the task.

13)   What is Test case?

Test case is a specific term that is used to test a specific element.  It has information of test steps, prerequisites, test environment and outputs.

14)   What is the strategy for Automation Test Plan?

The strategy for Automation Test Plan
Preparation of Automation Test Plan
Recording the scenario
Error handler incorporation
Script enhancement by inserting check points and looping constructs
Debugging the script and fixing the issues
Rerunning the script
Reporting the result

15)   What is quality audit?

The systematic and independent examination for determining the quality of activities is known as quality audit.  It allows the cross check for the planned arrangements, whether they are properly implemented or not.

16)   How does a server or client environment affect software testing?

As the dependencies on the clients are more, the client or server applications are complex.

The testing needs are extensive as servers, communications and hardware are interdependent. Integration and system testing is also for a limited period of time.

17)   What are the tools used by a tester while testing?

Selenium
Firebug
OpenSTA
WinSCP
YSlow for FireBug
Web Developer toolbar for firebox

18)   Explain stress testing, load testing and volume testing?

Load Testing: Testing an application under heavy but expected load is known as Load Testing.  Here, the load refers to the large volume of users, messages, requests, data, etc.
Stress Testing: When the load placed on the system is raised or accelerated beyond the normal range then it is known as Stress Testing.
Volume Testing:  The process of checking the system, whether the system can handle the required amounts of data, user requests, etc. is known as Volume Testing.

19)   What are the five common solutions for software developments problems?

Setting up the requirements criteria, the requirements of a software should be complete, clear and agreed by all
The next thing is the realistic schedule like time for planning , designing, testing, fixing bugs and re-testing
Adequate testing, start the testing immediately after one or more modules development.
Use rapid prototype during design phase so that it can be easy for customers to find what to expect
Use of group communication tools

20)   What is a ‘USE’ case and what does it include?

The document that describes, the user action and system response, for a particular functionality is known as USE case.  It includes revision history, table of contents, flow of events, cover page, special requirements, pre-conditions and post-conditions.

21)   What is CRUD testing and how to test CRUD?

CRUD testing is another name for Black Box testing.  CRUD stands for Create, Read, Update and Delete.

22)   What is validation and verification in software testing?

In verification, all the key aspects of software developments are taken in concern like code, specifications, requirements and document plans.  Verification is done on the basis of four things list of issues, checklist, walkthroughs and inspection meetings. Following verification, validation is done, it involves actual testing, and all the verification aspects are checked thoroughly in validation.

23)   What is thread testing?

A thread testing is a top-down testing, where the progressive integration of components follows the implementation of subsets of the requirements, as opposed to the integration of components by successively lower levels.

24)   What is configuration management?

It is a process to control and document any changes made during the life of a project.  Release control, Change control and Revision control are the important aspects of configuration management.

25)   What is Ad Hoc testing?

It is a testing phase where the tester tries to break the system by randomly trying the system’s functionality.  It can include negative testing as well.

)      What is data-base testing? Data base testing is segmented into four different categories.

Testing of Data Integrity
Testing of Data Validity
Data base related performance
Testing of functions, procedure and triggers

2)      In database testing, what do we need to check normally?

Normally, the things that we check in database testing are:

Constraint Check
Validation of a Field size
Stored procedure
Matching application field size to database
Indexes for performance based issues

3)      Explain what is data driven test?

In a data-table, to test the multi numbers of data, data-driven test is used.  By using this it can easily replace the parameters at the same time from different locations.

4)      What are joins and mention different types of joins?

Join is used to display two or more than two table and the types of joins are:

Natural Join
Inner Join
Outer Join
Cross Join

The outer join is divided again in two:

Left outer join
Right outer join

5)      What are indexes and mention different types of indexes?

Indexes are database objects and they are created on columns. To fetch data quickly they are frequently accessed. Different types of indexes are:

B-Tree index
Bitmap index
Clustered index
Covering index
Non-unique index
Unique index

Database Testing

6)      While testing stored procedures what are the steps does a tester takes?

The tester will check the standard format of the stored procedures and also it checks the fields are correct like updates, joins, indexes, deletions as mentioned in the stored procedure.

7)      How would you know for database testing, whether trigger is fired or not?

On querying the common audit log you would know, whether, a trigger is fired or not. It is in audit log where you can see the triggers fired.

8)      In data base testing, what are the steps to test data loading?

Following steps need to follow to test data loading

Source data should be known
Target data should be known
Compatibility of source and target should be checked
In SQL Enterprise manager, run the DTS package after opening the corresponding DTS package
You have to compare the columns  of target and data source
Number of rows of target and source should be checked
After updating data in the source, check whether the changes appears in the target or not.
Check NULLs and junk characters

9)      Without using Database Checkpoints, how you test a SQL Query in QTP?

By writing scripting procedure in VBScript, we can connect to database and can test the queries and database.

10)   Explain how to use SQL queries in QTP ?

In QTP using output database check point and database check, you have to select the SQL manual queries option. After selecting the manual queries option, enter the “select” queries to fetch the data in the database and then compare the expected and actual.

11)   What is the way of writing testcases for database testing?

Writing a testcases is like functional testing. First you have to know the functional requirement of the application. Then you have to decide the parameters for writing testcases like

Objective: Write the objective that you would like to test
Input method: Write the method of action or input you want to execute
Expected: how it should appear in the database

12)    To manage and manipulate the test table what are the SQL statements that you have used in Database testing?

The statements like SELECT, INSERT, UPDATE, DELETE are used to manipulate the table, while ALTER TABLE, CREATE TABLE and DELETE TABLE are used to manage table.

13)   How to test database procedures and triggers?

To test database procedures and triggers, input and output parameters must be known. EXEC statement can be used to run the procedure and examine the behaviour of the tables.

Open the database project in solution explorer
Now in View menu, click the database schema
Open the project folder from schema View menu
Right click on the object that has to be tested, and then click on the dialog box that says Create Unit Tests
After that create a new language test project
Select either a) Insert the unit test or b) Create a new test and then click OK
Project that has to be configured will be done by clicking on the Project Configuration dialog box.
Once it configured click on OK

14)   How you can write testcases from requirements and do the requirements represents exact functionality of AUT (Application Under Test)?

To write a testcases from requirements, you need to analyse the requirements thoroughly in terms of functionality. Thereafter you think about the appropriate testcases design techniques like Equivalence partitioning, Black box design, Cause effect graphing etc. for writing the testcases.
Yes, the requirements represent exact functionality of AUT.

15)    What is DBMS?

DBMS stand for Database management system, there are different types of DBMS

Network Model
Hierarchical Model
Relational Model

16)   What is DML?

DML stands for Data Manipulation Language, It is used to manage data with schema objects. It is a subset of SQL.

17)   What are DCL commands? What are the two types of commands used by DCL?

DCL stands for Data Control Language, it is used to control data.

The two types of DCL Commands are:

Grant: By using this command user can access privilege to database

Revoke: By using this command user cannot access the database

18)   What is white box testing and black box testing?

Black box testing means testing the software for the outputs on giving particular inputs.  This testing is usually performed to see if the software meets the user’s requirements.  There is no specific functional output expected for running this test.

The white box testing is done to check the accuracy of code and logic of the program.  This testing is done by the programmer who knows the logical flow of the system.

19)   How does QTP evaluate test results?

Once the testing is done, QTP will generate a report.  This report will show the checkpoints, system message and error that were detected while testing.  The test results window will show any mismatches encountered at the checkpoints.

20)   Explain the QTP testing process?

QTP testing process is based on following steps:
Creating GUI (Graphical User Interface) Map files : Identifies the GUI object which has to be tested
Creating test scripts:  Test scripts are recorded
Debug tests: Test should be debugged
Run tests: Testcases should be run.
View results: The results reflects the success or failure of the tests
Report detects: If the test is failed, the reasons will be recorded in the report detect file

21)   What is load testing and give some examples of it?

To measure the system response, load testing is done.  If the load exceeds the users pattern it is known as stress testing.  Examples of load testing are downloading the set of large files, executing multiple applications on a single computer, subjecting a server to large number of e-mails and allotting many tasks to a printer one after another.

22)   How to test database manually?

Testing the database manually involves checking the data at the back end and to see whether the addition of data in front end is affecting the back end or not, and same for delete, update, insert etc.

23)   What RDBMS stands for and what are the important RDMBS that SQL use?

RDBMS stands for Relational Database Management Systems that use SQL, and the important RDBMS that SQL uses are Sybase, Oracle, Access ,Ingres, Microsoft SQL server etc.

24)   What is performance testing and what are the bottlenecks of performance testing?

Performance testing determines the speed of the computer system performance. It includes the quantitative tests like response time measurement. The problem in performance testing is that you always need a well-trained and experienced man power also the tools you use are expensive.

25)   What is DDL and what are their commands?

To define database structure, DDL is used.  DDL stands for Data Definition Language.  The various DDL commands include Create, Truncate, Drop, Alter, Comment and Rename.

What is the difference between Functional and Non-functional testing?

Functional Testing covers:
•   Unit Testing
•   Smoke testing / Sanity testing
•   Integration Testing (Top Down, Bottom up Testing)
•   Interface & Usability Testing
•   System Testing
•   Regression Testing
•   Pre User Acceptance Testing(Alpha & Beta)
•   User Acceptance Testing
•   White Box & Black Box Testing
•   Globalization & Localization Testing

Non-Functional Testing covers:
•   Load and Performance Testing
•   Ergonomics Testing
•   Stress & Volume Testing
•   Compatibility & Migration Testing
•   Data Conversion Testing
•   Security / Penetration Testing
•   Operational Readiness Testing
•   Installation Testing
•   Security Testing (Application Security, Network Security, System Security)

Software Testing Interview Questions and Answers

Software Testing Interview Questions and Answers

Q: What is Exploratory Testing and when should it be performed?

A: The definition of Exploratory Testing is “simultaneous test design and execution” against an application. This means that the tester uses her domain knowledge and testing experience to predict where and under what conditions the system might behave unexpectedly. As the tester starts exploring the system, new test design ideas are thought of on the fly and executed against the software under test.

On an exploratory testing session, the tester executes a chain of actions against the system, each action depends on the result of the previous action, hence the outcome of the result of the actions could influence what the tester does next, therefore the test sessions are not identical. This is in contrast to Scripted Testing where tests are designed beforehand using the requirements or design documents, usually before the system is ready and execute those exact same steps against the system in another time.

Exploratory Testing is usually performed as the product is evolving (agile) or as a final check before the software is released. It is a complimentary activity to automated regression testing.

Q: What Test Techniques are there and what is their purpose?

A: Test Techniques are primarily used for two purpose: a) To help identify defects, b) To reduce the number of test cases.

Equivalence partitioning is mainly used to reduce number of test cases by identifying different sets of data that are not the same and only executing one test from each set of data.
Boundary Value Analysis is used to check the behaviour of the system at the boundaries of allowed data.
State Transition Testing is used to validate allowed and disallowed states and transitions from one state to another by various input data
Pair-wise or All Pairs Testing is a very powerful test technique and is mainly used to reduce the number of test cases while increasing the coverage of feature combinations.

What is Acceptance Testing?
Testing conducted to enable a user/customer to determine whether to accept a software product.Normally performed to validate the software meets a set of agreed acceptance criteria.

What is Accessibility Testing?
Verifying a product is accessible to the people having disabilities (deaf, blind, mentally disabled etc.).

What is Adhoc Testing?
A testing phase where the tester tries to ‘break’ the system by randomly trying the system’s functionality. Can include negative testing as well. See also Monkey Testing.

What is Agile Testing?
Testing practice for projects using agile methodologies, treating development as the customer of testing and emphasizing a test-first design paradigm. See also Test Driven Development.

What is Application Programming Interface (API)?
A formalized set of software calls and routines that can be referenced by an application program in order to access supporting system or network services.

What is Automated Testing?
Testing employing software tools which execute tests without manual intervention. Can be applied in GUI, performance, API, etc. testing. The use of software to control the execution of tests, the comparison of actual outcomes to predicted outcomes, the setting up of test preconditions, and other test control and test reporting functions.

What is Beta Testing?
Testing of a release of a software product conducted by customers.

What is Black Box Testing?
Testing based on an analysis of the specification of a piece of software without reference to its internal workings. The goal is to test how well the component conforms to the published requirements for the component.

What is Bottom Up Testing?
An approach to integration testing where the lowest level components are tested first, then used to facilitate the testing of higher level components. The process is repeated until the component at the top of the hierarchy is tested.

Manual Testing Interview Questions

Manual Testing Interview Questions

Ans. How to define a standard process for the entire testing flow, how to explain challenging situations in manual testing career, What is the best way to go about getting a pay rise. Click above link for answers to these questions.

Q. What is the most challenging situation you had during testing?
Q. How to perform testing if there are no documents?
Ans. Click here for the detailed post on how to answer these QA interview questions.

Q. How to prepare for software testing/QA interview?
Ans. Click above link to know – Where should I start with for preparation of interview? It’s almost 2 years I have faced any interview.

Q. Mock test to judge your software testing interview skills
Ans. Take this mock test paper helpful for preparing testing interview as well as the CSTE certification exam. Click above link for questions and answers.

Q. Winrunner interview questions with answers
Ans. Preparing for Winrunner interview – These are some important Winrunner interview questions frequently asked in automation testing interview. Winrunner questions 1, questions 2 and questions 3

Q. Different Automation Testing Interview Questions
Ans. Click above link for automation interview questions like Difference between Winrunner and Test Director, What is TSL? What 4GL is it similar too?

Q. What is difference between Performance Testing, Load Testing and Stress Testing? Explain with examples?
Ans. Many people are confused with these testing terminologies. Click here for the explanation of Performance, Load and Stress Testing with examples.

Q. ISTQB questions and answers (more questions here  and here)
Ans. Click above links to read ISTQB paper pattern and tips on how to solve the questions quickly. ISTQB ‘Foundation level’ sample questions with answers.

Q. QTP interview questions
Ans. Quick Test Professional: Interview Questions and answers.

Q. CSTE questions with answers

Q. What is Desk checking and Control Flow Analysis
Ans. Click here – Desk checking and Control Flow Analysis along with examples

Q. What is Sanity Test (or) Build test?
Ans. Verifying the critical (important) functionality of the software on new build to decide whether to carry further testing or not.

Q. What is the difference between client-server testing and web based testing
Ans. Click here for the answer.

Q. What is black box testing?
Ans. Black box testing explained with types

Q. What is white box testing?
Ans. Click here for the post explaining white box testing explained with types

Q. What are different types of software testing?
Ans. Click here to refer the post explaining in detail all Software Testing Types

Q. What is Dynamic Testing?
Ans. It is the testing done by executing the code or program with various input values and output is verified.

Q. What is GUI Testing?
Ans. GUI or Graphical user interface testing is the process of testing software user interface against the provided requirements/mockups/HTML designs.

Q. What is Formal Testing?
Ans. Software verification carried out by following test plan, testing procedures and proper documentation with an approval from customer

Q. What is Risk Based Testing?
Ans. Identifying the critical functionality in the system then deciding the orders in which these functionality to be tested and applying testing.

Q. What is Early Testing?
Ans. Conducting testing as soon as possible in development life cycle to find defects at early stages of SDLC.
Early testing is helpful to reduce the cost of fixing defects at later stages of STLC.

Q. What is Exhaustive Testing?
Ans. Testing functionality with all valid, invalid inputs and preconditions is called exhaustive testing.

Q. What is Defect Clustering?
Ans. Any small module or functionality may contain more number of defects – concentrate more testing on these functionality.

Q. What is Pesticide Paradox?
Ans. If prepared test cases are not finding defects, add/revise test cases to find more defects.

Q. What is Static Testing?
Ans. Manual verification of the code without executing the program is called as static testing. In this process issues are identified in code by checking code, requirement and design documents.

Q. What is Positive Testing?
Ans. Testing conducted on the application to determine if system works. Basically known as “test to pass” approach.

Q. What is Negative Testing?
Ans. Testing Software with negative approach to check if system is not “showing error when not supposed to” and “not showing error when supposed to”.

Q. What is End-to-End Testing?
Ans. Testing the overall functionality of the system  including the data integration among all the modules is called end to end testing.

Q. What is Exploratory Testing?
Ans. Exploring the application, understanding the functionality, adding (or) modifying existing test cases for better testing is called exploratory testing.

Q. What is Monkey Testing
Ans. Testing conducted on a application without any plan and carried out with tests here and there to find any system crash with an intention of finding tricky defects is called monkey testing.

Q. What is Non-functionality Testing?
Ans. Validating various non functional aspects of the system such as user interfaces, user friendliness security, compatibility, Load, Stress and Performance etc is called non functional testing.

Q. What is Usability Testing?
Ans. Checking how easily the end users are able to understand and operate the application is called Usability Testing.

Q. What is Security Testing
Ans. Validating whether all security conditions are properly implemented in the software (or) not is called security testing.

Q. What is Performance Testing?
Ans. Process of measuring various efficiency characteristics of a system such as response time, through put, load stress transactions per minutes transaction mix.

Q. What is Load Testing?
Ans. Analyzing functional and performance behavior of the application under various conditions is called Load Testing.

Q. What is Stress Testing?
Ans. Checking the application behavior under stress conditions
(or)
Reducing the system resources and keeping the load as constant checking how does the application is behaving is called stress testing.

Q. What is Process?
Ans. A process is set of a practices performed to achieve a give purpose; it may include tools, methods, materials and or people.

Q. What is Software Configuration Management?
Ans. The process of identifying, Organizing and controlling changes to software development and maintenance.
(or)
A methodology to control and manage a software development project

Q. What is Testing Process / Life Cycle?
Ans. Write Test  Plan
Test Scenarios
Test Cases
Executing Test Cases
Test Results
Defect Reporting
Defect Tracking
Defect Closing
Test Release

Q. What is full form of CMMI?
Ans. Capability Maturity Model Integration

Q. What is Code Walk Through?
Ans. Informal analysis of the program source code to find defects and verify coding techniques.

Q. What is Unit Level Testing?
Ans. Testing of single programs, modules or unit of code.

Q. What is Integration Level Testing?
Ans. Testing of related programs, Modules (or) Unit of code.
(or)
Partitions of the system ready for testing with other partitions of the system.

Q. What is System Level Testing?
Ans. Testing of entire computer system across all modules.  This kind of testing can include functional and structural testing.

Q. What is Alpha Testing?
Ans. Testing of whole computer system before rolling out to the UAT.

Q. What is User Acceptance Testing  (UAT)?
Ans. Testing of computer system by client to verify if it adhered to the provided requirements.

Q. What is Test Plan?
Ans. A document describing the scope, approach, resources, and schedule  of testing activities.  It identifies test items, features to be tested, testing tasks, who will do each task, and any risks requiring contingency planning.

Q. What is Test Scenario?
Ans. Identify all the possible areas to be tested (or) what to be tested.

Q. What is ECP (Equivalence Class Partition)?
Ans. It is method for deriving test cases.

What is Boundary value analysis and Equivalence partitioning?

Q. What is a Defect?
Ans. Any flaw imperfection in a software work product.
(or)
Expected result is not matching with the application actual result.

Q. What is Severity?
Ans. It defines the important of defect with respect to functional point of view i.e. how critical is defect  with respective to the application.

Q. What is Priority?
Ans. It indicates the importance or urgency of fixing a defect

Q. What is Re-Testing?
Ans. Retesting the application to verify whether defects have been fixed or not.

Q. What is Regression Testing?
Ans. Verifying existing functional and non functional area after making changes to the part of the software or addition of new features.

Q. What is Recovery Testing?
Ans. Checking if the system is able to handle some unexpected unpredictable situations is called recovery testing.

Q. What is Globalization Testing?
Ans. Process of verifying software whether it can be run independent of its geographical and cultural environment. Checking if the application is having features of setting and changing language, date, format and currency if it is designed for global users.

Q. What is Localization Testing?
Ans. Verifying of globalized application for a particular locality of users, cultural and geographical conditions.

Q. What is Installation Testing?
Ans. Checking if we are able to install the software successfully (or) not as per the guidelines given in installation document is called installation testing.

Q. What is Un-installation Testing?
Ans. Checking if we are able to uninstall the software from the system successfully (or) not is called Uninstallation Testing

Q. What is Compatibility Testing?
Ans. Checking if the application is compatible to different software and hardware environment or not is called compatibility testing.

Q. What is Test Strategy?
Ans. It is a part of test plan describing how testing is carried out for the project and what testing types needs to be performed on the application.

Q. What is Test Case?
Ans. A Test case is a set of preconditions steps to be followed with input data and expected behavior to validate a functionality of a system.

Q. What is Business Validation Test Case?
Ans. A test case is prepared to check business condition or business requirement is called business validation test case.

Q. What is a Good Test Case?
Ans. A Test case that have high priority of catching defects in called a good test case.

Q. What is Use Case Testing?
Ans. Validating a software to confirm whether it is developed as per the use cases or not is called use case testing.

Q. What is Defect Age?
Ans. The time gap between date of detection & date of closure of a defect.

Q. What is Showstopper Defect?
Ans. A defect which is not permitting to continue further testing is called Showstopper Defect

Q. What is Test Closure?
Ans. It is the last phase of the STLC,  where the management prepares various test summary reports that explains the complete statistics of the project based on the testing carried out.

Q. What is Bucket Testing?
Ans. Bucket testing is also know as A/B testing. It is mostly used to study the impact of the various product designs in website metrics. Two simultaneous versions are run on a single or set of web pages to measure the difference in click rates, interface and traffic.

Q. What is What is Entry Criteria and Exit Criteria Software Testing?
Ans. The Entry Criteria is the process that must be present when a system begins, like,
SRS – Software
FRS
Use Case
Test Case
Test Plan
The Exit criteria ensures whether testing is completed and the application is ready for release, like,
Test Summary Report,
Metrics
Defect Analysis Report.

Q. What is Concurrency Testing?
Ans. This is a multiple user testing to access the application at the same time to verify effect on code, module or DB. mainly used to identify locking and deadlocking situations in the code.

Q. What is Web Application Testing?
Ans. Web application testing is done on a website to check – load, performance, security, Functionality, Interface, Compatibility and other usability related issues.

Q. What is Unit Testing?
Ans. Unit testing is done  to check whether the individual modules of the source code are working properly or not.

Q. What is Interface Testing
Ans. Interface testing is done to check whether the individual modules are communicating properly as per specifications. Interface testing is mostly used to test the user interface of GUI applications.

Q. What is Gamma Testing
Ans. Gamma testing is done when the software is ready for release with specified requirements, this testing is done directly by skipping all the in-house testing activities.

Q. What is Test Harness?
Ans. Test Harness is configuring a set of tools and test data to test an application in various conditions, which involves monitoring the output with expected output for correctness.
The benefits of Testing Harness are: Productivity increase due to process automation and increase in product quality

Q. What is Scalability Testing?
Ans. It is used to check whether the functionality and performance of a system, whether system is capable to meet the volume and size changes as per the requirements
Scalability testing is done using load test by changing various software, hardware configurations and testing environment.

Q. What is Fuzz Testing?
Ans. Fuzz testing is a black box testing technique which uses a random bad data to attack a program to check if anything breaks in the application.

Q. What is Difference between QA, QC and testing?
Ans. QA?
It is process oriented
Aim is to prevent defects in an application

QC?
Set of activities used to evaluate a developed work product
It is product oriented

Testing?
Executing and verifying application with the intention of finding defects

Q. What is Date Driven Testing?
Ans. It is Automation testing process in which application is tested with multiple set of data with different preconditions as an input to the script.

Siebel Configuration Interview Questions

Siebel Configuration Interview Questions

Question : How does Primary Id field improves performance of an MVG field?
Answer: By default every MVG field executes a separate query on database to fetch data from child BusComp. When primary id field is specified, Siebel does not execute sub-query and instead uses join to fetch the data.

Question : What are the implications if Primary ID field is not used in MVG?
Answer: If Primary Id is not specified on an MVG then view will take a lot more time to load as for every record in list applet another subquery will be executed.

Question . Is it possible to deploy SRF on server if objects are not checked in?
Answer:Yes, for Business Service BusComp, BusObject and Applet changes, srf can be deployed on server without checking in the objects, however workflow needs all the BO and BC to be checked in before it is activated.

Question . How to disable new record creation for certain users of Siebel?
Answer: Applet’s PreCanInvokeMethod Method can be used to disable new button by setting CanInvoke to false, this can be done conditionally by checking the position or responsibility of the current user.

Question . How to make field editable for certain group of users only?
Answer: Create field read only field user property for the field and use calculated field expression to check the responsibilities of user, return N if user has the responsibility to edit the field and Y if it doesn’t

Calculated field expression:

IIF(InList(“Edit Field”,GetProfileAttrAsList(“User Responsibilities”))=’Y’,’N’,’Y’)

This way user who don’t have the responsibility will see the field readonly.

Question . How to access user preference in script?

Question . How to access system preference in escript?
Query System Preferences BC on Name and Value fields to get the value of system preference..

var boSysPref = TheApplication().GetBusObject(“System Preferences”);
var bcSysPref = boSysPref.GetBusComp(“System Preferences”);
bcSysPref.ClearToQuery();
bcSysPref.ActivateField(“Value”);
bcSysPref.SetViewMode(AllView);
bcSysPref.SetSearchSpec(“Name”, sName);
bcSysPref.ExecuteQuery( ForwardOnly );

if (bcSysPref.FirstRecord())
{
sValue = bcSysPref.GetFieldValue(“Value”);
}return(sValue);

Question . How to set system preference in Siebel?
Administration Application> System Preference view can be used to set the value of system preference.

Question . What could be reason if Picklist field is not showing the drop down sign?
Picklist name is not set on the field.
Picklist is not compiled or picklist values are not created in Siebel
Control’s Runtime property is not set to true.

Question . Is it possible to make calculated field as editable field?
Yes, by setting setting pick map on calculated field and field becomes editable, however it won’t be able to save the value and will recalculate the value on refresh record.

Question . How can you get the value of parent field value in browser script?
Only fields displayed on UI are accessible in browser script, it is applicable for all the parent and child bus components.

Best SEO Interview Questions and Answers

Best SEO Interview Questions and Answers

Q1. Tell me something about yourself ?

Ans. You should tell him very confidentially about yourself your strength and your Aim.

Q2. What you know about SEO (search engine optimization)  ?

Ans.It is process of getting traffic from free and paid listing on the search engine like.

Google
Yahoo
Bing

OR

Search engine optimization (SEO) is the process of affecting the visibility of a website a web page in a search engine’s “natural” or un-paid (“organic”) search results.

In general, the earlier (or higher ranked on the search results page), and more frequently a site appears in the search results list, the more visitors it will receive from the search engine’s users.

SEO may target different kinds of search, including image search, local search, video search, academic search,  news search and industry-specific vertical search engines

Q3. How to get top position in SEO ?

Ans. With the help of two factors we get top position in Search Engine

A) Onpage Optimization
B) Offpage Optimization

Q4. ON Page Optimization Means ?

Ans. Where we need to work on On page of our site and we can make changes on title tag, meta tag,site structure and site content, links and keyword.And On page optimization we need to work also on logical factors.

Q5. What do you know about Off Page Optimization ?

Ans.Off page optimization means we can work on important factors like directory submission,linkbuilding, social media and fresh content.And Off page optimization we don’t need to work on logical abilities.

Q6. Do you know about latest update in SEO ?

Ans.Yes Sir i know about latest updates in SEO
1) Panda
2) penguin

Q7. what is the latest panda update google?

Ans. The Panda  is for improve the search result in Google.The latest panda version is 2.5.3 . All the focus was transformed on the user and now quality content , proper design, proper speed, proper use of images and videos, content to ad  ratio all mattered more after the Panda update.

Q8. What do you know about latest update in penguin ?

Ans. In the September 5 the Google penguin 3 has updated. Mutt cutts says it is the new data refresh. 0.3% english language has effected. Penguin is the code name of the google algorithm. It is first arrived the April 24 2012. It’s goal is decreasing the ranking of the website that violate the Google Webmaster guidelines. This guidelines are violated by using black ghat SEO techniques like keyword stuffing, cloaking etc. Lots of duplicate sites are effected by this update. When it first arrived 3.1% search query has effected. But now only 0.3% has effected. Still it is very much dangerous for the SEO. I think best technique is that only directory submission can help you. It can overcome some damage of your site. But after all it’s very bad news for the world of SEO

Q9. Who is Matt cutts ?

Ans. Matt cutt is the head of Google web spam team.

Q10. What is keyword stemming ?

Ans. keyword stemming is the process of finding out the root word from the  search query..

Q11.What is keyword density ?

Ans. Keyword density make your content stand out in crowd.

Q12. What are webmastertools ?

Ans. Webmaster tools is free service by google where we can check all the details like indexing data,daily user, stats ,search query,CTR and XML sitemap.

Q13. Which  Important factors makes ON Page Optimization better ?

Ans. In On Page Optimization there are some important factors like

Title Tag
Meta tag
Keyword
Sitemap
Images
Internal linking
Bread crimp.

Q14. Which  Important factors makes Off Page Optimization better ?

Ans. In Off Page Optimization there are some important factors like

Directory Submission
Artical Submission
Press Release
Blog Writing/posting/creation
Classified Submission
Social Media

Q15. What is google Sandbox ?

Ans. Google sandbox is an imaginary area where less authoritative and new sites taking place while they are popular and authorized on the web.

Q16. What is LSI ?

Ans. LSI stands for latent semantic indexing.It is data retrieval technique.

Q17. How many characters limits in Title tag ?

Ans. In title tag approx 70 characters we can add.
<title>primary keyword(70 char)</title>

Q18. How many types of Meta Tags and their characters limits ?

Ans. 2 types meta tags in Seo

Description Meta tag (150 characters limits)
Keyword Meta tag (200 characters limits)

Q19. What Seo tools do you use ?

Ans. Google webmaster tools, Google analytic,keyword research,Alexa,open site explorer.

Q20. How many SEO techniques do you know ?

Ans.

1)Black hat seo
2)White hat seo
3)Gray hat seo

Q21. What is Black Hat Seo ? And how many techniques used in it ?

Ans. Black hat seo is technique in which we use duplicate issues like content,photos, video,hidden links, keyword stuffing doorway pages and many other.It is not good for our site because when Google starts its crawling it considered the site is full of duplicate issues and he penalized the site minimum +30 Google page ranking
Black hat SEO Techniques

hidden link
keyword stuffing
doorway pages
incorrect keyword
link farming
mirror side

Q22. What is White Hat Seo ? And how many techniques used in it ?

Ans. White hat seo is a technique in which we used fresh,good contents in our site.Never used any kind of duplicate contents in it.It is the best method to get high ranking on the Search Engine..

White hat SEO Techniques

Quality contents
Titles and Meta data
Keyword research and Effective keyword use
Quality inbound links

Q23. What is Bookmarking Sites ?

Ans. Bookmarking sites helps you to getting instant traffic on your site by his powerful social media factor. You can easily bookmarks this site on your favorites list and when it requires you can click on this and you will get this.

Q24.Top 6 Bookmarking  sites name ?

Ans. Top Bookmarking Sites.

Twitter
Pinterest
reddit
stumble upon
Digg
Delicious

Q25. Tell me One URL short links site name ?

Ans. http://www.bitly.com

Q26. Define blog, article & press release?

Ans: A blog is referred as an information or discussion published on website or World Wide Web incorporating  distinct entries called as posts. Basically, the blog is referred as everything thing where you can include others too. It is more individual in contrast to article and press release. It is also considered as very personal in subject to both style and comprised ideas and information and can be written in the way just like you may talk to your readers. It is also called Web diary or Online Diary.

The articles are concerned with specific topic or event and are highly oriented towards an opinion instead of information. An article is supposed to be more oriented towards showing up opinions, views and idea. Generally, it is written  by a third party or expert of any specific field.

Press Release is related with a specific action or event which can be republished by distinct medium of mass-media including other websites. It should be simple, short and professional. It conveys a clear message or information.

Q27. What are Meta Tags?

Ans: HTML meta tags are usually referred as tags of page data which sits between opening and closing head tags of a document’s HTML code. Actually these are hidden keywords who sits in the code. These are invisible to visitors but are visible and readable by Search Engines.

Related Post: Best SEO Interview Questions

Example:

<head>
<title>Not considered as Meta Tag, even required anyway</title>
<meta name=”description” content=”Write your description here” />
<meta name=”keywords” content=”Write your keyword here” />
</head>

Q28. Difference between keyword & keyword phrase?

Ans: The keyword term is basically concerned with a one-word term, on the other hand a keyword phrase considered as employment of two or more word-combinations. Therefore, it is very confounded to get high ranking in account of one-word keyword term until the one-word keyword has little online competition. Therefore, this practice is not encouraged to employ. In order to drive more traffic and top ranking in SERP it is recommended to employ keyword phrase.

Q29. Establish a difference between PR & SERP.

Ans: PR is Page Rank which is defined by quality inbound links from other website or web-pages to a web page or website as well as say the importance of that site.

SERP stands for Search Engine Result Page is the placement of the website or web-page which is returned by search engine after a search query or attribute.

Q30. Define Alt tag?

Ans: The alt attribute also called as alt tag are employed in XHTML and HTML documents in context of defining alternative text that is supposed to be rendered when the element can’t be rendered to which it is applied. One great feature of alt tag is that it is readable to ‘screen reader’ which is a software by means of which a blind person can hear this. In addition, it delivers alternative information for an image due to some specific reason a user can’t view it such as in case of slow connection and an error occurred in the src attribute.

For example, the HTML for this image will appear something like this:

<img alt=”you can define alt tag just below the input box of image title while uploading or editing a image.” src=”<http://www.webgranth.com/wp-content/uploads/2012/07/Alt tag.jpg”>

Q31. What do you know about Adsense?

Ans: Adsense is a web program conducted by Google that enables publishers of content websites to cater text, rich media, image, video advertisements automatically which are relevant to content of website and audience. These advertisement are included, maintained and sorted by Google itself and earn money either by per-click or per-impression basis.

Q32. Can you define Adword?

Ans: Adword is referred as the main advertising product of Google which is useful to make appear your ads on Google and its partner websites including Google Search. This Google’s product offer PPC (Pay Per Click) advertising which is a primary module and incorporate a sub module CPC (Cost Per Click) where we bid that rate that will be charged only when the users click your advertisement. One another sub module is CPM (Cost Per Thousand Impression) advertising where advertiser pay for a thousand impression on flat rate to publisher. In addition it also includes website targeted advertising of banner, text and rich-media ads. Moreover, the ad will appear especially to those people who are already looking for such type of product you are offering as well as offer to choose particular sites with geographical area to show your ads.

Q33. What is PPC?

Ans: PPC is the abbreviated form of Pay Per Click and is a advertisement campaign conducted by Google. It is referred as a primary module with two sub module CPC (Cost-per-click) and CPM (Cost per thousand impression) through bidding and flat rate respectively. In CPC the advertiser would be only charged when the user click over their advert.

Q34. What are the aspects in SEO?

Ans: The main aspect in SEO are divided in two class: SEO On-Page and SEO Off-Page.
SEO On-Page includes Meta tag, description, keywords optimization, site structure and analysis, etc.
SEO Off-Page aspect are Keyword Research, unique and quality content, link building through Blog Comments, Blog Posting, Article submission, Press Release, Classified posting, Forum posting.

Q35. What do you know about RSS?

Ans: RSS stands for Really Simple Syndication is useful to frequently publish all updated works including news headlines, blog entries etc. This RSS document also known as web feed, feed or channel that incorporate summarized text including metadata i.e. authorship and publishing dates etc.
However, RSS feeds make the publishers flexible by syndicating the content automatically. There is a standardized file format XML that lets the information to be published once which can be visible to several distinct programs. Also, this make readers more ease to get updates timely by allowing them to subscribe from their favorite sites.

Related Post: Top 10 Best SEO Interview Questions
keywords:

Questions and answers for the mobile developer

Questions and answers for the mobile developer

What languages are mobile apps programmed in?

Cisco WebEx develops mobile meeting applications for a host of devices. The apps are developed in the programming language best suited to the device and OS we are approaching. So, we develop using C++ for Apple devices running on iOS, Java for BlackBerry devices, Java for Android devices and so on.

How are mobile applications scoped and specified?

Scoping starts with a long, hard look at the device. Mobile devices offer different form factors, screen size and resolution, computing power and functionality. They run different operating systems and have other methods of retrieving data such as wifi or 3G.

The challenge is to understand the device and how it will be used to the best advantage: focus on the benefits of the device, such as size and portability, and ensure that the user experience will be optimised.

What special skills and roles are required?

The important ones are flexibility, speed, and a keen understanding of the user experience. Mobile development jobs require you to work quickly and be ready to respond to lots of changes, such as hardware and software updates, patches and design changes. The tablet is a great example – we have entered into a ‘post PC era’ and the types of things that a tablet will be used for is still evolving.

How do you port applications to multiple platforms?

We have created a single unified architecture that covers all platforms, so that we can ensure a common user experience across devices. However, different platforms utilise different operating systems and system tools, so we have to create a unique client code base for each platform – iOS, Android, and Blackberry. It is possible to reuse some code across Blackberry and Android.

What’s different about mobile app development?

Some of the unique challenges are: designing for a small screen size and resolution; energy management that focuses on optimisation of battery life; managing data access in an environment of variable and potentially inconsistent network access; working with devices that offer limited processor power and RAM in comparison to a PC.

What are the tech challenges?

Platform fragmentation is the biggest, the need to develop and maintain separate apps on each of the different platforms.

Others include: varying levels of maturity of software developer kit and technical documentation; different user interface guidelines; different specs for processor and RAM; differences between mobile platforms in terms of how security is handled, multi-tasking is supported, and content is rendered.

Any other advice for the app developer?

Pick the platform you want to develop on wisely; focus only on one or two platforms in the beginning; and start simple. Focus on core functionality first and add features in subsequent versions as you gain insight and experience.

Top 50 Android Interiew Questions

Top 50 Android Interiew Questions

1) What is Android?
It is an open-sourced operating system that is used primarily on mobile devices, such as cell phones and tablets. It is a Linux kernel-based system that’s been equipped with rich components that allows developers to create and run apps that can perform both basic and advanced functions.
2) What Is the Google Android SDK?
The Google Android SDK is a toolset that developers need in order to write apps on Android enabled devices. It contains a graphical interface that emulates an Android driven handheld environment, allowing them to test and debug their codes.
3) What is the Android Architecture?
Android Architecture is made up of 4 key components:
– Linux Kernel
– Libraries
– Android Framework
– Android Applications
4) Describe the Android Framework.
The Android Framework is an important aspect of the Android Architecture. Here you can find all the classes and methods that developers would need in order to write applications on the Android environment.
5) What is AAPT?
AAPT is short for Android Asset Packaging Tool. This tool provides developers with the ability to deal with zip-compatible archives, which includes creating, extracting as well as viewing its contents.
6) What is the importance of having an emulator within the Android environment?
The emulator lets developers “play” around an interface that acts as if it were an actual mobile device. They can write and test codes, and even debug. Emulators are a safe place for testing codes especially if it is in the early design phase.
7) What is the use of an activityCreator?
An activityCreator is the first step towards the creation of a new Android project. It is made up of a shell script that will be used to create new file system structure necessary for writing codes within the Android IDE.
8 ) Describe Activities.
Activities are what you refer to as the window to a user interface. Just as you create windows in order to display output or to ask for an input in the form of dialog boxes, activities play the same role, though it may not always be in the form of a user interface.
9) What are Intents?
Intents displays notification messages to the user from within the Android enabled device. It can be used to alert the user of a particular state that occurred. Users can be made to respond to intents.
10) Differentiate Activities from Services.
Activities can be closed, or terminated anytime the user wishes. On the other hand, services are designed to run behind the scenes, and can act independently. Most services run continuously, regardless of whether there are certain or no activities being executed.
11) What items are important in every Android project?
These are the essential items that are present each time an Android project is created:
– AndroidManifest.xml
– build.xml
– bin/
– src/
– res/
– assets/
12) What is the importance of XML-based layouts?
The use of XML-based layouts provides a consistent and somewhat standard means of setting GUI definition format. In common practice, layout details are placed in XML files while other items are placed in source files.
13) What are containers?
Containers, as the name itself implies, holds objects and widgets together, depending on which specific items are needed and in what particular arrangement that is wanted. Containers may hold labels, fields, buttons, or even child containers, as examples.
14) What is Orientation?
Orientation, which can be set using setOrientation(), dictates if the LinearLayout is represented as a row or as a column. Values are set as either HORIZONTAL or VERTICAL.
15) What is the importance of Android in the mobile market?
Developers can write and register apps that will specifically run under the Android environment. This means that every mobile device that is Android enabled will be able to support and run these apps. With the growing popularity of Android mobile devices, developers can take advantage of this trend by creating and uploading their apps on the Android Market for distribution to anyone who wants to download it.
16) What do you think are some disadvantages of Android?
Given that Android is an open-source platform, and the fact that different Android operating systems have been released on different mobile devices, there’s no clear cut policy to how applications can adapt with various OS versions and upgrades. One app that runs on this particular version of Android OS may or may not run on another version. Another disadvantage is that since mobile devices such as phones and tabs come in different sizes and forms, it poses a challenge for developers to create apps that can adjust correctly to the right screen size and other varying features and specs.
17) What is adb?
Adb is short for Android Debug Bridge. It allows developers the power to execute remote shell commands. Its basic function is to allow and control communication towards and from the emulator port.
18) What are the four essential states of an activity?
– Active – if the activity is at the foreground
– Paused – if the activity is at the background and still visible
– Stopped – if the activity is not visible and therefore is hidden or obscured by another activity
– Destroyed – when the activity process is killed or completed terminated
19) What is ANR?
ANR is short for Application Not Responding. This is actually a dialog that appears to the user whenever an application have been unresponsive for a long period of time.
20) Which elements can occur only once and must be present?
Among the different elements, the and elements must be present and can occur only once. The rest are optional, and can occur as many times as needed.
21) How are escape characters used as attribute?
Escape characters are preceded by double backslashes. For example, a newline character is created using ‘\\n’
22) What is the importance of settings permissions in app development?
Permissions allow certain restrictions to be imposed primarily to protect data and code. Without these, codes could be compromised, resulting to defects in functionality.
23) What is the function of an intent filter?
Because every component needs to indicate which intents they can respond to, intent filters are used to filter out intents that these components are willing to receive. One or more intent filters are possible, depending on the services and activities that is going to make use of it.
24) Enumerate the three key loops when monitoring an activity
– Entire lifetime – activity happens between onCreate and onDestroy
– Visible lifetime – activity happens between onStart and onStop
– Foreground lifetime – activity happens between onResume and onPause
25) When is the onStop() method invoked?
A call to onStop method happens when an activity is no longer visible to the user, either because another activity has taken over or if in front of that activity.
26) Is there a case wherein other qualifiers in multiple resources take precedence over locale?
Yes, there are actually instances wherein some qualifiers can take precedence over locale. There are two known exceptions, which are the MCC (mobile country code) and MNC (mobile network code) qualifiers.
27) What are the different states wherein a process is based?
There are 4 possible states:
– foreground activity
– visible activity
– background activity
– empty process
28) How can the ANR be prevented?
One technique that prevents the Android system from concluding a code that has been responsive for a long period of time is to create a child thread. Within the child thread, most of the actual workings of the codes can be placed, so that the main thread runs with minimal periods of unresponsive times.
29) What role does Dalvik play in Android development?
Dalvik serves as a virtual machine, and it is where every Android application runs. Through Dalvik, a device is able to execute multiple virtual machines efficiently through better memory management.
30) What is the AndroidManifest.xml?
This file is essential in every application. It is declared in the root directory and contains information about the application that the Android system must know before the codes can be executed.
31) What is the proper way of setting up an Android-powered device for app development?
The following are steps to be followed prior to actual application development in an Android-powered device:
-Declare your application as “debuggable” in your Android Manifest.
-Turn on “USB Debugging” on your device.
-Set up your system to detect your device.
32) Enumerate the steps in creating a bounded service through AIDL.
1. create the .aidl file, which defines the programming interface
2. implement the interface, which involves extending the inner abstract Stub class as well as implanting its methods.
3. expose the interface, which involves implementing the service to the clients.
33) What is the importance of Default Resources?
When default resources, which contain default strings and files, are not present, an error will occur and the app will not run. Resources are placed in specially named subdirectories under the project res/ directory.
34) When dealing with multiple resources, which one takes precedence?
Assuming that all of these multiple resources are able to match the configuration of a device, the ‘locale’ qualifier almost always takes the highest precedence over the others.
35) When does ANR occur?
The ANR dialog is displayed to the user based on two possible conditions. One is when there is no response to an input event within 5 seconds, and the other is when a broadcast receiver is not done executing within 10 seconds.
36) What is AIDL?
AIDL, or Android Interface Definition Language, handles the interface requirements between a client and a service so both can communicate at the same level through interprocess communication or IPC. This process involves breaking down objects into primitives that Android can understand. This part is required simply because a process cannot access the memory of the other process.
37) What data types are supported by AIDL?
AIDL has support for the following data types:
-string
-charSequence
-List
-Map
-all native Java data types like int,long, char and Boolean
38) What is a Fragment?
A fragment is a part or portion of an activity. It is modular in a sense that you can move around or combine with other fragments in a single activity. Fragments are also reusable.
39) What is a visible activity?
A visible activity is one that sits behind a foreground dialog. It is actually visible to the user, but not necessarily being in the foreground itself.
40) When is the best time to kill a foreground activity?
The foreground activity, being the most important among the other states, is only killed or terminated as a last resort, especially if it is already consuming too much memory. When a memory paging state has been reach by a foreground activity, then it is killed so that the user interface can retain its responsiveness to the user.
41) Is it possible to use or add a fragment without using a user interface?
Yes, it is possible to do that, such as when you want to create a background behavior for a particular activity. You can do this by using add(Fragment,string) method to add a fragment from the activity.
42) How do you remove icons and widgets from the main screen of the Android device?
To remove an icon or shortcut, press and hold that icon. You then drag it downwards to the lower part of the screen where a remove button appears.
43) What are the core components under the Android application architecture?
There are 5 key components under the Android application architecture:
– services
– intent
– resource externalization
– notifications
– content providers
44) What composes a typical Android application project?
A project under Android development, upon compilation, becomes an .apk file. This apk file format is actually made up of the AndroidManifest.xml file, application code, resource files, and other related files.
45) What is a Sticky Intent?
A Sticky Intent is a broadcast from sendStickyBroadcast() method such that the intent floats around even after the broadcast, allowing others to collect data from it.
46) Do all mobile phones support the latest Android operating system?
Some Android-powered phone allows you to upgrade to the higher Android operating system version. However, not all upgrades would allow you to get the latest version. It depends largely on the capability and specs of the phone, whether it can support the newer features available under the latest Android version.
47) What is portable wi-fi hotspot?
Portable Wi-Fi Hotspot allows you to share your mobile internet connection to other wireless device. For example, using your Android-powered phone as a Wi-Fi Hotspot, you can use your laptop to connect to the Internet using that access point.
48) What is an action?
In Android development, an action is what the intent sender wants to do or expected to get as a response. Most application functionality is based on the intended action.
49) What is the difference between a regular bitmap and a nine-patch image?
In general, a Nine-patch image allows resizing that can be used as background or other image size requirements for the target device. The Nine-patch refers to the way you can resize the image: 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes.
50) What language is supported by Android for application development?
The main language supported is Java programming language. Java is the most popular language for app development, which makes it ideal even for new Android developers to quickly learn to create and deploy applications in the Android environment.

Python Interview Questions & Answers

Python Interview Questions & Answers

1. Define python?

Python is simple and easy to learn language compared to other programming languages. Python was introduced to the world in the year 1991 by Guido van Rossum. It is a dynamic object oriented language used for developing software. It supports various programming languages and have a massive library support for many other languages. It is a modern powerful interpreted language with objects, modules, threads, exceptions, and automatic memory managements.

Salient features of Python are
-Simple & Easy: Python is simple language & easy to learn.
-Free/open source: it means everybody can use python without purchasing license.
-High level language: when coding in Python one need not worry about low-level details.
-Portable: Python codes are Machine & platform independent.
-Extensible: Python program supports usage of C/ C++ codes.
-Embeddable Language: Python code can be embedded within C/C++ codes & can be used a scripting language.
-Standard Library: Python standard library contains prewritten tools for programming.
-Build-in Data Structure: contains lots of data structure like lists, numbers & dictionaries.

2. Define a method in Python?

A function on object x is a method which is called as x.name(arguments…). Inside the definition of class, methods are defined as functions:
class C:
def meth(self, atg):
return arg*2+self.attribute

3. Define self?

‘self’ is a conventional name of method’s first argument. A method which is defined as meth(self, x ,y ,z) is called as a.meth(x, y, z) for an instance of a class in which definition occurs and  is called as meth(a, x ,y, z).

4. Describe python usage in web programming?

Python is used perfectly for web programming and have many special features to make it easy to use. Web frame works, content management systems, WebServers, CGI scripts, Webclient programming, Webservices, etc are the features supported by python. Python language is used to create various high end applications because of its flexibility.

5. Is there any tool used to find bugs or carrying out static analysis?

Yes. PyChecker is the static analysis tool used in python to find bugs in source code, warns about code style and complexity etc. Pylint is a tool that verifies whether a module satisfies standards of coding and makes it possible to add custom feature and write plug-ins.

6. Rules for local and global variables in python?

In python, the variables referenced inside a function are global. When a variable is assigned new value anywhere in the body of a function then it is assumed as local. In a function, if a variable ever assigned new value then the variable is implicitly local and explicitly it should be declared as global. If all global references require global then you will be using global at anytime. You’d declare as global each reference to built-in function or to component of module which is imported. The usefulness of global declaration in identifying side-effects is defeated by this clutter.

7. How to find methods or attributes of an object?

Built-in dir() function of Python ,on an instance shows the instance variables as well as the methods and class attributes defined by the instance’s class and all its base classes alphabetically. So by any object as argument to dir() we can find all the methods & attributes of the object’s class.

Following code snippet shows dir() at work :
class Employee:
def __init__(self,name,empCode,pay):
self.name=name
self.empCode=empCode
self.pay=pay

print(“dir() listing all the Methods & attributes of class Employee”)
print dir(e)
—————————————————–
Output
dir() listing all the Methods & attributes of class Employee
[ ‘__init__’, ’empCode’, ‘name’, ‘pay’]

8. Is there any equivalent to scanf() or sscanf()?

No.  Usually, the easy way to divide line into whitespace-delimited words for simple input parsing use split() method of string objects. Then, decimal strings are converted to numeric values using float() or int(). An optional “sep” parameter is supported by split() which is useful if something is used in the place of whitespace as separator. For complex input parsing, regular expressions are powerful then sscanf() of C and perfectly suits for the task.

9. Define class?

Class is a specific object type created when class statement is executed. To create instances objects, class objects can be used as templates which represent both code and data specific to datatype. In general, a class is based on one or many classes known as base classes. It inherits methods and attributes of base classes. An object model is now permitted to redefine successively using inheritance. Basic accessor methods are provided by generic Mailbox for subclasses and mailbox like MaildirMailbox, MboxMailbox, OutlookMailbox which handle many specific formats of mailbox.

10. How to prevent blocking in content() method of socket?

Commonly, select module is used to help asynchronous I/O.

11. In python, are there any databases to DB packages?

Yes. Bsddb package is present in Python 2.3 which offers an interface to BerkeleyDatabase library. It Interface to hashes based on disk such as GDBM and DBM are included in standard python.

12. How do we share global variables across modules in Python?

We can create a config file & store the entire global variable to be shared across modules or script in it. By simply importing config, the entire global variable defined it will be available for use in other modules.

For example I want a, b & c to share between modules.
config.py :
a=0
b=0
c=0

module1.py:
import config
config.a = 1
config.b =2
config.c=3
print “ a, b & resp. are : “ , config.a, config.b, config.c
————————————————————————
output of module1.py will be
1 2 3

13.  How can we pass optional or keyword parameters from one function to another in Python?

Gather the arguments using the * and ** specifiers in the function’s parameter list. This gives us positional arguments as a tuple and the keyword arguments as a dictionary. Then we can pass these arguments while calling another function by using * and **:

def fun1(a, *tup, **keywordArg):

keywordArg[‘width’]=’23.3c’

Fun2(a, *tup, **keywordArg)

14.  Explain pickling and unpickling.

Pickle is a standard module which serializes & de-serializes a python object structure. Pickle module accepts any python object converts it into a string representation & dumps it into a file(by using dump() function) which can be used later, process is called pickling. Whereas unpickling is process of retrieving original python object from the stored string representation for use.

15. Explain how python is interpreted.

Python program runs directly from the source code. Each type Python programs are executed code is required. Python converts source code written by the programmer into intermediate language which is again translated it into the native language / machine language that is executed. So Python is an Interpreted language.
16. How is memory managed in python?

Memory management in Python involves a private heap containing all Python objects and data structures. Interpreter takes care of Python heap and that the programmer has no access to it. The allocation of heap space for Python objects is done by Python memory manager. The core API of Python provides some tools for the programmer to code reliable and more robust program. Python also has a build-in garbage collector which recycles all the unused memory. When an object is no longer referenced by the program, the heap space it occupies can be freed. The garbage collector determines objects which are no longer referenced by the sprogram frees the occupied memory and make it available to the heap space. The gc module defines functions to enable /disable                         garbage collector:
gc.enable() -Enables automatic garbage collection.
gc.disable() – Disables automatic garbage collection.
17. Explain indexing and slicing operation in sequences

Different types of sequences in python are strings, Unicode strings, lists, tuples, buffers, and xrange objects. Slicing & indexing operations are salient features of sequence. indexing operation allows to access a particular item in the sequence directly ( similar to the array/list indexing) and the slicing operation allows to retrieve a part of the sequence. The slicing operation is used by specifying the name of the sequence followed by an optional pair of numbers separated by a colon within square brackets say S[startno.:stopno]. The startno in the slicing operation indicates the position from where the slice starts and the stopno indicates where the slice will stop at. If the startno is ommited, Python will start at the beginning of the sequence. If the stopno is ommited, Python will stop at the end of the sequence..

Following code will further explain indexing & slicing operation:
>>> cosmeticList =[‘lipsstick’,’facepowder’,eyeliner’,’blusher’,kajal’]
>>> print “Slicing operation :”,cosmeticList[2:]
Slicing operation :[‘eyeliner’,’blusher’,kajal’]
>>>print “Indexing operation :”,cosmeticList[0]
“Indexing operation :lipsstick
18. Explain how to make Forms in python.

As python is scripting language forms processing is done by Python. We need to import cgi module to access form fields using FieldStorage class.

Every instance of class FieldStorage (for ‘form’) has the following attributes:

form.name: The name of the field, if specified.
form.filename: If an FTP transaction, the client-side filename.
form.value: The value of the field as a string.
form.file: file object from which data can be read.
form.type: The content type, if applicable.
form.type_options: The options of the ‘content-type’ line of the HTTP request, returned as a dictionary.
form.disposition: The field ‘content-disposition’; None if unspecified.
form.disposition_options: The options for ‘content-disposition’.
form.headers: All of the HTTP headers returned as a dictionary.

A code snippet of form handling in python:

import cgi

form = cgi.FieldStorage()
if not (form.has_key(“name”) and form.has_key(“age”)):
print “<H1>Name & Age not Entered</H1>”
print “Fill the Name & Age accurately.”
return
print “<p>name:”, form[“name”].value
print “<p>Age:”, form[“age”].value
29. Describe how to implement Cookies for Web python.

A cookie is an arbitrary string of characters that uniquely identify a session. Each cookie is specific to one Web site and one user.

The Cookie module defines classes for abstracting the concept of cookies. It contains following method to creates cookie

Cookie.SimpleCookie([input])
Cookie.SerialCookie([input]
Cookie.SmartCookie([input])

for instance following code creates a new cookie ck-

import Cookie
ck= Cookie.SimpleCookie ( x )

20.What are uses of lambda?

It used to create small anonymous functions at run time. Like e.g.

def fun1(x):

return x**2

print fun1(2)

it gives you answer 4

the same thing can be done using

sq=lambda x: x**2

print sq(2)

it gives the answer 4

21. When do you use list vs. tuple vs. dictionary vs. set?

List and Tuple are both ordered containers. If you want an ordered container of constant elements use tuple as tuples are immutable objects.

22. When you need ordered container of things, which will be manipulated, use lists.

Dictionary is key, value pair container and hence is not ordered. Use it when you need fast access to elements, not in ordered fashion. Lists are indexed and index of the list cannot be “string” e.g. list [‘myelement’] is not a valid statement in python.

23. Do they know a tuple/list/dict when they see it?

Dictionaries are consisting of pair of keys and values.like {’key’:’value’}.

book={’cprog’:’1024′,’c++’:’4512′}

Keys are unique but values can be same. The main difference between list and tuple is you can change the list but you cannot change the tuple. Tuple can be used as keys in mapping where list is not.

24. Why was the language called as Python?

At the same time he began implementing Python, Guido van Rossum was also reading the published scripts from “Monty Python’s Flying Circus” (a BBC comedy series from the seventies, in the unlikely case you didn’t know). It occurred to him that he needed a name that was short, unique, and slightly mysterious, so he decided to call the language Python.

25. What is used to represent Strings in Python? Is double quotes used for String representation or single quotes used for String representation in Python?

Using Single Quotes (‘)

You can specify strings using single quotes such as ‘Quote me on this’ . All white space i.e. spaces and tabs are preserved as-is.

Using Double Quotes (“)

Strings in double quotes work exactly the same way as strings in single quotes. An example is “What’s your name?”

Using Triple Quotes (”’ or “””)

You can specify multi-line strings using triple quotes. You can use single quotes and double quotes freely within the triple quotes. An example is

”’This is a multi-line string. This is the first line.

This is the second line.

“What’s your name?,” I asked.

He said “Bond, James Bond.”

26. Why cannot lambda forms in Python contain statements?

A lambda statement is used to create new function objects and then return them at runtime that is why lambda forms in Python did not contain statement.

27. Which of the languages does Python resemble in its class syntax?

C++ is the appropriate language that Python resemble in its class syntax.

28. Does Python support strongly for regular expressions? What are the other languages that support strongly for regular expressions?

Yes, python strongly support regular expression. Other languages supporting regular expressions are: Delphi, Java, Java script, .NET, Perl, Php, Posix, python, Ruby, Tcl, Visual Basic, XML schema, VB script, Visual Basic 6.

29. Why is not all memory freed when Python exits?

Objects referenced from the global namespaces of Python modules are not always de-allocated when Python exits. This may happen if there are circular references. There are also certain bits of memory that are allocated by the C library that are impossible to free (e.g. a tool like the one Purify will complain about these). Python is, however, aggressive about cleaning up memory on exit and does try to destroy every single object.

If you want to force Python to delete certain things on de-allocation, you can use the at exit module to register one or more exit functions to handle those deletions.

30. What is a Lambda form? Explain about assert statement?

The lambda form:

Using lambda keyword tiny anonymous functions can be created. It is a very powerful feature of Python which declares a one-line unknown small function on the fly. The lambda is used to create new function objects and then return them at run-time. The general format for lambda form is:
lambda parameter(s): expression using the parameter(s)

For instance k is lambda function-
>>> k= lambda y: y + y
>>> k(30)
60
>>> k(40)
80

The assert statement:

The build-in assert statement of python introduced in version 1.5 is used to assert that something is true. Programmers often place assertions at the beginning of a function to check for valid input, and after function call to check for valid output. Assert statement can be removed after testing of program is over. If assert evaluates to be false, an AssertionError exception is raised. AssertionError exceptions can be handled with the try-except statement.

The general syntax for assert statement is:

assert Expression[, Arguments]

31.  Explain the role of repr function.

Python can convert any value to a string by making use of two functions repr() or str(). The str() function returns representations of values which are human-readable, while repr() generates representations which can be read by the interpreter. repr() returns a machine-readable representation of values, suitable for an exec command. Following code sniipets shows working of repr() & str() :

def fun():
y=2333.3
x=str(y)
z=repr(y)
print ” y :”,y
print “str(y) :”,x
print “repr(y):”,z
fun()
————-
output
y : 2333.3
str(y) : 2333.3
repr(y) : 2333.3000000000002

32.  What is LIST comprehensions features of Python used for?

LIST comprehensions features were introduced in Python version 2.0, it creates a new list based on existing list. It maps a list into another list by applying a function to each of the elements of the existing list. List comprehensions creates lists without using map() , filter() or lambda form.

33.  How do you make a higher order function in Python?

A higher-order function accepts one or more functions as input and returns a new function. Sometimes it is required to use function as data. To make high order function , we need to import functools module The functools.partial() function is used often for high order function.

34. Explain how to copy an object in Python.

There are two ways in which objects can be copied in python. Shallow copy & Deep copy. Shallow copies duplicate as minute as possible whereas Deep copies duplicate everything. If a is object to be copied then

-copy.copy(a) returns a shallow copy of a.
-copy.deepcopy(a) returns a deep copy of a.

35.  How do I convert a string to a number?

Python contains several built-in functions to convert values from one data type to another data type.

The int function takes string and coverts it to an integer.
s = “1234” # s is string
i = int(s) # string converted to int
print i+2
————————
1236
The float function converts strings into float number.
s = “1234.22” # s is string
i = float(s) # string converted to float
print i
————————-
1234.22
36. What is a negative index in python?
Python arrays & list items can be accessed with positive or negative numbers (also known as index). For instance our array/list is of size n, then for positive index 0 is the first index, 1 second, last index will be n-1. For negative index, -n is the first index, -(n-1) second, last negative index will be – 1. A negative index accesses elements from the end of the list counting backwards.
An example to show negative index in python.

>>> import array
>>> a= [1, 2, 3]
>>> print a[-3]
1
>>> print a[-2]
2
>>> print a[-1]
3
37 .How do you make an array in Python?
The array module contains methods for creating arrays of fixed types with homogeneous data types. Arrays are slower then list. Array of characters, integers, floating point numbers can be created using array module. array(typecode[, intializer]) Returns a new array whose items are constrained by typecode, and initialized from the optional initialized value. Where the typecode can be for instance ‘c’ for character value, ‘d’ for double, ‘f’ for float.
38. Explain how to create a multidimensional list.

There are two ways in which Multidimensional list can be created:

By direct initializing the list as shown below to create multidimlist below

>>>multidimlist = [ [227, 122, 223],[222, 321, 192],[21, 122, 444]]
>>>print multidimlist[0]
>>>print multidimlist[1][2]
__________________________
Output
[227, 122, 223]
192

The second approach is to create a list of the desired length first and then fill in each element with a newly created lists demonstrated below :

>>>list=[0]*3
>>>for i in range(3):
>>> list[i]=[0]*2
>>>for i in range (3):
>>> for j in range(2):
>>> list[i][j] = i+j
>>>print list
__________________________
Output
[[0, 1], [1, 2], [2, 3]]
39. Explain how to overload constructors (or methods) in Python.

_init__ () is a first method defined in a class. when an instance of a class is created, python calls __init__() to initialize the attribute of the object.

Following example demonstrate further:

class Employee:

def __init__(self, name, empCode,pay):
self.name=name
self.empCode=empCode
self.pay=pay

e1 = Employee(“Sarah”,99,30000.00)

e2 = Employee(“Asrar”,100,60000.00)
print(“Employee Details:”)

print(” Name:”,e1.name,”Code:”, e1.empCode,”Pay:”, e1.pay)
print(” Name:”,e2.name,”Code:”, e2.empCode,”Pay:”, e2.pay)
—————————————————————
Output

Employee Details:
(‘ Name:’, ‘Sarah’, ‘Code:’, 99, ‘Pay:’, 30000.0)
(‘ Name:’, ‘Asrar’, ‘Code:’, 100, ‘Pay:’, 60000.0)
40. Describe how to send mail from a Python script.

The smtplib module defines an SMTP client session object that can be used to send mail to any Internet machine.

A sample email is demonstrated below.

import smtplib
SERVER = smtplib.SMTP(‘smtp.server.domain’)
FROM = sender@mail.com
TO = [“user@mail.com”] # must be a list
SUBJECT = “Hello!”
TEXT = “This message was sent with Python’s smtplib.”
# Main message
message = “””
From: Sarah Naaz < sender@mail.com >
To: CarreerRide user@mail.com
Subject: SMTP email msg
This is a test email. Acknowledge the email by responding.
“”” % (FROM, “, “.join(TO), SUBJECT, TEXT)
server = smtplib.SMTP(SERVER)
server.sendmail(FROM, TO, message)
server.quit()

41.  Describe how to generate random numbers in Python.

Thee standard module random implements a random number generator.

There are also many other in this module, such as:

uniform(a, b) returns a floating point number in the range [a, b].
randint(a, b)returns a random integer number in the range [a, b].
random()returns a floating point number in the range [0, 1].

Following code snippet show usage of all the three functions of module random:
Note: output of this code will be different evertime it is executed.

import random
i = random.randint(1,99)# i randomly initialized by integer between range 1 & 99
j= random.uniform(1,999)# j randomly initialized by float between range 1 & 999
k= random.random()# k randomly initialized by float between range 0 & 1
print(“i :” ,i)
print(“j :” ,j)
print(“k :” ,k)
__________
Output –
(‘i :’, 64)
(‘j :’, 701.85008797642115)
(‘k :’, 0.18173593240301023)

Output-
(‘i :’, 83)
(‘j :’, 56.817584548210945)
(‘k :’, 0.9946957743038618)

42. What is the optional statement used in a try except statement in Python?

There are two optional clauses used in try except statements:

1. Else clause: It is useful for code that must be executed when the try block does not create any exception

2. Finally clause: It is useful for code that must be executed irrespective of whether an exception is generated or not.

43. What is used to create Unicode string in Python?

Add u before the string

>>> u ‘test’

44. What are the uses of List Comprehensions feature of Python?

List comprehensions help to create and manage lists in a simpler and clearer way than using map(), filter() and lambda. Each list comprehension consists of an expression followed by a clause, then zero or more for or if clauses.

45. Which all are the operating system that Python can run on?

Python can run of every operating system like UNIX/LINUX, Mac, Windows, and others.

46. What is the statement that can be used in Python if a statement is required syntactically but the program requires no action?

Pass is a no-operation/action statement in python

If we want to load a module and if it does not exist, let us not bother, let us try to do other task. The following example demonstrates that.

Try:

Import module1

Except:

Pass

47. What is the Java implementation of Python popularly known as?

Jython

48. What is the method does join() in python belong?

String method

49. Does python support switch or case statement in Python? If not what is the reason for the same?

No. You can use multiple if-else, as there is no need for this.

50. How is the Implementation of Pythons dictionaries done?

Using curly brackets -> {}

E.g.: {‘a’:’123′, ‘b’:’456′}

51. What is the language from which Python has got its features or derived its features?

Most of the object oriented programming languages to name a few are C++, CLISP and Java is the language from which Python has got its features or derived its features.

52. What are the disadvantages of the Python programming language?

One of the disadvantages of the Python programming language is it is not suited for fast and memory intensive tasks.

53. Why is not all memory freed when Python exits?

Objects referenced from the global namespaces of Python modules are not always de-allocated when Python exits. This may happen if there are circular references. There are also certain bits of memory that are allocated by the C library that are impossible to free (e.g. a tool like the one Purify will complain about these). Python is, however, aggressive about cleaning up memory on exit and does try to destroy every single object.

If you want to force Python to delete certain things on de-allocation, you can use the at exit module to register one or more exit functions to handle those deletions.

54. Which of the languages does Python resemble in its class syntax?

C++ is the appropriate language that Python resemble in its class syntax.

55. Who created the Python programming language?

Python programming language was created by Guido van Rossum.
Python Interview Questions & Answers

1. Define python?

Python is simple and easy to learn language compared to other programming languages. Python was introduced to the world in the year 1991 by Guido van Rossum. It is a dynamic object oriented language used for developing software. It supports various programming languages and have a massive library support for many other languages. It is a modern powerful interpreted language with objects, modules, threads, exceptions, and automatic memory managements.

Salient features of Python are
-Simple & Easy: Python is simple language & easy to learn.
-Free/open source: it means everybody can use python without purchasing license.
-High level language: when coding in Python one need not worry about low-level details.
-Portable: Python codes are Machine & platform independent.
-Extensible: Python program supports usage of C/ C++ codes.
-Embeddable Language: Python code can be embedded within C/C++ codes & can be used a scripting language.
-Standard Library: Python standard library contains prewritten tools for programming.
-Build-in Data Structure: contains lots of data structure like lists, numbers & dictionaries.

2. Define a method in Python?

A function on object x is a method which is called as x.name(arguments…). Inside the definition of class, methods are defined as functions:
class C:
def meth(self, atg):
return arg*2+self.attribute

3. Define self?

‘self’ is a conventional name of method’s first argument. A method which is defined as meth(self, x ,y ,z) is called as a.meth(x, y, z) for an instance of a class in which definition occurs and  is called as meth(a, x ,y, z).

4. Describe python usage in web programming?

Python is used perfectly for web programming and have many special features to make it easy to use. Web frame works, content management systems, WebServers, CGI scripts, Webclient programming, Webservices, etc are the features supported by python. Python language is used to create various high end applications because of its flexibility.

5. Is there any tool used to find bugs or carrying out static analysis?

Yes. PyChecker is the static analysis tool used in python to find bugs in source code, warns about code style and complexity etc. Pylint is a tool that verifies whether a module satisfies standards of coding and makes it possible to add custom feature and write plug-ins.

6. Rules for local and global variables in python?

In python, the variables referenced inside a function are global. When a variable is assigned new value anywhere in the body of a function then it is assumed as local. In a function, if a variable ever assigned new value then the variable is implicitly local and explicitly it should be declared as global. If all global references require global then you will be using global at anytime. You’d declare as global each reference to built-in function or to component of module which is imported. The usefulness of global declaration in identifying side-effects is defeated by this clutter.

7. How to find methods or attributes of an object?

Built-in dir() function of Python ,on an instance shows the instance variables as well as the methods and class attributes defined by the instance’s class and all its base classes alphabetically. So by any object as argument to dir() we can find all the methods & attributes of the object’s class.

Following code snippet shows dir() at work :
class Employee:
def __init__(self,name,empCode,pay):
self.name=name
self.empCode=empCode
self.pay=pay

print(“dir() listing all the Methods & attributes of class Employee”)
print dir(e)
—————————————————–
Output
dir() listing all the Methods & attributes of class Employee
[ ‘__init__’, ’empCode’, ‘name’, ‘pay’]

8. Is there any equivalent to scanf() or sscanf()?

No.  Usually, the easy way to divide line into whitespace-delimited words for simple input parsing use split() method of string objects. Then, decimal strings are converted to numeric values using float() or int(). An optional “sep” parameter is supported by split() which is useful if something is used in the place of whitespace as separator. For complex input parsing, regular expressions are powerful then sscanf() of C and perfectly suits for the task.

9. Define class?

Class is a specific object type created when class statement is executed. To create instances objects, class objects can be used as templates which represent both code and data specific to datatype. In general, a class is based on one or many classes known as base classes. It inherits methods and attributes of base classes. An object model is now permitted to redefine successively using inheritance. Basic accessor methods are provided by generic Mailbox for subclasses and mailbox like MaildirMailbox, MboxMailbox, OutlookMailbox which handle many specific formats of mailbox.

10. How to prevent blocking in content() method of socket?

Commonly, select module is used to help asynchronous I/O.

11. In python, are there any databases to DB packages?

Yes. Bsddb package is present in Python 2.3 which offers an interface to BerkeleyDatabase library. It Interface to hashes based on disk such as GDBM and DBM are included in standard python.

12. How do we share global variables across modules in Python?

We can create a config file & store the entire global variable to be shared across modules or script in it. By simply importing config, the entire global variable defined it will be available for use in other modules.

For example I want a, b & c to share between modules.
config.py :
a=0
b=0
c=0

module1.py:
import config
config.a = 1
config.b =2
config.c=3
print “ a, b & resp. are : “ , config.a, config.b, config.c
————————————————————————
output of module1.py will be
1 2 3

13.  How can we pass optional or keyword parameters from one function to another in Python?

Gather the arguments using the * and ** specifiers in the function’s parameter list. This gives us positional arguments as a tuple and the keyword arguments as a dictionary. Then we can pass these arguments while calling another function by using * and **:

def fun1(a, *tup, **keywordArg):

keywordArg[‘width’]=’23.3c’

Fun2(a, *tup, **keywordArg)

14.  Explain pickling and unpickling.

Pickle is a standard module which serializes & de-serializes a python object structure. Pickle module accepts any python object converts it into a string representation & dumps it into a file(by using dump() function) which can be used later, process is called pickling. Whereas unpickling is process of retrieving original python object from the stored string representation for use.

15. Explain how python is interpreted.

Python program runs directly from the source code. Each type Python programs are executed code is required. Python converts source code written by the programmer into intermediate language which is again translated it into the native language / machine language that is executed. So Python is an Interpreted language.
16. How is memory managed in python?

Memory management in Python involves a private heap containing all Python objects and data structures. Interpreter takes care of Python heap and that the programmer has no access to it. The allocation of heap space for Python objects is done by Python memory manager. The core API of Python provides some tools for the programmer to code reliable and more robust program. Python also has a build-in garbage collector which recycles all the unused memory. When an object is no longer referenced by the program, the heap space it occupies can be freed. The garbage collector determines objects which are no longer referenced by the sprogram frees the occupied memory and make it available to the heap space. The gc module defines functions to enable /disable                         garbage collector:
gc.enable() -Enables automatic garbage collection.
gc.disable() – Disables automatic garbage collection.
17. Explain indexing and slicing operation in sequences

Different types of sequences in python are strings, Unicode strings, lists, tuples, buffers, and xrange objects. Slicing & indexing operations are salient features of sequence. indexing operation allows to access a particular item in the sequence directly ( similar to the array/list indexing) and the slicing operation allows to retrieve a part of the sequence. The slicing operation is used by specifying the name of the sequence followed by an optional pair of numbers separated by a colon within square brackets say S[startno.:stopno]. The startno in the slicing operation indicates the position from where the slice starts and the stopno indicates where the slice will stop at. If the startno is ommited, Python will start at the beginning of the sequence. If the stopno is ommited, Python will stop at the end of the sequence..

Following code will further explain indexing & slicing operation:
>>> cosmeticList =[‘lipsstick’,’facepowder’,eyeliner’,’blusher’,kajal’]
>>> print “Slicing operation :”,cosmeticList[2:]
Slicing operation :[‘eyeliner’,’blusher’,kajal’]
>>>print “Indexing operation :”,cosmeticList[0]
“Indexing operation :lipsstick
18. Explain how to make Forms in python.

As python is scripting language forms processing is done by Python. We need to import cgi module to access form fields using FieldStorage class.

Every instance of class FieldStorage (for ‘form’) has the following attributes:

form.name: The name of the field, if specified.
form.filename: If an FTP transaction, the client-side filename.
form.value: The value of the field as a string.
form.file: file object from which data can be read.
form.type: The content type, if applicable.
form.type_options: The options of the ‘content-type’ line of the HTTP request, returned as a dictionary.
form.disposition: The field ‘content-disposition’; None if unspecified.
form.disposition_options: The options for ‘content-disposition’.
form.headers: All of the HTTP headers returned as a dictionary.

A code snippet of form handling in python:

import cgi

form = cgi.FieldStorage()
if not (form.has_key(“name”) and form.has_key(“age”)):
print “<H1>Name & Age not Entered</H1>”
print “Fill the Name & Age accurately.”
return
print “<p>name:”, form[“name”].value
print “<p>Age:”, form[“age”].value
29. Describe how to implement Cookies for Web python.

A cookie is an arbitrary string of characters that uniquely identify a session. Each cookie is specific to one Web site and one user.

The Cookie module defines classes for abstracting the concept of cookies. It contains following method to creates cookie

Cookie.SimpleCookie([input])
Cookie.SerialCookie([input]
Cookie.SmartCookie([input])

for instance following code creates a new cookie ck-

import Cookie
ck= Cookie.SimpleCookie ( x )

20.What are uses of lambda?

It used to create small anonymous functions at run time. Like e.g.

def fun1(x):

return x**2

print fun1(2)

it gives you answer 4

the same thing can be done using

sq=lambda x: x**2

print sq(2)

it gives the answer 4

21. When do you use list vs. tuple vs. dictionary vs. set?

List and Tuple are both ordered containers. If you want an ordered container of constant elements use tuple as tuples are immutable objects.

22. When you need ordered container of things, which will be manipulated, use lists.

Dictionary is key, value pair container and hence is not ordered. Use it when you need fast access to elements, not in ordered fashion. Lists are indexed and index of the list cannot be “string” e.g. list [‘myelement’] is not a valid statement in python.

23. Do they know a tuple/list/dict when they see it?

Dictionaries are consisting of pair of keys and values.like {’key’:’value’}.

book={’cprog’:’1024′,’c++’:’4512′}

Keys are unique but values can be same. The main difference between list and tuple is you can change the list but you cannot change the tuple. Tuple can be used as keys in mapping where list is not.

24. Why was the language called as Python?

At the same time he began implementing Python, Guido van Rossum was also reading the published scripts from “Monty Python’s Flying Circus” (a BBC comedy series from the seventies, in the unlikely case you didn’t know). It occurred to him that he needed a name that was short, unique, and slightly mysterious, so he decided to call the language Python.

25. What is used to represent Strings in Python? Is double quotes used for String representation or single quotes used for String representation in Python?

Using Single Quotes (‘)

You can specify strings using single quotes such as ‘Quote me on this’ . All white space i.e. spaces and tabs are preserved as-is.

Using Double Quotes (“)

Strings in double quotes work exactly the same way as strings in single quotes. An example is “What’s your name?”

Using Triple Quotes (”’ or “””)

You can specify multi-line strings using triple quotes. You can use single quotes and double quotes freely within the triple quotes. An example is

”’This is a multi-line string. This is the first line.

This is the second line.

“What’s your name?,” I asked.

He said “Bond, James Bond.”

26. Why cannot lambda forms in Python contain statements?

A lambda statement is used to create new function objects and then return them at runtime that is why lambda forms in Python did not contain statement.

27. Which of the languages does Python resemble in its class syntax?

C++ is the appropriate language that Python resemble in its class syntax.

28. Does Python support strongly for regular expressions? What are the other languages that support strongly for regular expressions?

Yes, python strongly support regular expression. Other languages supporting regular expressions are: Delphi, Java, Java script, .NET, Perl, Php, Posix, python, Ruby, Tcl, Visual Basic, XML schema, VB script, Visual Basic 6.

29. Why is not all memory freed when Python exits?

Objects referenced from the global namespaces of Python modules are not always de-allocated when Python exits. This may happen if there are circular references. There are also certain bits of memory that are allocated by the C library that are impossible to free (e.g. a tool like the one Purify will complain about these). Python is, however, aggressive about cleaning up memory on exit and does try to destroy every single object.

If you want to force Python to delete certain things on de-allocation, you can use the at exit module to register one or more exit functions to handle those deletions.

30. What is a Lambda form? Explain about assert statement?

The lambda form:

Using lambda keyword tiny anonymous functions can be created. It is a very powerful feature of Python which declares a one-line unknown small function on the fly. The lambda is used to create new function objects and then return them at run-time. The general format for lambda form is:
lambda parameter(s): expression using the parameter(s)

For instance k is lambda function-
>>> k= lambda y: y + y
>>> k(30)
60
>>> k(40)
80

The assert statement:

The build-in assert statement of python introduced in version 1.5 is used to assert that something is true. Programmers often place assertions at the beginning of a function to check for valid input, and after function call to check for valid output. Assert statement can be removed after testing of program is over. If assert evaluates to be false, an AssertionError exception is raised. AssertionError exceptions can be handled with the try-except statement.

The general syntax for assert statement is:

assert Expression[, Arguments]

31.  Explain the role of repr function.

Python can convert any value to a string by making use of two functions repr() or str(). The str() function returns representations of values which are human-readable, while repr() generates representations which can be read by the interpreter. repr() returns a machine-readable representation of values, suitable for an exec command. Following code sniipets shows working of repr() & str() :

def fun():
y=2333.3
x=str(y)
z=repr(y)
print ” y :”,y
print “str(y) :”,x
print “repr(y):”,z
fun()
————-
output
y : 2333.3
str(y) : 2333.3
repr(y) : 2333.3000000000002

32.  What is LIST comprehensions features of Python used for?

LIST comprehensions features were introduced in Python version 2.0, it creates a new list based on existing list. It maps a list into another list by applying a function to each of the elements of the existing list. List comprehensions creates lists without using map() , filter() or lambda form.

33.  How do you make a higher order function in Python?

A higher-order function accepts one or more functions as input and returns a new function. Sometimes it is required to use function as data. To make high order function , we need to import functools module The functools.partial() function is used often for high order function.

34. Explain how to copy an object in Python.

There are two ways in which objects can be copied in python. Shallow copy & Deep copy. Shallow copies duplicate as minute as possible whereas Deep copies duplicate everything. If a is object to be copied then

-copy.copy(a) returns a shallow copy of a.
-copy.deepcopy(a) returns a deep copy of a.

35.  How do I convert a string to a number?

Python contains several built-in functions to convert values from one data type to another data type.

The int function takes string and coverts it to an integer.
s = “1234” # s is string
i = int(s) # string converted to int
print i+2
————————
1236
The float function converts strings into float number.
s = “1234.22” # s is string
i = float(s) # string converted to float
print i
————————-
1234.22
36. What is a negative index in python?
Python arrays & list items can be accessed with positive or negative numbers (also known as index). For instance our array/list is of size n, then for positive index 0 is the first index, 1 second, last index will be n-1. For negative index, -n is the first index, -(n-1) second, last negative index will be – 1. A negative index accesses elements from the end of the list counting backwards.
An example to show negative index in python.

>>> import array
>>> a= [1, 2, 3]
>>> print a[-3]
1
>>> print a[-2]
2
>>> print a[-1]
3
37 .How do you make an array in Python?
The array module contains methods for creating arrays of fixed types with homogeneous data types. Arrays are slower then list. Array of characters, integers, floating point numbers can be created using array module. array(typecode[, intializer]) Returns a new array whose items are constrained by typecode, and initialized from the optional initialized value. Where the typecode can be for instance ‘c’ for character value, ‘d’ for double, ‘f’ for float.
38. Explain how to create a multidimensional list.

There are two ways in which Multidimensional list can be created:

By direct initializing the list as shown below to create multidimlist below

>>>multidimlist = [ [227, 122, 223],[222, 321, 192],[21, 122, 444]]
>>>print multidimlist[0]
>>>print multidimlist[1][2]
__________________________
Output
[227, 122, 223]
192

The second approach is to create a list of the desired length first and then fill in each element with a newly created lists demonstrated below :

>>>list=[0]*3
>>>for i in range(3):
>>> list[i]=[0]*2
>>>for i in range (3):
>>> for j in range(2):
>>> list[i][j] = i+j
>>>print list
__________________________
Output
[[0, 1], [1, 2], [2, 3]]
39. Explain how to overload constructors (or methods) in Python.

_init__ () is a first method defined in a class. when an instance of a class is created, python calls __init__() to initialize the attribute of the object.

Following example demonstrate further:

class Employee:

def __init__(self, name, empCode,pay):
self.name=name
self.empCode=empCode
self.pay=pay

e1 = Employee(“Sarah”,99,30000.00)

e2 = Employee(“Asrar”,100,60000.00)
print(“Employee Details:”)

print(” Name:”,e1.name,”Code:”, e1.empCode,”Pay:”, e1.pay)
print(” Name:”,e2.name,”Code:”, e2.empCode,”Pay:”, e2.pay)
—————————————————————
Output

Employee Details:
(‘ Name:’, ‘Sarah’, ‘Code:’, 99, ‘Pay:’, 30000.0)
(‘ Name:’, ‘Asrar’, ‘Code:’, 100, ‘Pay:’, 60000.0)
40. Describe how to send mail from a Python script.

The smtplib module defines an SMTP client session object that can be used to send mail to any Internet machine.

A sample email is demonstrated below.

import smtplib
SERVER = smtplib.SMTP(‘smtp.server.domain’)
FROM = sender@mail.com
TO = [“user@mail.com”] # must be a list
SUBJECT = “Hello!”
TEXT = “This message was sent with Python’s smtplib.”
# Main message
message = “””
From: Sarah Naaz < sender@mail.com >
To: CarreerRide user@mail.com
Subject: SMTP email msg
This is a test email. Acknowledge the email by responding.
“”” % (FROM, “, “.join(TO), SUBJECT, TEXT)
server = smtplib.SMTP(SERVER)
server.sendmail(FROM, TO, message)
server.quit()

41.  Describe how to generate random numbers in Python.

Thee standard module random implements a random number generator.

There are also many other in this module, such as:

uniform(a, b) returns a floating point number in the range [a, b].
randint(a, b)returns a random integer number in the range [a, b].
random()returns a floating point number in the range [0, 1].

Following code snippet show usage of all the three functions of module random:
Note: output of this code will be different evertime it is executed.

import random
i = random.randint(1,99)# i randomly initialized by integer between range 1 & 99
j= random.uniform(1,999)# j randomly initialized by float between range 1 & 999
k= random.random()# k randomly initialized by float between range 0 & 1
print(“i :” ,i)
print(“j :” ,j)
print(“k :” ,k)
__________
Output –
(‘i :’, 64)
(‘j :’, 701.85008797642115)
(‘k :’, 0.18173593240301023)

Output-
(‘i :’, 83)
(‘j :’, 56.817584548210945)
(‘k :’, 0.9946957743038618)

42. What is the optional statement used in a try except statement in Python?

There are two optional clauses used in try except statements:

1. Else clause: It is useful for code that must be executed when the try block does not create any exception

2. Finally clause: It is useful for code that must be executed irrespective of whether an exception is generated or not.

43. What is used to create Unicode string in Python?

Add u before the string

>>> u ‘test’

44. What are the uses of List Comprehensions feature of Python?

List comprehensions help to create and manage lists in a simpler and clearer way than using map(), filter() and lambda. Each list comprehension consists of an expression followed by a clause, then zero or more for or if clauses.

45. Which all are the operating system that Python can run on?

Python can run of every operating system like UNIX/LINUX, Mac, Windows, and others.

46. What is the statement that can be used in Python if a statement is required syntactically but the program requires no action?

Pass is a no-operation/action statement in python

If we want to load a module and if it does not exist, let us not bother, let us try to do other task. The following example demonstrates that.

Try:

Import module1

Except:

Pass

47. What is the Java implementation of Python popularly known as?

Jython

48. What is the method does join() in python belong?

String method

49. Does python support switch or case statement in Python? If not what is the reason for the same?

No. You can use multiple if-else, as there is no need for this.

50. How is the Implementation of Pythons dictionaries done?

Using curly brackets -> {}

E.g.: {‘a’:’123′, ‘b’:’456′}

51. What is the language from which Python has got its features or derived its features?

Most of the object oriented programming languages to name a few are C++, CLISP and Java is the language from which Python has got its features or derived its features.

52. What are the disadvantages of the Python programming language?

One of the disadvantages of the Python programming language is it is not suited for fast and memory intensive tasks.

53. Why is not all memory freed when Python exits?

Objects referenced from the global namespaces of Python modules are not always de-allocated when Python exits. This may happen if there are circular references. There are also certain bits of memory that are allocated by the C library that are impossible to free (e.g. a tool like the one Purify will complain about these). Python is, however, aggressive about cleaning up memory on exit and does try to destroy every single object.

If you want to force Python to delete certain things on de-allocation, you can use the at exit module to register one or more exit functions to handle those deletions.

54. Which of the languages does Python resemble in its class syntax?

C++ is the appropriate language that Python resemble in its class syntax.

55. Who created the Python programming language?

Python programming language was created by Guido van Rossum.