Tuesday 12 June 2012

QTP Expert Questions and Answer

Question: Which features of QTP would like to see changed, dropped or included in the next versions of QTP?
Rajesh U:
  • Changed: The Step Generator. It does a wonderful job of creating the correct syntax for generating a line of code. However the interface requires too many mouse clicks.
  • Included: A common startup script generation interface. It’s half there right now, but divided up into three areas, without much documentation on how to effectively implement them. Test Design Studio has wonderful complimentary startup script templates for just this reason.
  • Dropped: Virtual objects.
Question: What is the toughest QTP challenge that you have faced?
Rajesh U: The biggest challenge in any test automation project is getting and maintaining "Buy in". You may find that developers who are unfamiliar with QTP liken it to a "Toy" as compared to their "Tools". If you find something subtle occuring in their application, they are more likely to point to your automation tool as the culprit. If that had been true, I would not have gotten much farther in my career beyond my initial WinRunner proof of concept. Then you have the fear of your manual tester co-workers who think you Rajesh U automate them out of a job. Once they realize test automation does have it’s limits, and works better to compliment their capabilities, they often embrace it. Particularly when it replaces some of the tedious work no one like to do. Lastly, you need to maintain the Buy-In of Management. That is only accomplished by demonstrating a Return on Investment from a history of metrics.
Question: Let’s say you have to hire someone for a junior and another for a senior role in QTP. What questions and answers Rajesh U set apart a senior position from a junior one?
Rajesh U: Unfortunately, I can’t share specifics of the questions and expected answers that separate the best from the rest. This is a very popular forum and I would rather not risk having my knock off questions memorized.
But in general, in a Junior role, I look for someone with practical experience who can demonstrate an understanding of basic programming skills in the tool of choice. They should be familiar with commonly held best practices, and can describe how they benefit their code design, as well as a test automation project.
In a Senior role, I look for someone who can describe what Rajesh U cause an automation project to fail. I know, it’s the last thing you would expect to talk about in an interview, right? They should be able identify procedures they follow to avoid these pitfalls. I also look for creative use of the tools that extend outside the scope of testing. They should know regular expressions, give solid examples of their use.
Question: Which feature of QTP was your most recent discovery?
Rajesh U: System resource tracking with QTP 10.0. My first project benefited our Development by quickly identifying memory leaks in the application, almost exclusivly. It bought me a lot of "street cred" with them. But I had to roll my own functions to pull it off at the time. Now it’s built in.
Question: What according to you are the key elements of a robust QTP automation framework?
Rajesh U:
  1. Simple abstraction that hides the complexity of the framework and takes advantage of reusable code.
  2. Scalability from parameterized values to allow larger sets of test data to be run unattended.
  3. Recover from instability, allowing tests to execute unattended even when objects are not found and msgbox debugging statements remain in the code.
Question: How significant is QTP certification to you when you’re screening candidates for a QTP tester position?
Rajesh U: I am a certified HP Instructor and hold an HP ASE QC 9.2 (QTP 9.2) certification. I have held several Mercury certifications since 2002 including CPS and CPC. Although the delivery of certification exams has improved over the years from the initial two-month take home exam, the depth of the exam has diminished slightly. I had to discover how to self-terminate the WinRunner application on my initial exam, which Mercury publicly stated was not possible in their Knowledge Base articles. However, having a certification should not be equated with getting a pass in the interview screening process. In fact, certified individuals should be expected to perform better during an interview. The certification can allow you to command a higher bill rate or salary. But in the end, you need to back it up with experience to land the job.
Question: What would you recommend as the best way to learn QTP?
Rajesh U:
  1. Start by trying to automate something fun. Automation is code development and code development is not for everyone. It’s like learning to effectivly perform a French Drop to make a coin appear to vanish from your palm, or eating an entire meal, rice included, with chopsticks. It takes practice, practice, practice.
  2. Get a great mentor. Mine were Linda Hayes, Jaime Mitchel and Dr. Magdy Hanna.
  3. Hang with the experts. SoftwareInquisition.com, AdvancedQTP.com, TDForums.com to name a few.
Question: If you could introduce one new feature in the next version of QTP, what would it be?
Rajesh U: Only one new feature?  There are too many to choose from.  The one feature that would have the biggest impact on my day-to-day testing would be a run-time license.  With HP’s current license scheme, we can’t afford a lot of licenses to run our tests.  It takes several hours to run our entire suite of regression tests and uses up all of our QTP licenses.  If HP offered a run-time license — one that only allowed executing tests, not editing, writing or debugging — for a price in the sub $1,000 range, we could afford to add several new machines that are dedicated to running regressions tests.  That would give us faster test execution time and allow us to continue writing new tests while the regression tests run.
Question: What is the toughest QTP challenge that you have faced?
Rajesh U: My toughest QTP challenge is the same challenge we all face continually.  How do we create maintainable tests that produce meaningful and reliable results from one software release to the next?  Like most people here, my first QTP test was a record-and-playback script that errored out the second time it ran. That started the challenge to create better tests.  I’ve made pretty good progress on this challenge, but there is still a lot left to do.

Question: Let’s say you are interviewing someone for a position of QTP test lead, and you can only ask 5 questions  to gauge the candidate’s knowledge. What are the 5 questions you would ask?
Rajesh U: We are talking about a candidate for a test lead position.  I am looking for somebody whose knowledge goes beyond QTP.  I want somebody who understands the fundamentals of software testing and can express an informed opinion of how test automation should be practiced.
  1. Many software developers follow the one-assert-per-test rule in their unit tests in order to keep their tests maintainable.  Do you think functional testing should follow a similar rule?  What would the benefits and drawbacks be?
  2. We frequently get requests from our manual testers to automate some of their manual tests.  What types of tests should be left to manual testers and what is best handled by automation?
  3. Tell me what programming languages you’ve used and how they compare with QTP and vbscript.
  4. What are the benefits and drawbacks of descriptive programming vs a shared object repository?
  5. If you were told to test whether every three word combination from a list of five words returns at least 1,000 results when googled, how would you approach that?

Question: Which feature of QTP was your most recent discovery?
Rajesh U: Web Extensibility is my favorite new feature in QTP.  Using a custom Web Extensibility Add-In we wrote for our AUT, we have seen a huge performance gain.  It also makes our vbscript code a lot cleaner. As for my most recent discover, that is probably the hidden init method which I blogged about on SoftwareInquisition.  This is such a handy feature that I can’t believe I went all these years without it.

Question: How significant is QTP certification to you when you’re screening candidates for a QTP tester position?
Rajesh U: I don’t know anything about the QTP certification, so I can’t talk about it directly.  I can give you some of my thoughts on certifications in general.
During my previous career in IT, I got two certifications: MCSE and CCNA.  The MCSE I got after working two years as a Windows SysAdmin.  I bought and read the books at home and took one test per week for six weeks.  Even though I was already an experienced SysAdmin, I learned a lot during the certification process, and I used that new knowledge in my job.
The CCNA was a different experience entirely.  I worked at Cisco Systems at the time, and they offered me the opportunity to go to a week-long CCNA training session that ended with taking the certification exam.  I had little experience with routers, I just knew enough to enable an interface and change an ip address.  During that week I learned enough to pass the exam, and after the test I forgot most of what I had learned.  Aside from having a certification to add to my resume, the whole experience amounted to nothing.
Given my mixed experience with certifications, I tend to view the skeptically.  If I see QTP certification on a resume with no other QTP experience, I give it no thought at all.  If I see it on a resume with other QTP experience, I Rajesh U be inclined to ask for an interview.  On the other hand, the experience by itself would be enough to get an interview.

Question: Please give a message for beginners in QTP.
Rajesh U: Don’t stay a QTP beginner for too long.  Learn everything you can about descriptive programming.  Learn the pitfalls of checkpoints and record-and-playback testing early.  Avoid repeating the mistakes you see people discussing on the various testing forums.  If you think there is a better way to write a test, then try it.  That is how you learn what works and what doesn’t.
Question: If you could introduce one new feature in the next version of QTP, what would it be?
Rajesh U: There are lots of feature I can think of which are currently missing in QTP. But the most important one in my opinion is to be able debug libraries loaded at run-time. Currently lot of time gets wasted in debugging scripts and complex frameworks are all based on loading stuff at run-time.
Question: What is the toughest QTP challenge that you have faced?
Rajesh U: There have been lots of challenges that I have faced in QTP. When I started using QTP the community was not huge and there was a lot of stuff to be learned and taught. Every day, every query, every project has brought new challenges, new solutions and new learning for me. I doubt I can mark any one of them as the toughest one.
Question: Let’s say you are interviewing someone for a position of QTP test lead, and you can only ask 5 questions  to gauge the candidate’s knowledge. What are the 5 questions you would ask?
Rajesh U: 5 questions are bit too less for me to judge a candidate. But I would mostly split my questions in different categories. Here are the questions that I would mostly ask and the objective behind my questions
1. From which version of QTP did you start using the tool? Which is the latest one? What new features were introduced between the successive versions?
This question would help me judge how closely a candidate follows the new upgrades and their analyses on the same. Though it is pretty much easy for any non-deserving candidate to just remember and answer the query, but we can grill down on the features discussed
2. How does QTP identify objects? What is Object Repository (OR)? Types of Object Repository? How to load OR at run-time? Why, When & How of Descriptive Programming (DP)? You prefer DP or OR, why? What all add-ins have you worked with? How to work with custom controls? What are libraries? How to load the libraries at run-time? How to debug code in QTP?
This question would help me judge how well the candidate understands working of QTP. It is not only important for a person to know the practical stuff but also to know the theory behind that. There are many QTP programmers who know how to do things but don’t know why it is done that way
3. What projects have you worked on? Have you already lead a Team on Automation? Challenges faced in the project? What solutions were implemented? What solutions could not be implemented? How many times you have contacted HP Support and for what kind of issues? Do you refer to any blog or forum regularly? Have you ever helped others on any forum? Presenting a new application to the candidate and asking on what would be the path forward to propose and implement Automation of the application
Since the candidate is applying for a Test Lead role it is important for us to know whether he can do projects in an approached manner or not. Also presenting a new hypothetical application case which can present problems like Test Data dynamics, Application versioning, Parallel release etc… Rajesh U help judge his/her solution making capabilities.
4. What is difference between VBScript and QTP? Can we run QTP code in VBScript? Can we run VBScript code in QTP? Can we use any other scripting language in QTP? Which programming or scripting language other than VBScript would you have preferred for QTP coding and why? A practical problem on VBscript which tests candidates knowledge of various methods of VBScript
This question helps judge understanding of the candidate on VBScript. It is utmost important for one to understand difference between Plain VBScript and QTP, being able to do so makes it easier to resolve issues while doing Automation
5. You think you have made it?
It is very important for one to be able to self-access himself/herself. Everyone in this world makes mistakes, but if one can catch and rectify it early that always helps. Nobody is perfect in this world, but only those who know what they lack and where they need to improve come out to be true champions.
Question: Which feature of QTP was your most recent discovery?
Rajesh U: The feature that I found out recently was to be able to change variables value from the Watch tab itself. I used to do this from the command tab earlier.

Question: How significant is QTP certification to you when you’re screening candidates for a QTP tester position?
Rajesh U: I am not QTP certified and I never plan to be one. It does not matter to me if the candidate I am interviewing is certified or not.
Question: Please give a message for beginners in QTP.
Rajesh U: Read & learn & implement as much as you can. No one becomes an expert in a day. It takes years of hard work to be the best in your field. Here is how I did it – When I started learning QTP I didn’t had the tool with me, I just used to read the help file at home and before I started working on the tool I knew every single feature of the same. The usual approach of learning is to start playing with the tool and learn while solving issues, but having knowledge of various features available on hand before starting with tool helps a lot. With over 11100+ replies on SQAForum I have only asked 10 questions on the forum. If you have any question, first search for the answer yourself before asking anyone. I spend days of effort to search solutions to my queries and queries other people ask. That to me has been the key to success.
Question: If you could introduce one new feature in the next version of QTP, what would it be?
Rajesh U: The ability to write tests in VB.Net
Question: What is the toughest QTP challenge that you have faced?
Rajesh U: Automating Geo-tools and maps. Several of my projects have ESRI map controls on them; and building smart Geo automation has really took all of my creativity.
Question: Let’s say you are interviewing someone for a position of QTP test lead, and you can only ask 5 questions  to gauge the candidate’s knowledge. What are the 5 questions you would ask?
Rajesh U: These would’ve been the questions (assuming I’m targeting a highly professional position):
Q1. You don’t know how many WebEdits are in a page, but you have to fill them all up. How can you do that?
A1. Using Descriptive Programming with .ChildObjects to get the objects, then looping through them
Q2. How would you automate a non-standard web / java / .net control?
A2. Use object exploration techniques in the Runtime-Object level
Q3. You are given a sealed script, to which you’re supposed to add the following functionality – whenever a combobox is inputed, a report should be made to the log. How would you achieve that?
A3. Through RegisterUserFunc – overrun the combobox’s default Select method.
Q4. Build a class wrapper for some application screen / page.
A4. I would see how you approach the problem – Do you put enough emphasis on robustness, common design principles, and do you know how to work with classes.
Q5. I would ask you to analyze a piece of code, and tell me what it does.
A5. This is to see how fast can you learn new, unfamiliar code.
Question: Which feature of QTP was your most recent discovery?
Rajesh U: I only recently worked out a way to write QTP tests in Visual Studio .Net. It took some hard work and ugly workarounds, but it works!
Question: How significant is QTP certification to you when you’re screening candidates for a QTP tester position?
Rajesh U: Absolutely no significant whatsoever. I would much rather hire someone with real programming experience / course (or even just a gift for technology and logical thinking), than HP’s poor excuse for a certification.
Question: Please give a message for beginners in QTP.
Rajesh U: QTP is just a tool. Invest your time in learning about programming, design patterns and logical thinking, and you’ll become an extremely competent QTP engineer. Also – Don’t let the hard work discourage you. Even the world’s top QTP experts were once in your shoes – motivation, determination and hard work Rajesh U always get you through – just don’t give up mid-way!

Wednesday 6 June 2012

Manual Testing Interview Question and Answer

Questions : 1 Do you know what the mean of CMM and TMM?
Answers : 1
Capability maturity model and testing maturity model 
Questions : 2 How many Effort Estimation methods available in market for Testing?
 Answers : 2
A Effort estimation consists in predict how many hours of work and how many workers are needed to develop a project. The effort invested in a software project is probably one of the most important and most analysed variables in recent years in the process of project management. The determination of the value of this variable when initiating software projects allows us to plan adequately any forthcoming activities. As far as estimation and prediction is concerned there is still a number of unsolved problems and errors. To obtain good results it is essential to take into consideration any previous projects. Estimating the effort with a high grade of reliability is a problem which has not yet been solved and even the project manager has to deal with it since the beginning.
Questions : 3 What are the different Methodologies in Agile Development Model?
Answers : 3
There are currently seven different Agile methodologies that I am aware of:
1) Extreme Programming (XP)
2) Scrum
3) Lean Software Development
4) Feature-Driven Development
5) Agile Unified Process
6) Crystal
7) Dynamic Systems Development Model (DSDM)

Questions : 4 How the 2 wings and body of the Butterfly Model of Test Development is Represented?
Answers : 4
The Butterfly Model focuses on verification and validation of software products and is therefore a good fit for software testing tasks that are incorporated into the V-model of software development. This model provides a graphic picture of the complexity of test tasks using the outline of a butterfly. The areas occupied by the wings and body are approximately related to the level of effort afforded to each of the activities included in the model. In addition to this the reference of the butterfly stems from Chaos theory which states that a small disturbance in part of a system can have huge consequences in some other part of the system. The development of a software system has certain similarities. Small modifications or errors in code may result in significant degradations in an application's performance. The model establishes three general areas of test activities that are illustrated by the butterfly's graphic outline. They are:
Test Analysis (butterfly’s left wing)
Test Design (right wing)
Test Execution (butterfly’s body)
.
Questions : 5 What does the mclabe cyclomatic complexity of a program determine?
Answers : 5
Cyclomatic complexity is likely the most widely used complexity metric in software engineering. It describes the complexity of a procedure by measuring the linearly independent paths through its source code. . 
Questions : 6 How do you obtain the expected results for testing a search operation?
Answers : 6
1) Corresponding Search Window should be opened & hold corresponding field names in that.
2) Search Operation should be shown correct result while valid data.
3) Search Operation should be shown warning message while enter invalid data.
4) Search Operation should be shown output for all the condition in valid inputs. 

Questions : 7 Describe to the basic elements you put in a defect report? Answers : 7
1)project name
2)module name
3)defect detected on
4)defect detected by
5)defect id
6)defect name
7)snapshort of the defect(if the defect is in the non reproducible environment)
8)priority,severity,status
9)defect resolved by
10)defect resolved on. 

Questions : 8 What is Impact analysis? As a tester how will you do impact analysis in your project?
Answers : 8
Suppose after completion of an application or module, if another module is to be added, then we need to test the new module as well as the impacted area which is affected by adding a new module.
Impact Analysis will be done to find the impact area of the application by adding a new module. Generally team lead will take the initiate for this.
Team lead will send a mail to client asking for the impact area (if developer is new to domain), also send a mail to development team and testing team asking for the impacted area. After getting the response of all three, team lead will do the consolidated report of all the mails. This consolidated mail will be given to the Test Engineer saying this is the Impact Analysis Report and these are the impact areas. 

 Questions : 9 What is the main Goal of Defect Prevention meeting?
Answers : 9
Closed defects can be reopened due to some of the following reason:
1)Fix given for some other issue may reopen closed defects.
2)Deployment not properly done at the time of fixing new defects.
3)Build issue.
And hence to prevent such defects to reopen, regression testing should be performed on the main flow, scenarios before each testing phase is completed.
And also if time permits quick sanity testing could be carried out to ensure that there is no impact to the application or system before moving on to the next testing phase. 

 Questions : 10 What are the factors affecting a manual testing project and what are the ways to overcome it?
Answers : 10
1. Go for Manual Testing in the following cases: Unstable Software. To explore New Software. No Automation suite available. Adhoc testing (unplanned test cases). Not critical project & only one time testing & the effort required is less than the effort required for automation.
2. Go for Automation in the following cases: Stable Software. Any application with a High degree of risk associated with the failure is a good candidate for test automation. (Aircrafts, Patient monitor,) Testing needs to be repeated.
3. Advantages of Automation: Accelerate releases (reduces regression effort) With repeatable tests ensure consistency across multiple supported platforms Greater Application Coverage. Can test more often & more completely Convenient test reports for analysis. 

 Questions : 11 How do you verify the test results and How do you proceed when you do not get the expected results?
Answers : 11
We need to check whether Expected Result coresponding to Test case mentioned in Test Case Document is same as Actual Result.If they are same then Test Case passes and if they are not same then we have to see what is different and why it different. After narrowing down we need to raise a defect and map that defect to a Test case. 
Questions : 12 In real time how you do the Soak Testing?
Answers : 12
Soak Testing: Running a system at high load for a prolonged period of time. For example, running several times more transactions in an entire day (or night) than would be expected in a busy day, to identify and performance problems that appear.
Questions : 13 What do you mean by Trend Analysis?
Answers : 13
In project management trend analysis is a mathematical technique that uses historical results to predict future outcome. This is achieved by tracking variances in cost and schedule performance. In this context it is a project management quality control tool. 
Questions : 14 How you will write test cases for integration testing? Explain me with an example ?
Answers : 14
Integration testing is actually composed of different types of tests, but its objective is to ensure that the interaction of two or more components produces results taht satisfy functional testing requirements. For Example: Let A and B be two components in which A calls B.    Let Ta be the component level tests of A    Let Tb be the component level tests of B    Tab The tests in A's suite that cause A to call B.    Tbsa The tests in B's suite for which it is possible to sensitize A            -- the inputs are to A, not B.    Tbsa + Tab == the integration test suite (+ = union). 
Questions : 15 What is the difference between interoperability and compatibility testing with some examples?
Answers : 15
Interoperatability:-To check if the software can co exist with other supporting softwares in the system

Compatibility:-To check if the software runs on different types of operating systems according to customer requirements. 

 Questions : 16 What is 'fish pond analysis' w.r.t software testing?
Answers : 16
This is one of the SDLC process generally we are following. Its like in fish model thats why it got the name like that. 
 Questions : 17 What does a manual tester need to become proficient with DB Testing?
Answers : 17
Need knowledge of SQL query 
Questions : 18 What is difference between Validation and Verification?
Answers : 18
Varification: it is the process of confirming that s/w "meets its specification".It involves reviews and meetings to evaluate documents,plans,code,requirement and specification.This can be done with checklist,issues lists amd walkthroughs.
It is the examination of the process and checks r we building the product right
Validation: It is the process of confirming that it "meets the user's requirements".Validation typically involves actual testing and take place after varification are 

Questions : 19 What is difference between Known regression Testing and Unknown Regression testing?
Answers : 19
Regression testing means it is the type of testing in which one will conduct testing on an already tested functionality again and again. Regression testing will be conducted in two situations.
1. If the test engineer find any defect on one functionality then after the rectification of that defect from the development department again testing on that defected functionality and retesting the related functionalities of that defected functionality.
2. If the new features are added to that application testing on that new feature functionality and also the related functionality of that new features to be tested. 

Questions : 20 What is Quality Matrix in Software Testing?
Answers : 20
By word quality we may be more generalized towards our target. but being a quality contious a "quality matix" should have; 1. logical parameterization of our parameters i.e. first we should confirm that is parameter "a" has logical connection with parameter "b"
2. Matrix should be result oriented. we can extract/deduce some logical results from each matrix
3. Every matrix should be complete in its domain it should not further dependant on other parameters other than selected
4. Every matrix should work in boundries of your requirements 

Questions : 21 Which testing method is used to check the software in abnormal condition?
Answers : 21
Which testing method is used to check the software in abnormal condition?
1) Stress testing
2) Security testing
3) Recovery testing
4) Beta testing


Q. What is difference between Performance Testing, Load Testing and Stress Testing?
1) Performance Testing:
Performance testing is the testing, which is performed, to ascertain how the components of a system are performing, given a particular situation. Resource usage, scalability and reliability of the product are also validated under this testing. This testing is the subset of performance engineering, which is focused on addressing performance issues in the design and architecture of software product.
Performance Testing Goal:
The primary goal of performance testing includes establishing the benchmark behaviour of the system. There are a number of industry-defined benchmarks, which should be met during performance testing.
Performance testing does not aim to find defects in the application, it address a little more critical task of testing the benchmark and standard set for the application. Accuracy and close monitoring of the performance and results of the test is the primary characteristic of performance testing.
Example:
For instance, you can test the application network performance on Connection Speed vs. Latency chart. Latency is the time difference between the data to reach from source to destination. Thus, a 70kb page would take not more than 15 seconds to load for a worst connection of 28.8kbps modem (latency=1000 milliseconds), while the page of same size would appear within 5 seconds, for the average connection of 256kbps DSL (latency=100 milliseconds). 1.5mbps T1 connection (latency=50 milliseconds) would have the performance benchmark set within 1 second to achieve this target.
For example, the time difference between the generation of request and acknowledgement of response should be in the range of x ms (milliseconds) and y ms, where x and y are standard digits. A successful performance testing should project most of the performance issues, which could be related to database, network, software, hardware etc…
2) Load Testing:
Load testing is meant to test the system by constantly and steadily increasing the load on the system till the time it reaches the threshold limit. It is the simplest form of testing which employs the use of automation tools such as LoadRunner or any other good tools, which are available. Load testing is also famous by the names like volume testing and endurance testing.
The sole purpose of load testing is to assign the system the largest job it could possible handle to test the endurance and monitoring the results. An interesting fact is that sometimes the system is fed with empty task to determine the behaviour of system in zero-load situation.
Load Testing Goal:
The goals of load testing are to expose the defects in application related to buffer overflow, memory leaks and mismanagement of memory. Another target of load testing is to determine the upper limit of all the components of application like database, hardware and network etc… so that it could manage the anticipated load in future. The issues that would eventually come out as the result of load testing may include load balancing problems, bandwidth issues, capacity of the existing system etc…
Example:
For example, to check the email functionality of an application, it could be flooded with 1000 users at a time. Now, 1000 users can fire the email transactions (read, send, delete, forward, reply) in many different ways. If we take one transaction per user per hour, then it would be 1000 transactions per hour. By simulating 10 transactions/user, we could load test the email server by occupying it with 10000 transactions/hour.

3) Stress testing
Under stress testing, various activities to overload the existing resources with excess jobs are carried out in an attempt to break the system down. Negative testing, which includes removal of the components from the system is also done as a part of stress testing. Also known as fatigue testing, this testing should capture the stability of the application by testing it beyond its bandwidth capacity.
The purpose behind stress testing is to ascertain the failure of system and to monitor how the system recovers back gracefully. The challenge here is to set up a controlled environment before launching the test so that you could precisely capture the behaviour of system repeatedly, under the most unpredictable scenarios.
Stress Testing Goal:
The goal of the stress testing is to analyse post-crash reports to define the behaviour of application after failure. The biggest issue is to ensure that the system does not compromise with the security of sensitive data after the failure. In a successful stress testing, the system will come back to normality along with all its components, after even the most terrible break down.
Example:
As an example, a word processor like Writer1.1.0 by OpenOffice.org is utilized in development of letters, presentations, spread sheets etc… Purpose of our stress testing is to load it with the excess of characters.
To do this, we will repeatedly paste a line of data, till it reaches its threshold limit of handling large volume of text. As soon as the character size reaches 65,535 characters, it would simply refuse to accept more data. The result of stress testing on Writer 1.1.0 produces the result that, it does not crash under the stress and that it handle the situation gracefully, which make sure that application is working correctly even under rigorous stress conditions.


SQL Interview Question and Answers

SQL Interview Question and Answers
1.
Define SQL?

Structured query language is the standard command set used to communicate with the relational database management system.

2.
Define Dbms?

A Database Management system consists of a collection of interrelated data and set of programs to access that data.

3.
What is the purpose of Database systems?

A Database Management system provides a secure and survivable medium for the storage and retrieval of data.In the real world, the data is shared among several users and is persistent.

4.
State the different between Security and Integrity?

Security is a protection from malicious attempts to steal or modify data.

Integrity constraints guard against accidental damage to the database, by ensuribg that authorized changes to the database do not result in a loss of data consistency.

5.
Define Normalisation?

Normalisation is an essential part of database design. A good understanding of the semantic of data helps the designer to built efficient design using the concept of normalization.

6.
What are the purpose of Normalisation?

  • Minimize redundancy in data.
  • Remove insert, delete and update anamoly during the database activities.
  • Reduce the need to reorganize data it is modified or enhanced.

7.
Define Primary Key?

  • The primary key is the columns used to uniquely identify each row of a table.
  • A table can have only one primary key.
  • No primary key value can appear in more than one row in the table.

8.
Define Unique Key?

Unique key is a one or more column that must be unique for each row of the table.
It is similar to primary key. Primary key column will not accept a null. Whereas the unique key column will accept a null values.

9.
Define Foreign Key?

A foreign Key is a combination of columns with value is based on the primary key values from another table. A foreign key constraint also known as Referential Integrity Constraint.

10.
Define View?

  • A View is a database object that is a logical representation of a table.
  • It is derived from a table but has no longer of its own and often may be used in the same manner as a table.
  • A view is a virtual table that has columns similar to a table.
  • A view does not represent any physical data.

11.
Compare and contrast TRUNCATE and DELETE for a table?

Both the truncate and delete command have the desired outcome of getting rid of all the rows in a table. The difference between the two is that the truncate command is a DDL operation and just moves the high water mark and produces a now rollback. The delete command, on the other hand, is a DML operation, which will produce a rollback and thus take longer to complete.

12.
What is cursors?

Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time.

13.
Define SubQuery?

  • Nesting of Queries one within the other is called as a Subquery.
  • A table can have only one primary key.

14.
What are the different types of subquery?

  • Single row subquery
  • Multiple row subquery
  • Correlated row subquery

15.
What are the different types of replication?

The SQL Server 2000-supported replication types are as follows
  • Transactional
  • Snapshot
  • Merge

16.
What is User Defined Functions?

User-Defined Functions allow to define its own T-SQL functions that can accept 0 or more parameters and return a single scalar data value or a table data type.

17.
Define Self Join?

Self join means joining one table with itself.
The self join can be viewed as a join of two copies of the same table.

18.
Define Sequence?

A Sequence is a database object that can be used to provide very quick generation of unique numbers.

19.
Define Joins?

A Join combines columns and data from two or more tables (and in rare cases, of one table with itself).

20.
What are the types of Joins?

  • Equi joins
  • Cartesian Joins
  • Outer Joins
  • Self Joins.

21.
Define Equi Joins?

A Equi Join is a join in which the join comparison operator is an equality. When two tables are joined together using equality or values in one or more columns, they make an Equi Join.

22.
Define Cartesian Join?

Joining two tables without a whereclause produces a Cartesian join which combines every row in one table with every row in another table.

23.
What are three SQL keywords used to change or set someone's permissions?

GRANT, DENY, and REVOKE

24.
What are primary keys and foreign keys?

Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental of all keys and constraints. A table can have only one Primary key.

Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables.

25.
Define data model?

Underlying the structure of the database is called as data model.

26.
What is an Entity?

It is a 'thing' in the real world with an independent existence.

27.
What is BCP? When does it used?

BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination.

28.
Explain the use of the by GROUP BY and the HAVING clause?

The GROUP BY partitions the selected rows on the distinct values of the column on which the group by has been done.
The HAVING selects groups which match the criteria specified.

29.
What is DataWarehousing?

According to Bill Inmon, known as father of Data warehousing. “A Data warehouse is a subject oriented, integrated ,time variant, non volatile collection of data in support of management’s decision making process”.

30.
What are the advantages of Database?

  • Redundancy can be reduced
  • Inconsistence can be avoided
  • The data can be shared
  • Standards can be enforced
  • Security can be enforced
  • Integrity can be maintained
31.
What are the advantage of SQL?

The advantages of SQL are
  • SQL is a high level language that provides a greater degree of abstraction than procedural languages.
  • SQL enables the end users and system personnel to deal with a number of Database management systems where it is available.
  • Application written in SQL can be easily ported across systems.

32.
What is the difference between join and outer join?

Outer joins return all rows from at least one of the tables or views mentioned in the FROM clause, as long as those rows meet any WHERE or HAVING search conditions.

A join combines columns and data from two are more tables.

33.
Define Boyce coded normal form?

A relation is said to be in Boyce coded normal form if it is already in the third normal form and every determine is a candidate key.

34.
What are the transaction properties?

  • Atomicity
  • Consistency
  • Isolation
  • Durability

35.
What is data mining?

Data mining refers to using variety of techniques to identify nuggests of information or decision making knowledge in bodies of data and extracting these in such a way that they can be put in the use in the areas such as decision support, predication, forecasting and estimation.

36.
Compare DBMS versus object oriented DBMS?

DBMS consists of a collection of interrelated data and a set of programs to access that data.
The object oriented DBMS is one of the type of dbms in which information is stored in the form of objects.
37.
What are the types of SQL Commands?

  • Data Definition Language (DDL)
  • Data Manipulation Language (DML)
  • Data Query Language (DQL)
  • Data Control Language (DCL)

38.
What is an attribute?

An entity is represented by a set of attributes.
Attributes are descriptive properties possessed by each member of an entity set.
There are different types of attributes.
  • Simple
  • Composite
  • Single-valued
  • Derived

39.
What are the different types of data models ?

  • Entity relationship model
  • Relational model
  • Hierarchical model
  • Network model
  • Object oriented model
  • Object relational model

40.
What is an active database?

Active database is a database that includes active rules, mostly in the form of ECA rules(Event Condition rules).
Active database systems enhance traditional database functionality with powerful rule processing cabalities, providing a uniform and efficient mechanism for database system applications.

41.
What are ACID properties?


  • Atomicity
  • Consistency
  • Isolation
  • Durability

42.
Define Self Join?

Self join means joining one table with itself.
The self join can be viewed as a join of two copies of the same table.
43.
What is a tuple?

A tuple is an instance of data within a relational database.

44.
What is meant by embedded SQL?

They are SQL statements that are embedded with in application program and are prepared during the program preparation process before the program is executed. After it is prepared, the statement itself does not change(although values of host variables specified within the statement might change).

45.
What is Functional Dependency?

A Functional dependency is denoted by X Y between two sets of attributes X and Y that are subsets of R specifies a constraint on the possible tuple that can form a relation state r of R. The constraint is for any two tuples t1 and t2 in r if t1[X] = t2[X] then they have t1[Y] = t2[Y]. This means the value of X component of a tuple uniquely determines the value of component Y.

46.
What are the different phases of transaction?

The different phases of transaction are
  • Analysis phase
  • Redo Phase
  • Undo phase

47.
What the difference between UNION and UNIONALL?

Union will remove the duplicate rows from the result set while Union all does’nt.

48.
What is diffrence between Co-related sub query and nested sub query?

Correlated subquery runs once for each row selected by the outer query. It contains a reference to a value from the row selected by the outer query.

Nested subquery runs only once for the entire nesting (outer) query. It does not contain any reference to the outer query row.
49.
What is the use of DBCC commands?

DBCC stands for database consistency checker. We use these commands to check the consistency of the databases, i.e., maintenance, validation task and status checks.

50.
What is a Linked Server?

Linked Servers is a concept in SQL Server by which we can add other SQL Server to a Group and query both the SQL Server dbs using T-SQL Statements. With a linked server, you can create very clean, easy to follow, SQL statements that allow remote data to be retrieved, joined and combined with local data.

51.
What is Collation?

Collation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and character width.

52.
What are different type of Collation Sensitivity?

The different phases of transaction are
  • Case sensitivity
  • Accent sensitivity
  • Kana Sensitivity
  • Width sensitivity

53.
What is the difference between a primary key and a unique key?

Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn’t allow NULLs, but unique key allows one NULL only.

54.
What is the difference between Function and Stored Procedure?

  • UDF can be used in the SQL statements anywhere in the WHERE / HAVING / SELECT section where as Stored procedures cannot be.
  • UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
  • Inline UDF’s can be though of as views that take parameters and can be used in JOINs and other Rowset operations.

55.
What command do we use to rename a db?

sp_renamedb “oldname” , “newname”
If someone is using db it will not accept sp_renmaedb. In that case first bring db to single user using sp_dboptions. Use sp_renamedb to rename database. Use sp_dboptions to bring database to multi user mode.

56.
What is BCP?

BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination.

57.
What is Cross Join?

A cross join that does not have a WHERE clause produces the Cartesian product of the tables involved in the join. The size of a Cartesian product result set is the number of rows in the first table multiplied by the number of rows in the second table.

58.
What is Storage Manager?

It is a program module that provides the interface between the low-level data stored in database, application programs and queries submitted to the system.

59.
What are stored-procedures? And what are the advantages of using them?

Stored procedures are database objects that perform a user defined operation. A stored procedure can have a set of compound SQL statements. A stored procedure executes the SQL commands and returns the result to the client. Stored procedures are used to reduce network traffic.

60.
What is database Trigger?

A database trigger is a PL/SQL block that can defined to automatically execute for insert, update, and delete statements against a table. The trigger can e defined to execute once for the entire statement or once for every row that is inserted, updated, or deleted.

61.
What is OLTP?

Online Transaction Processing (OLTP) relational databases are optimal for managing changing data. When several users are performing transactions at the same time, OLTP databases are designed to let transactional applications write only the data needed to handle a single transaction as quickly as possible.

62.
What is DDL (Data Definition Language)?

A data base schema is specifies by a set of definitions expressed by a special language called DDL.

63.
What is Weak Entity set?

An entity set may not have sufficient attributes to form a primary key, and its primary key compromises of its partial key and primary key of its parent entity, then it is said to be Weak Entity set.

64.
What is a deadlock?

Two processes wating to update the rows of a table which are locked by the other process then deadlock arises.

65.
What do you mean by flat file database?

It is a database in which there are no programs or user access languages. It has no cross-file capabilities but is user-friendly and provides user-interface management.

66.
What is Storage Manager?

It is a program module that provides the interface between the low-level data stored in database, application programs and queries submitted to the system.

67.
What is Index?

An index is a physical structure containing pointers to the data. Indices are created in an existing table to locate rows more quickly and efficiently. It is possible to create an index on one or more columns of a table, and each index is given a name.

68.
What is the difference between clustered and a non-clustered index?

A Clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.

A Nonclustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a nonclustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.

69.
What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?

HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is basically used only with the GROUP BY function in a query. WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

70.
What is log shipping?

Log shipping is the process of automating the backup of database and transaction log files on a production SQL server, and then restoring them onto a standby server. Enterprise Editions only supports log shipping. In log shipping the transactional log file from one server is automatically updated into the backup database on the other server.

71.
What are primary keys and foreign keys?

Primary keys are the unique identifiers for each row. They must contain unique values and cannot be null. Due to their importance in relational databases, Primary keys are the most fundamental of all keys and constraints. A table can have only one Primary key.
Foreign keys are both a method of ensuring data integrity and a manifestation of the relationship between tables.

72.
What are check constraint?

A Check constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity.

96.
What is Self Join?

A self join can be of any type, as long as the joined tables are the same. A self join is rather unique in that it involves a relationship with only one table.
73.
What are the type of Synonyms?

There are two types of Synonyms are :
  • Private
  • Public

74.
What is an Integrity Constrains?

An integrity constraint is a declarative way to define a business rule for a column of a table.

75.
What is Table?

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

76.
What is a synonym?

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

77.
What is Rollback Segment?

A Database contains one or more Rollback Segments to temporarily store "undo" information.

78.
What does COMMIT do?

A Commit makes permanent the changes resulting from all SQL statements in the transaction. The changes made by the SQL statements of a transaction become visible to other user sessions transactions that start only after transaction is committed.
79.
What is a Database instance?

A database instance (Server) is a set of memory structure and background processes that access a set of database files.

80.
What are Roles?

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

81.
What is SQLPlus?

SQLPlus is an application that recognizes & executes SQL commands & specialized SQL*Plus commands that can customize reports, provide help & edit facility & maintain system variables.

82.
What is the difference between normalization and denormalization?

Normalizing data means eliminating redundant information from a table and organizing the data so that future changes to the table are easier.

Denormalization means allowing redundancy in a table. The main benefit of denormalization is improved performance with simplified data retrieval and manipulation.

83.
What is a trigger?

Triggers are stored procedures created in order to enforce integrity rules in a database. A trigger is executed every time a data-modification operation occurs (i.e., insert, update or delete).
Triggers are executed automatically on occurance of one of the data-modification operations.

84.
What is the difference between static and dynamic SQL?

Static SQL is hard-coded in a program when the programmer knows the statements to be executed.
Dynamic SQL the program must dynamically allocate memory to receive the query results.
85.
What is UNIQUE KEY constraint?

A UNIQUE constraint enforces the uniqueness of the values in a set of columns, so no duplicate values are entered. The unique key constraints are used to enforce entity integrity as the primary key constraints.

86.
What is NOT NULL Constraint?

A NOT NULL constraint enforces that the column will not accept null values. The not null constraints are used to enforce domain integrity, as the check constraints.

87.
What is meant by query optimization?

The phase that identifies an efficient execution plan for evaluating a query that has the least estimated cost is referred to as query optimization.

88.
What is meant by embedded SQL?

They are SQL statements that are embedded with in application program and are prepared during the program preparation process before the program is executed.

89.
What is File Manager?

It is a program module, which manages the allocation of space on disk storage and data structure used to represent information stored on a disk.

90.
Define transaction?

A collection of operations that fom a single logical unit of works are called transaction.
91.
Define Constraints?

Constraints is a rule or restriction concerning a piece of data that is enforced at the data level.
A Constraint clause can constrain a single column or group of columns in a table.
There are five types of Constraint namely
  • Null / Not Null
  • Primary Key
  • Unique
  • Check or Validation
  • Foreign Key or References Key

92.
What are types of sub-queries?

  • Single-row subquery, where the subquery returns only one row.
  • Multiple-row subquery, where the subquery returns multiple rows.
  • Multiple column subquery, where the subquery returns multiple columns.

93.
What is SQL Profiler?

SQL Profiler is a graphical tool that allows system administrators to monitor events in an instance of Microsoft SQL Server. You can capture and save data about each event to a file or SQL Server table to analyze later.

94.
Define Clusters?

Clustering is a method of storing tables that are intimately related and often joined together into the same area on disk.
A cluster contains one or more tables, which have one or more column in common among them.

95.
Define Indexes?

Index is a general term for an Oracle/SQL features used to primarily to speed execution and imposes uniqueness upon certain data.
The most important of an index is to ensure uniqueness of rows and help in speedy retrieval of data.

96.
What is data integrity?

Data integrity is an important feature in SQL Server. When used properly, it ensures that data is accurate, correct, and valid. It also acts as a trap for otherwise undetectable bugs within applications.
97.
What is De-normalization?

De-normalization is the process of attempting to optimize the performance of a database by adding redundant data.
De-normalization is a technique to move from higher to lower normal forms of database modeling in order to speed up database access.

98.
What is referential integrity?

Referential integrity refers to the consistency that must be maintained between primary and foreign keys, i.e. every foreign key value must have a corresponding primary key value.

99.
What is the difference between static and dynamic SQL?

Static SQL is hard-coded in a program when the programmer knows the statements to be executed.
For dynamic SQL the program must dynamically allocate memory to receive the query results.

100.
Define Unique Key?

Unique key is a one or more column that must be unique for each row of the table.
It is similar to primary key. Primary key column will not accept a null. Whereas the unique key column will accept a null values.

101.
Define Synonym?

Synonym is an alternative method to creating a view that includes the entire table or view from another user it to create a synonym.
A synonym is a name assigned to a table or view that may thereafter be used to refer to it.
102.
What is an Data Abtration?

A major purpose of a database system is to provide users with an abstract view of the data.There are three levels of data abstraction
  • Physical level
  • Logical level
  • View level

103.
What is Transaction Manager?

It is a program module, which ensures that database, remains in a consistent state despite system failures and concurrent transaction execution proceeds without conflicting.

104.
What kind of User-Defined Functions can be created?

There are three types of User-Defined functions in SQL Server 2000 and they are Scalar, Inline Table-Valued and Multi-statement Table-valued.

105.
What are defaults? Is there a column to which a default can't be bound?

A default is a value that will be used by a column, if no value is supplied to that column while inserting data. IDENTITY columns and timestamp columns can't have defaults bound to them. See CREATE DEFUALT in books online.
106.
What's the maximum size of a row?

8060 bytes. Don't be surprised with questions like what is the maximum number of columns per table. Check out SQL Server books online for the page titled: “Maximum Capacity Specifications”.

107.
What is the difference between a local and a global variable?

A Local temporary table exists only for the duration of a connection or, if defined inside a compound statement, for the duration of the compound statement.
A Global temporary table remains in the database permanently, but the rows exist only within a given connection. When connection are closed, the data in the global temporary table disappears. However, the table definition remains with the database for access when database is opened next time.

108.
What is a query?

A query with respect to DBMS relates to user commands that are used to interact with a data base. The query language can be classified into data definition language and data manipulation language.

109.
What is Relational Algebra?

It is procedural query language. It consists of a set of operations that take one or two relations as input and produce a new relation.
110.
What is the difference between TRUNCATE and DELETE commands?

TRUNCATE is a DDL command whereas DELETE is a DML command. Hence DELETE operation can be rolled back, but TRUNCATE operation cannot be rolled back. WHERE clause can be used with DELETE and not with TRUNCATE.

111.
Describe the three levels of data abstraction?

There are three levels of abstraction :
  • Physical level :
    The lowest level of abstraction describes how data are stored.
  • Logical level:
    The next higher level of abstraction, describes what data are stored in database and what relationship among those data.
  • View level:
    The highest level of abstraction describes only part of entire database.

112.
How to copy the tables, schema and views from one SQL server to another?

Microsoft SQL Server 2000 Data Transformation Services (DTS) is a set of graphical tools and programmable objects that lets user extract, transform, and consolidate data from disparate sources into single or multiple destinations.
113.
What is the use of DESC in SQL?

DESC has two purposes.
It is used to describe a schema as well as to retrieve rows from table in descending order.

114.
What is a cluster Key?

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

115.
Define candidate key, alternate key, composite key?

A candidate key is one that can identify each row of a table uniquely. Generally a candidate key becomes the primary key of the table.

If the table has more than one candidate key, one of them will become the primary key, and the rest are called alternate keys.

A key formed by combining at least two or more columns is called composite key.
116.
What are the purpose of Normalisation?


  • Minimize redundancy in data.
  • Remove insert, delete and update anamoly during the database activities.
  • Reduce the need to reorganize data it is modified or enhanced.
  • Normalisation reduces a complex user view to a set of small and stable subgroups of fields or relations.

117.
What is RAID?

RAID, an acronym for Redundant Array of Independent Disks (sometimes incorrectly referred to as Redundant Array of Inexpensive Disks), is a technology that provides increased storage functions and reliability through redundancy.

118.
What is database replication?

Replication is the process of copying / moving data between databases on the same or different servers.
119.
What are cursors?

Cursors allow row-by-row prcessing of the result sets.

120.
What is a weak entity types?

The entity types that do not have key attributes of their own are called weak entity types. Rests are called strong entity types .The entity that gives identity to a weak entity is called owner entity. And the relationship is called identifying relationship. A weak entity type always has a total participation constraint with respect to its identifying relationship.

121.
What are defaults?

A default is a value that will be used by a column, if no value is supplied to that column while inserting data. IDENTITY columns and timestamp columns can’t have defaults bound to them.

122.
What is specialization?

It is the process of defining a set of subclasses of an entity type where each subclass contain all the attributes and relationships of the parent entity and may have additional attributes and relationships which are specific to itself.
122.
What are the different types of cursors?

Types of cursors :
  • Static
  • Dynamic
  • Forward-only
  • Keyset-driven

123.
What is a Catalog?

A catalog is a table that contain the information such as structure of each file ,the type and storage format of each data item and various constraints on the data .The information stored in the catalog is called Metadata . Whenever a request is made to access a particular data, the DBMS s/w refers to the catalog to determine the structure of the file.

124.
What is a view?

A view may be a subset of the database or it may contain virtual data that is derived from the database files but is not explicitly stored.

125.
What are different types of end users?

  • Casual end-users
  • Casual end-users
  • Sophisticated end users
  • Stand alone users
125.
What is a data model?

It is a collection of concepts that can be used to describe the structure of a database. It provides necessary means to achieve this abstraction. By structure of a database we mean the data types, relations, and constraints that should hold on the data.

126.
What are types of schema?

  • Internal schema
  • Conceptual schema
  • External schema

127.
What are different types of DBMS?

  • DBMS
  • RDBMS (Relational)
  • ORDBMS (Object Relational)
  • DDBMS (Distributed)
  • FDBMS (Federated)
  • FDBMS (Federated)
  • HDBMS (Hierarchical)
  • NDBMS (Networked)

128.
What is a lock?

A lock is a variable associated with a data item that describes the status of the item with respect to the possible operations that can be applied to it.