Manual Testing Notes PDF
Manual Testing Notes PDF
ASSURANCE
Complete Interview Preparation Document
PREPARED BY
UMAR ARSHAD | Software Quality Assurance Engineer | Manual - Automation
I originally created this Document for all Fresh Graduates and Experience Professional candidates for
Interview Preparation.
* But I have decided to open-source it and make it available for everyone who wants to learn SQA
Fundamental, Database Concepts, SCRUM Fundamentals, OOP Basics, Automation concepts like
selenium, JMeter, and API.
I added everything that you will need as a SQA Engineer Manual or Automation. The ideal use case of
this document is that you print it and keep it next to you while you are learning and practicing on your
computer.
Enjoy! Cheers,
UMAR ARSHAD
2 Why SDLC?
Here, are prime reasons why SDLC is important for developing a software system.
3.2 Design:
In this phase the software design is prepared from the requirement
specifications which were studied in the first phase. System Design helps in specifying
hardware and system requirements and also helps in defining overall system
architecture.
In this phase the QA Engineers comes up with the Test strategy, where they mention
what to test, how to test.
3.3 Implementation / Coding:
Upon receiving system design documents, the work is divided in modules/units and
actual coding is started. Since, in this phase the code is produced so it is the main focus
for the developer. This is the longest phase of SDLC. In this phase the QA Engineers
comes up with the Test Environment setup and test Case Documentation.
3.4 Testing:
After the code is developed it is tested against the requirements to make sure that the
product is actually solving the needs addressed and gathered during the requirements
phase. During this phase all types of like unit testing, integration testing, Smoke Testing,
functional testing, Sanity Testing, system testing, acceptance testing is done as well
as non-functional testing are also done.
3.5 Deployment: After successful testing the product is delivered / deployed to the customer
for their use.
As soon as the product is given to the customers, they will first do the beta testing/User
Acceptance Testing. If any changes are required or if any bugs are caught, then they will
report it to the engineering team. Once those changes are made or the bugs are fixed
then the final deployment will happen.
4 Waterfall model
Waterfall model works well for smaller projects where requirements are very well
understood.
The waterfall is a widely accepted SDLC model. In this approach, the whole process of the
software development is divided into various phases. In this SDLC model, the outcome of one
phase acts as the input for the next phase.
This SDLC model is documentation-intensive, with earlier phases documenting what need be
performed in the subsequent phases.
5 Incremental Model
The incremental model is not a separate model. It is essentially a series of waterfall cycles. The
requirements are divided into groups at the start of the project. For each group, the SDLC
model is followed to develop software. The SDLC process is repeated, with each release adding
more functionality until all requirements are met. In this method, every cycle act as the
maintenance phase for the previous software release. Modification to the incremental model
allows development cycles to overlap. After that subsequent cycle may begin before the
previous cycle is complete.
6 V-Model
In this type of SDLC model testing and the development, the phase is planned in parallel. So,
there are verification phases on the side and the validation phase on the other side. V-Model
joins by Coding phase.
This model adopts the best features of the prototyping model and the waterfall model. The
spiral methodology is a combination of rapid prototyping and concurrency in design and
development activities.
9 Prototyping Model
If you were testing this Operating system, you would realize that defects are likely to be
found in multi-tasking activity and need to be tested thoroughly which brings us to our
next principle Defect Clustering.
Early Testing - Testing should start as early as possible in the Software Development Life
Cycle. So that any defects in the requirements or design phase are captured in early
stages.
Defect Clustering which states that a small number of modules contain most of the
defects detected. If the same tests are repeated over and over again, eventually the
same test cases will no longer find new bugs.
Repetitive use of the same pesticide mix to eradicate insects during farming will over
time lead to the insects developing resistance to the pesticide Thereby ineffective of
pesticides on insects. The same applies to software testing. If the same set of repetitive
tests are conducted, the method will be useless for discovering new defects. To
overcome this, the test cases need to be regularly reviewed & revised, adding new &
different test cases to help find more defects.
Testing is context dependent which basically means that the way you test an e-
commerce site will be different from the way you test a commercial off the shelf
application. All the developed software’s are not identical. You might use a different
approach, methodologies, techniques, and types of testing depending upon the
application type.
It is possible that software which is 99% bug-free is still unusable. This can be the case if
the system is tested thoroughly for the wrong requirement. The absence of Error is a
Fallacy i.e. Finding and fixing defects does not help if the system build is unusable and
does not fulfill the user's needs & requirements.
Plan - Organization should plan and establish the process related objectives and
determine the processes that are required to deliver a high-Quality end product.
Do - Development and testing of Processes and also "do" changes in the processes
Check - Monitoring of processes, modify the processes, and check whether it meets the
predetermined objectives
Quality Control:
Test cases are the set of positive and negative executable steps of a test scenario which has
a set of pre-conditions, test data, expected result, post-conditions and actual results.
An environment configured for testing. Test bed consists of hardware, software, network
configuration, an application under test, other related software.
Test Environment is the combination of hardware and software on which Test Team
performs testing. Example:
Test data is the data that is used by the testers to run the test cases. Whilst running the test
cases, testers need to enter some input data. To do so, testers prepare test data. It can be
prepared manually and also by using tools.
Test Harness in Software Testing is a collection of stubs, drivers and other supporting tools
required to automate test execution. Test harness executes tests by using a test library and
Prepared by: Mr. Umar Arshad | Software Quality Assurance Engineer
generates test reports. Test harness contains all the information needed to compile and run
a test like test cases, target deployment port (TDP), source file under test, stubs, etc.
Test Closure is the note prepared before test team formally completes the testing process.
This note contains the total no. of test cases, total no. of test cases executed, total no. of
defects found, total no. of defects fixed, total no. of bugs not fixed, total no of bugs rejected
etc.,
In software testing Risks are the possible problems that might endanger the objectives of
the project stakeholders. It is the possibility of a negative or undesirable outcome. A risk is
something that has not happened yet and it may never happen; it is a potential problem.
12. What are the tasks of Test Closure activities in Software Testing?
Test Completion Check: To ensure all tests should be either run or deliberately skipped
and all known defects should be either fixed, deferred for a future release or accepted as a
permanent restriction.
Test Artifacts handover: Tests and test environments should be handed over to those
responsible for maintenance testing. Known defects accepted or deferred should be
documented and communicated to those who will use and support the use of the system.
Lessons learned: Analyzing lessons learned to determine changes needed for future
releases and projects. In retrospective meetings, plans are established to ensure that good
practices can be repeated and poor practices are not repeated.
Result: Archiving results, logs, reports, and other documents and work products in the
CMS (configuration management system).
1. Test Strategy
2. Test Plan
3. Effort Estimation Report
4. Test Scenarios
5. Test Cases/Scripts
6. Test Data
7. Requirement Traceability Matrix (RTM)
8. Defect Report/Bug Report
9. Test Execution Report
10. Graphs and Metrics
11. Test summary report
12. Test incident report
13. Test closure report
14. Release Note
15. Installation/configuration guide
16. User guide
17. Test status report
18. Weekly status report (Project manager to client)
Requirements Traceability Matrix (RTM) is used to trace the requirements to the tests
that are needed to verify whether the requirements are fulfilled. Requirement
Traceability Matrix AKA Traceability Matrix or Cross Reference Matrix.
Requirement ID
Requirement Type and Description
Test Cases with Status
In Software Engineering, traceability matrix can be divided into three major components as
mentioned below:
Forward traceability: This matrix is used to check whether the project progresses in the
forward desired direction and for the right product. It maps requirements to test cases.
Backward or reverse traceability: It is used to ensure whether the current product
remains on the right track. It maps test cases to requirements.
Bi-directional traceability (Forward + Backward): This traceability matrix ensures that all
requirements are covered by test cases. It analyzes the impact of a change in
requirements affected by the Defect in a work product and vice versa.
On the basis of the Business Requirement Document (BRD) and Technical Requirement
Document (TRD), testers start writing test cases.
"Verify Login, when correct ID and Password is entered, it should log in successfully"
Step 4: Identify the Business Requirement for which this TR (Technical Requirement-T94) is
defined
Test Coverage states which requirements of the customers are to be verified when the
testing phase starts. Test Coverage is a term that determines whether the test cases are
written and executed to ensure to test the software application completely, in such a
way that minimal or NIL defects are reported.
White Box Testing is also called as Glass Box, Clear Box, and Structural Testing. It is based on
applications internal code structure. In white-box testing, an internal perspective of the
system, as well as programming skills, are used to design test cases. This testing usually was
done at the unit level.
Black Box Testing is a software testing method in which testers evaluate the functionality of the
software under test without looking at the internal code structure. This can be applied to every
level of software testing such as Unit, Integration, System and Acceptance Testing.
Grey box is the combination of both White Box and Black Box Testing. The tester who works on
this type of testing needs to have access to design documents. This helps to create better test
cases in this process.
Alpha testing is done by the in-house developers (who developed the software) and testers.
Sometimes alpha testing is done by the client or outsourcing team with the presence of
developers or testers.
In the first phase of alpha testing, the software is tested by in-house developers. They
use debugger software. The goal is to catch bugs quickly.
In the second phase of alpha testing, the software is handed over to the software QA
staff, for additional testing in an environment that is similar to the intended use.
Beta testing is done by a limited number of end users before delivery. Usually, it is done in
the client place.
Gamma testing is done when the software is ready for release with specified requirements.
It is done at the client place. It is done directly by skipping all the in-house testing activities.
In simple words, what the system actually does is functional testing. To verify that each
function of the software application behaves as specified in the requirement document.
Testing all the functionalities by providing appropriate input to verify whether the actual
output is matching the expected output or not. It falls within the scope of black box testing
and the testers need not concern about the source code of the application.
Unit Testing is also called as Module Testing or Component Testing. It is done to check
whether the individual unit or module of the source code is working properly. It is done
by the developers in the developer’s environment.
Integration Testing is the process of testing the interface between the two software
units. Integration testing is done by three ways. Big Bang Approach, Top-Down
Approach, Bottom-Up Approach.
Testing the fully integrated application to evaluate the system’s compliance with its
specified requirements is called System Testing End to End testing. Verifying the
completed system to ensure that the application works as intended or not.
Smoke Testing is done to make sure if the build we received from the development
team is testable or not. It is also called as “Day 0” check. It is done at the “build level”. It
helps not to waste the testing time to simply testing the whole application when the key
features don’t work or the key bugs have not been fixed yet.
Sanity Testing is done during the release phase to check for the main functionalities of
the application without going deeper. It is also called as a subset of Regression testing. It
is done at the “release level”. We perform sanity testing when we don’t have enough
time for regression testing.
Retesting is done to make sure that the tests cases which failed in last execution are
passed after the defects are fixed. Retesting is carried out based on the defect fixes. In
Retesting, the cases which are failed earlier can be included to check if the functionality
failure in an earlier build.
Usually, this process will be carried out by domain experts. They perform testing just by
exploring the functionalities of the application without having the knowledge of the
requirements.
Perform abnormal action on the application deliberately in order to verify the stability of
the application.
Combining all the modules once and verifying the functionality after completion of
individual module testing.
Testing takes place from top to bottom. High-level modules are tested first and then low-
level modules and finally integrating the low-level modules to a high level to ensure the
system is working as intended. Stubs are used as a temporary module if a module is not
ready for integration testing.
It is a reciprocate of the Top-Down Approach. Testing takes place from bottom to up.
Lowest level modules are tested first and then high-level modules and finally integrating the
high-level modules to a low level to ensure the system is working as intended. Drivers are
used as a temporary module for integration testing.
It is also known as pre-production testing. This is done by the end users along with the
testers to validate the functionality of the application. After successful acceptance
testing. Formal testing conducted to determine whether an application is developed as per
the requirement. It allows the customer to accept or reject the application. Types of
acceptance testing are Alpha, Beta & Gamma.
Negative Testing: It is to determine what system not supposed to do. It helps to find
the defects from the software.
In simple words, how well the system performs is non-functionality testing. Non-
functional testing refers to various aspects of the software such as performance, load,
stress, scalability, security, compatibility etc., Main focus is to improve the user
experience on how fast the system responds to a request.
This type of testing determines or validates the speed, scalability, and/or stability
characteristics of the system or application under test. Performance is concerned with
achieving response times, throughput, and resource-utilization levels that meet the
performance objectives for the project or product.
It is to verify the behavior of the system once the load increases more than its design
expectations.
Concurrency testing means accessing the application at the same time by multiple users
to ensure the stability of the system. This is mainly used to identify deadlock issues.
Graphical User Interface Testing is to test the interface between the application and the
end user.
Recovery testing is performed in order to determine how quickly the system can recover
after the system crash or hardware failure. It comes under the type of non-functional
testing.
Identify the modules or functionalities which are most likely cause failures and then
testing those functionalities.
To verify whether the application is user-friendly or not and was comfortably used by an
end user or not. The main focus in this testing is to check whether the end user can
understand and operate the application easily or not. An application should be self-
exploratory and must not require training to operate it.
Security testing is a process to determine whether the system protects data and
maintains functionality as intended.
Running a system at high load for a prolonged period of time to identify the
performance problems is called Soak or Endurance Testing.
Fuzz testing is used to identify coding errors and security loopholes in an application. By
inputting massive amount of random data to the system in an attempt to make it crash
to identify if anything breaks in the application.
Ad-hoc testing is quite opposite to the formal testing. It is an informal testing type. In
Adhoc testing, testers randomly test the application without following any documents
and test design techniques. This testing is primarily performed if the knowledge of
testers in the application under test is very high. Testers randomly test the application
without any test cases or any business requirement document.
Interface testing is performed to evaluate whether two intended modules pass data and
communicate correctly to one another.
Perform testing on the application continuously for long period of time in order to verify
the stability of the application.
Inspection is a formal meeting lead by a trained moderator, certainly not by the author.
The document under inspection is prepared and checked thoroughly by the reviewers
before the meeting. In the inspection meeting, the defects found are logged and shared
with the author for appropriate actions. Post inspection, a formal follow-up process is
used to ensure a timely and corrective action.
The variation between the actual results and expected results is known as a defect. If a
developer finds an issue and corrects it by himself in the development phase, then it’s
called a defect.
If testers find any mismatch in the application/system in testing phase, then they call it
as Bug.
Once the product is deployed and customers find any issues then they call the product
as a failure product. After release, if an end user finds an issue, then that particular issue
is called as a failure.
Bug/Defect severity can be defined as the impact of the bug on customer’s business. It
can be Critical, Major or Minor. In simple words, how much effect will be there on the
system because of a particular defect.
Defect priority can be defined as how soon the defect should be fixed. It gives the order
in which a defect should be resolved. Developers decide which defect they should take
High Priority & High Severity: Submit button is not working on a login page and
customers are unable to login to the application
Low Priority & High Severity: key feature failed but there’s no impact on customer
business, e.g., calculation fault in yearly report which end user won’t use on daily basis.
High Priority & Low Severity: Spelling mistake of a company name on the homepage
Low Priority & Low Severity: FAQ page takes a long time to load
A critical bug is a show stopper which means a large piece of functionality or major
system component is completely broken and there is no workaround to move further.
For example, Due to a bug in one module, we cannot test the other modules because
that blocker bug has blocked other modules. Bugs which affect the customers’ business
are considered as critical.
Example:
1. “Sign In” button is not working on Gmail App and Gmail users are blocked to login to
their accounts.
2. An error message pops up when a customer clicks on transfer money button in a
Banking website.
Entry criteria is a set of conditions that permits a task to perform, or in absence of any of
these conditions, the task cannot be performed.
Management Review:
Audit:
An audit is the examination of the work products and related information to assesses
whether the standard process was followed or not.
Boundary value analysis (BVA) is based on testing the boundary values of valid and invalid
partitions. Every partition has its maximum and minimum values and these maximum and
minimum values are the boundary values of a partition.
Example:
Input condition is valid between 1 to 10
Decision Table is a Cause-Effect Table. This test technique is appropriate for functionalities
which has logical relationships between inputs (if-else logic). In Decision table technique, we
deal with combinations of inputs. To identify the test cases with decision table, we consider
conditions and actions. We take conditions as inputs and actions as outputs.
Now consider a dialogue box which will ask the user to upload photo with certain conditions
like –
If any of the conditions fails, the system will throw corresponding error message stating the
issue and if all conditions are met photo will be updated successfully.
Format .jpg .jpg .jpg .jpg Not .jpg Not .jpg Not .jpg Not .jpg
Size Less Less than >= 32kb >= 32kb Less than Less than >= 32kb >= 32kb
than 32kb 32kb 32kb
32kb
It divides the input data of software into different equivalence data classes.
You can apply this technique, where there is a range in the input field.
Order Pizza:
1. Any Number greater than 10 entered in the Order Pizza field (let say 11) is considered
invalid.
2. Any Number less than 1 that is 0 or below, then it is considered invalid.
3. Numbers 1 to 10 are considered valid
4. Any 3 Digit Number say -100 is invalid.
Using state transition testing, we pick test cases from an application where we need to
test different system transitions. We can apply this when an application gives a different
output for the same input, depending on what has happened in the earlier state.
Error Guessing is a software testing technique based on guessing the error which can
prevail in the code. The technique is heavily based on the experience where the test
analysts use their experience to guess the problematic part of the testing application.
Hence, the test analysts must be skilled and experienced for better error guessing.
Standalone application:
Client-Server Application:
Web Application:
Web server applications follow three-tier or n-tier architecture. The presentation layer is
in a client system, a Business layer is in an application server and Database layer is in a
Database server. It works both in Intranet and Internet.
UX design refers to the term “user experience design”, while UI stands for “user
interface design”.
There is an analogy I like to use to describe the different parts of a (digital) product:
If you imagine a product as the human body, the bones represent the code which give it
structure.
The organs represent the UX design: measuring and optimizing against input for
supporting life functions. And UI design represents the cosmetics of the body; its
presentation, its senses and reactions.
We can do System Testing only when all the units are in place and working properly. It
can only be done before User Acceptance Testing (UAT).
6.4. When to stop testing? (Or) How do you decide when you have
tested enough? imp
There are many factors involved in the real-time projects to decide when to stop testing.
Check-list:
1. look & feel
2. height
3. weight
4. material used
5. radius at top & bottom
6. capacity
7. color
8. grip
9. breakable / unbreakable
What you need and what stages you need to test when you receive the Mobile Application,
there are some major concerns I have listed and you should know.
Testing is done by certifying the requirements. like whether the application is working
based on the requirements or not.
This is a user-centric testing of the application. In this test phase, items such as
visibility of text in various screens of the app, interactive messages, alignment of
elements, the look and feel of the app for different screens, size of fields etc. are
tested under this.
This testing is done after all the modules of the app are completely developed,
tested individually and all the bugs are fixed verified.
During this testing, request/response to/from the service is tested for various
conditions.
Testing of the data flow for encryption and decryption mechanism is to be tested in
this phase. Access to stored data is also tested in this phase.
It is basically done to verify the behavior of the app when the phone has a 2G or 3G
connection. Field testing verifies if the app is crashing under slow network
connection or if it is taking too long to load the information.
This is the Offline Scenario Verification. Conditions where the communication breaks
in the middle are called as offline conditions.
Some of the conditions where interruptions of a network can be tested are as
follows:
Burn-up and burn-down charts are used to keep track of the progress of the project.
Burn-up charts represent how much work has been completed in any project
whereas Burn-down chart represents the remaining work in a project.
Product backlog is maintained by the project owner which contains every feature
and requirement of the product.
Sprint backlog can be treated as the subset of product backlog which contains
features and requirements related to that particular sprint only.
Test stub is a small code that mimics(copy) a specific component in the system and
can replace it. Its output is the same as the component it replaces.
8.13. What is the difference between Epic, User stories & Tasks?
User Stories: It defines the actual business requirement. Generally created by the
business owner.
Task: To accomplish the business requirements development team create tasks.
Epic: A group of related user stories is called an Epic.
QA can provide value addition by think outside the box about the various scenarios
to test a story. They can provide quick feedback to the developers about whether
new functionality is working fine or not.
It can be defined as a pre-preparation step to the first sprint. Activities like setting
development environment, preparing backlog, etc need to be done before starting
the first sprint and can be treated as Sprint zero.
There may be some technical issues or design problem in the project which needs to
be resolved first. To provide the solution to this problem “Spikes” are created.
Spikes are of two types- Functional and Technical.
Daily stand-up meeting is essential for any team in which team discuss,
1. How much work has been completed?
2. What are the plans to resolve technical issues?
3. What steps need to done to complete the projects etc.?
It can be defined as a spike with the current architecture or the current set of best
practices. The purpose of a tracer bullet is to examine how an end-to-end process
will work and examine feasibility.
There are 5 types of Scrum meetings which occur at a particular time during a Sprint
cycle and each particular type serves a distinct purpose.
I Hope, these questions will help you in preparing for the Agile testing and
methodology interview.
Thanks!
Database is a collection of related data and data is a collection of facts and figures
that can be processed to produce information.
Database management system stores data in such a way that it becomes easier to
retrieve, manipulate, and produce information.
Structured Query Language SQL is a database tool that is used to create and
access the database to support software applications.
column_name1 data_type(size),
column_name2 data_type(size),
column_name3 data_type(size),
ALTER: The ALTER table is used for modifying the existing table object in the
database.
ALTER TABLE table_name
OR
These statements are used to manipulate the data in records. Commonly used DML
statements are INSERT, UPDATE, and DELETE.
The SELECT statement is used as a partial DML statement, used to select all or
relevant records in the table.
These statements are used to set privileges such as GRANT and REVOKE
database access permission to the specific user.
The DISTINCT statement is used with the SELECT statement. If the record contains
duplicate values, then the DISTINCT statement is used to select different values
among duplicate records.
Syntax:
SELECT DISTINCT column_name(s)
FROM table_name;
Answer:
WHERE Clause: This clause is used to define the condition, extract and display only those
records which fulfill the given condition.
Syntax:
SELECT column_name(s)
FROM table_name
WHERE condition;
GROUP BY Clause: It is used with SELECT statement to group the result of the executed
query using the value specified in it. It matches the value with the column name in tables
and groups the end result accordingly.
Syntax:
SELECT column_name(s)
FROM table_name
GROUP BY column_name;
HAVING clause: This clause is used in association with the GROUP BY clause. It is
applied to each group of results or the entire result as a single group. It is much similar as
WHERE clause but the only difference is you cannot use it without GROUP BY clause
Syntax:
SELECT column_name(s)
FROM table_name
GROUP BY column_name
ORDER BY clause: This clause is used to define the order of the query output either in
ascending (ASC) or in descending (DESC). Ascending (ASC) is set as the default one but
descending (DESC) is set explicitly.
Syntax:
SELECT column_name(s)
FROM table_name
WHERE condition
USING clause: USING clause comes in use while working with SQL JOIN. It is used to
check equality based on columns when tables are joined. It can be used instead of the ON
clause in JOIN.
Syntax:
SELECT column_name(s)
FROM table_name
JOIN table_name
USING (column_name);
Constraints are used to set the rules for all records in the table. If any constraints get
violated then it can abort the action that caused it.
Constraints are defined while creating the database itself with the CREATE TABLE
statement or even after the table is created once with the ALTER TABLE statement.
The main difference between null and empty is that the null is used to refer to
nothing while empty is used to refer to a unique string with zero length.
4 major types of Joins are used while working on multiple tables in SQL databases:
INNER JOIN: It is also known as SIMPLE JOIN which returns all rows from BOTH tables
when it has at least one matching column.
Syntax:
SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON column_name1=column_name2;
For Example,
In this example, we have a table Employee with the following data:
ON Employee.Emp_id = Joining.Emp_id
ORDER BY Employee.Emp_id;
LEFT JOIN (LEFT OUTER JOIN): This join returns all rows from the LEFT table and its
matched rows from a RIGHT table.
Syntax:
SELECT column_name(s)
FROM table_name1
For Example,
In this example, we have a table Employee with the following data:
FROM Employee
ORDER BY Employee.Emp_id;
There will be 4 records selected. You will see the following results:
RIGHT JOIN (RIGHT OUTER JOIN): This join returns all rows from the RIGHT table and its
matched rows from the LEFT table.
Syntax:
SELECT column_name(s)
FROM table_name1
ON column_name1=column_name2;
For Example,
In this example, we have a table Employee with the following data:
ORDER BY Employee.Emp_id;
Output:
Emp_id Joining_Date
E0012 2016/04/18
E0013 2016/04/19
E0014 2016/05/01
FULL JOIN (FULL OUTER JOIN): This join returns all results when there is a match either
in the RIGHT table or in the LEFT table.
Syntax:
SELECT column_name(s)
FROM table_name1
For Example,
In this example, we have a table Employee with the following data:
ON Employee.Emp_id = Joining.Emp_id
ORDER BY Employee.Emp_id;
There will be 8 records selected. These are the results that you should see.
SQL Aggregate functions determine and calculate values from multiple columns in a
table and return a single value.
There are 7 aggregate functions in SQL:
AVG(): Returns the average value from specified columns.
COUNT(): Returns number of table rows.
MAX(): Returns the largest value among the records.
MIN(): Returns smallest value among the records.
SUM(): Returns the sum of specified column values.
FIRST(): Returns the first value.
LAST(): Returns last value.
Syntax:
CREATE TRIGGER name {BEFORE|AFTER} (event [OR..]}
ON table_name [FOR [EACH] {ROW|STATEMENT}]
FROM table_name
WHERE condition
Syntax:
CREATE OR REPLACE VIEW view_name AS
SELECT column_name(s)
FROM table_name
WHERE condition
ON object_name
TO {user_name|PUBLIC|role_name}
In the above syntax, the GRANT option indicates that the user can grant access to
another user too.
ON object_name
FROM {user_name|PUBLIC|role_name};
9.25. How many row comparison operators are used while working
with a subquery?
There are 3-row comparison operators that are used in subqueries such as IN, ANY
and ALL.
The result of the query is the details of an employee from the Employee table.
10.1. How to write query for find the highest salary from employees
table.
10.2. How to write query for find the second highest salary from
employees table.
1st Method
SELECT name, MAX(salary) AS salary
FROM employee
WHERE salary < (SELECT MAX(salary)
FROM employee);
2nd Method
For Second max salary
Select name, salary From Employee ORDER BY Salary DESC LIMIT
1,1;
For third max salary
Select salary From Employee ORDER BY Salary DESC LIMIT 2,1;
10.4. How to write the query to find the total no of columns in Table?
Many of the new modern web applications are built using web-services, micro-services,
and APIs. As testers, we should be knowledgeable and experienced in testing APIs and
Web Services.
Here are some fundamental API Testing Interview Questions mainly aimed at software
testers.
API is a collection of routines, tools, protocols that together are required for building
the software application. Any system software or application software which consists
of multiple APIs can perform Application Programming Interface (API) testing.
This form of testing includes interaction between various or says multiple APIs as
well as the interaction between API and application program. The procedure mainly
includes making API calls using software and observing system response after
receiving the output.
API is considered as the essential connecting part of this digital world. It basically
resides in the business logic layer where it performs functions like processing
commands, application coordination, initiates logical decisions, etc.
The main consideration is returning correct results under any type of conditions.
Mainly, the output or results observed of an API are divided into three sections as
follows:
SOAP stands for Simple Object Access Protocol whereas REST stands for
Representational State Transfer.
SOAP is state full and REST is state less.
SOAP is a protocol whereas REST is an architectural pattern.
SOAP uses service interfaces to expose its functionality to client applications
while REST uses Uniform Service locators to access to the components on
the hardware device.
SOAP needs more bandwidth for its usage whereas REST doesn’t need
much bandwidth.
Comparing SOAP vs REST API, SOAP only works with XML formats
whereas REST work with plain text, XML, HTML and JSON.
SOAP cannot make use of REST whereas REST can make use of SOAP.
10.7. Enlist some best practices that are followed to make API testing successful.
Performing tests repeatedly define some best practices for making testing
successful.
Enlisted below are some best practices for API testing:
Test cases should be grouped under category with expected results that
happen consistently and other typical results.
Test cases should include selected parameters as well as API call
declarations.
API load tests are performed to determine system application stress.
Maintain the limits of the variables used in the tests as well as avoid ‘Test
Chaining’.
10.9. What are the tools used for API test automation?
Automation testing is a must when we talk about agile development in API testing.
However, the language in which the code is written is also an important factor as it
decides the tool language.
Some important API test automation tools are:
SOAPUI: It is an open-source API testing tool which is considered as the best
testing tool because of its feature like creating complex validation scripts and
test cases, efficient test coverage, etc.
HP QTP/UFT: This is now known as HP UFT i.e., Unified Functional Testing.
This tool is basically used for systems without user interface like web
services, etc.
PARASOFT: This testing tool runs on various platforms and is used to test
API which does not have a Graphical User interface (GUI).
HTTP master
NUnit and JUnit testing tools are used where the code is written in .Net and
Java respectively.
API framework is described by the config file which consists of the list of all APIs that
are required to be activated and are activated for any particular program run. This is
essential as every test run does not require all APIs.
The purpose of the ‘Config’ file is to describe and enlist every configurable
component within a test run.
As it is a well aware fact that, for any foundation, there has to be good
documentation. API documentation likewise, serves as a quick reference for
accessing the library or working within a program.
Some free templates which make API documentation much easier and simple
are:
Slate
FlatDoc
Swagger
API blueprint
RestDoc
Miredot
Web service API Specification.
10.13. Enlist some of the API examples which are very well known and popular.
There are several such examples. Enlisted below are some most popular ones:
Google Maps API: These are designed mainly for mobile and desktop use with
the help of a flash interface and JavaScript.
Amazon Advertising API: Amazon is known for their products and thus their
advertising API accesses their product to discover their functionality and thus
advertise accordingly.
Twitter: The API for twitter is usually in two categories, one for accessing data
and the other for interacting with the twitter search.
YouTube: This API used for YouTube includes various functionalities including
videos, live streaming, player, etc.
10.14. What are the testing methods that come under API testing?
The difference between API testing and Unit testing can be understood from the
below table:
UNIT testing API Testing
Unit testing is usually performed by developers API testing is performed by the testers for end to
where every functionality is tested separately. end testing of the functionality.
As they have the limited scope of testing, thus basic As they have the broader scope of testing, all
functionalities are only considered for testing. issues that are functional are considered for
testing.
Usually, unit testing is done before the code is API testing is performed after the build is ready for
included in the build. testing.
The Source code is involved in this form of testing. Source code is not involved in this form of testing.
Challenges are the part of every form of testing and the same goes with API testing
too.
Mentioned below are some common challenges that are faced in API testing:
The first and foremost challenge is selecting an appropriate parameter and
then its combination.
Parameter categorization
Proper sequencing of call is required as this may lead to inadequate
coverage in testing.
Output verification and validation
Another important challenge is providing input values, which is very difficult
as GUI is not available in this case.
10.17. What are the types of issues observed while performing API testing?
10.18. Why API testing is determined as the most suitable form for Automation
testing?
Yes, it’s true that API testing is now preferred over GUI testing and is considered as
most suitable.
Below are the few reasons behind this statement.
Verify all the functional paths of the system under test very effectively.
Provides the most stable interface.
Easier to maintain and provides fast feedback.
The main consideration of the UI (User Interface) level testing is to test the graphical
interface part of the application include features like font, layout, etc.
Whereas, the main consideration of the API testing is establishing communication
between different software systems and it mainly resides in business logic layer. It
never concentrates on the look of the application.
Test Api is known as the library of test building blocks which are essential for
developers and testers for creating testing tools as well as automated test suites.
When something goes wrong i.e. the outcome is not as expected then the error
occurs and warnings are described as a message in the proper format. There can be
one or multiple warnings within the same module.
Different types of warnings that can occur are:
Parameter validation warning
Missing module warning
Different types of errors that can occur are:
Documentation errors
Missing module errors
Parameter validation errors
GET: The HTTP GET method is used to **read** (or retrieve) a representation of a resource.
Request Method – Get, Post, Put, Delete (these are the common ones)
Response Status Code – 200, 301, 404, 500 (these are the most common ones)
Response Body – this is the data that comes back to the client from the server
2x Success
Code Text Purpose
3x Redirection
401 Unauthorized This response is sent when your client failed to provide credentials
or its credentials were invalid.
404 Not Found When a particular resource doesn’t exist or couldn’t be found.
405 Method Not The resource was found, but doesn’t support the request method.
Allowed
406 Not Acceptable When the client specifies a response content type in
the Accept header that is not supported.
413 Request Entity When the client requests too many objects. For example,
Too Large the limit parameter exceeded the maximum.
422 Missing or The request cannot be processed either because it omitted required
Invalid Data fields or because it contained invalid data. See the response for
more details.
429 Too Many When an OAuth client exceeds the rate limit for API requests to a
Requests store.
500 Internal Server When an error has occurred within the API.
Error
501 Not When a request method is sent that is not supported by the API
Implemented (e.g., TRACE , PATCH ).
503 Service When the store is “Down for Maintenance,” being upgraded to a new
Unavailable version, or is suspended due to administrative action or a billing issue.
507 Insufficient When the store has reached a limitation for the resource.
Storage
Hope this article will be very helpful for your API Testing interview preparation
Selenium
1. is a free and open source
2. have a large user base and helping communities
3. have cross Browser compatibility (Firefox, Chrome, Internet Explorer, Safari etc.)
4. have great platform compatibility (Windows, Mac OS, Linux etc.)
5. supports multiple programming languages (Java, C#, Ruby, Python, Pearl etc.)
6. has fresh and regular repository developments
7. supports distributed testing
Selenium is one of the most popular automated testing suites. Selenium is designed
in a way to support and encourage automation testing of functional aspects of web-
based applications and a wide range of browsers and platforms. Due to its existence
in the open-source community, it has become one of the most accepted tools
amongst the testing professionals.
Selenium is not just a single tool or a utility, rather a package of several testing tools
and for the same reason, it is referred to as a Suite. Each of these tools is designed
to cater different testing and test environment requirements.
11.5. What are the testing types that can be supported by Selenium?
Selenium IDE is the simplest and easiest of all the tools within the Selenium
Package. Its record and playback feature makes it exceptionally easy to learn with
minimal acquaintances to any programming language. Selenium IDE is an ideal tool
for a naïve user.
Selenese is the language which is used to write test scripts in Selenium IDE.
The locator can be termed as an address that identifies a web element uniquely
within the webpage. Thus, to identify web elements accurately and precisely we
have different types of locators in Selenium:
ID
ClassName
Name
TagName
LinkText
PartialLinkText
Assert: Assert command checks whether the given condition is true or false. Let’s
say we assert whether the given element is present on the web page or not. If the
condition is true then the program control will execute the next test step but if the
condition is false, the execution would stop and no further test would be executed.
Verify: Verify command also checks whether the given condition is true or false.
Irrespective of the condition being true or false, the program execution doesn’t halt
i.e. any failure during verification would not stop the execution and all the test steps
would be executed.
XPath is used to locate a web element based on its XML path. XML stands for
Extensible Markup Language and is used to store, organize and transport arbitrary
data. It stores data in a key-value pair which is very much similar to HTML tags. Both
being markup languages and since they fall under the same umbrella, XPath can be
used to locate HTML elements.
The fundamental behind locating elements using XPath is the traversing between
various elements across the entire page and thus enabling a user to find an element
with the reference of another element.
11.12. What is the difference between Static Xpath and Dynamic Xpath?
An absolute xpath in HTML Document Object Modal (DOM) starts with html e.g.
1. html/body/div[5]/div[2]/div/div[2]/div[2]/h2[1]
and a relative xpath finds the closed id to the DOM element and generates xpath
starting from that element e.g.
1. //*[@id='answers']/h2[1]/a[1]
Single Slash “/” – Single slash is used to create Xpath with absolute path.
Double Slash “//” – Double slash is used to create Xpath with relative path.
Selenium Grid can be used to execute same or different test scripts on multiple
platforms and browsers concurrently so as to achieve distributed test execution,
testing under different environments and saving execution time remarkably.
Implicit Wait: Implicit waits are used to provide a default waiting time (say 30
seconds) between each consecutive test step/command across the entire test script.
Thus, the subsequent test step would only execute when the 30 seconds have
elapsed after executing the previous test step/command.
Explicit Wait: Explicit waits are used to halt the execution till the time a particular
condition is met or the maximum time has elapsed. Unlike Implicit waits, explicit
waits are applied for a particular instance only.
There are some common conditions that are frequently of use when automating web
browsers.
title_is
title_contains
presence_of_element_located
visibility_of_element_located
visibility_of
presence_of_all_elements_located
text_to_be_present_in_element
text_to_be_present_in_element_value
The user can use sendKeys(“String to be entered”) to enter the string in the textbox.
Syntax:
WebElement username = drv.findElement(By.id(“Email”));
// entering username
username.sendKeys(“sth”);
WebDriver facilitates the user with the following methods to check the visibility of the
web elements. These web elements can be buttons, drop boxes, checkboxes, radio
buttons, labels etc.
1. isDisplayed()
2. isSelected()
3. isEnabled()
Syntax:
isDisplayed():
boolean buttonPresence = driver.findElement(By.id(“gbqfba”)).isDisplayed();
isSelected():
boolean buttonSelected = driver.findElement(By.id(“gbqfba”)).isSelected();
isEnabled():
boolean searchIconEnabled = driver.findElement(By.id(“gbqfb”)).isEnabled();
Get command is used to retrieve the inner text of the specified web element. The
command doesn’t require any parameter but returns a string value. It is also one of
the extensively used commands for verification of messages, labels, errors etc
displayed on the web pages.
Syntax:
String Text = driver.findElement(By.id(“Text”)).getText();
Prepared by: Mr. Umar Arshad | Software Quality Assurance Engineer
11.20. How to select value in a dropdown?
The value in the dropdown can be selected using WebDriver’s Select class.
Syntax:
selectByValue:
Select selectByValue = new Select(driver.findElement(By.id(“SelectID_One”)));
selectByValue.selectByValue(“greenvalue”);
selectByVisibleText:
Select selectByVisibleText = new Select
(driver.findElement(By.id(“SelectID_Two”)));
selectByVisibleText.selectByVisibleText(“Lime”);
selectByIndex:
Select selectByIndex = new Select(driver.findElement(By.id(“SelectID_Three”)));
selectByIndex.selectByIndex(2);
driver.findElement(By.linkText(“Google”)).click();
The command finds the element using link text and then click on that element and
thus the user would be re-directed to the corresponding page.
The above-mentioned link can also be accessed by using the following command.
driver.findElement(By.partialLinkText(“Goo”)).click();
The above command finds the element based on the substring of the link provided in
the parenthesis and thus partialLinkText() finds the web element with the specified
substring and then clicks on it.
An inline frame acronym as iframe is used to insert another document within the
current HTML document or simply a web page into a web page by enabling nesting.
Select iframe by id
driver.switchTo().frame(“ID of the frame“);
Locating iframe using tagName
driver.switchTo().frame(driver.findElements(By.tagName(“iframe”).get(0));
Locating iframe using index
frame(index)
driver.switchTo().frame(0);
frame(Name of Frame)
driver.switchTo().frame(“name of the frame”);
frame(WebElement element)
Select Parent Window
driver.switchTo().defaultContent();
findElement(): findElement() is used to find the first element in the current web page
matching to the specified locator value. Take a note that only first matching element
would be fetched.
Syntax:
WebElement element = driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));
findElements(): findElements() is used to find all the elements in the current web
page matching to the specified locator value. Take a note that all the matching
elements would be fetched and stored in the list of WebElements.
Syntax:
List <WebElement> elementList
= driver.findElements(By.xpath(“//div[@id=’example’]//ul//li”));
Selenium is an automation testing tool which supports only web application testing.
Therefore, windows pop up cannot be handled using Selenium.
WebDriver offers a wide range of interaction utilities that the user can exploit to
automate mouse and keyboard events. Action Interface is one such utility which
simulates the single user interactions.
Thus, In the following scenario, we have used Action Interface to mouse hover on a
drop down which then opens a list of options.
Sample Code:
// Instantiating Action Interface
Actions actions=new Actions(driver);
subLinkOption.click();
The values of the css properties can be retrieved using a get() method:
Example: Write the behavior of the application for entering the username and
password.
Scenario: Login check
Given I am on the login page
When I enter "username" username
And I enter "Password" password
And I click on the "Login" button
Then I am able to login successfully.
Page Object Model (POM) is a design pattern, popularly used in test automation that
creates Object Repository for web UI elements. The advantage of the model is that it
reduces code duplication and improves test maintenance.
Advantages of POM
1. Page Object Design Pattern says operations and flows in the UI should be
separated from verification. This concept makes our code cleaner and easy to
understand.
2. The Second benefit is the object repository is independent of test cases, so
we can use the same object repository for a different purpose with different
tools.
3. Code becomes less and optimized because of the reusable page methods in
the POM classes.
4. Methods get more realistic names which can be easily mapped with the
operation happening in UI. i.e. if after clicking on the button we land on the
home page, the method name will be like 'gotoHomePage()'.
Test data can efficiently be read from excel using JXL or POI API.
Browser Selenium supports almost all the popular QTP supports Internet Explorer, Firefox and
Compatibility browsers like Firefox, Chrome, Safari, Internet Chrome. QTP only supports Windows
Explorer, Opera etc. Operating System
Distribution Selenium is distributed as an open-source tool QTP is distributed as a licensed tool and is
and is freely available commercialized
Application Selenium supports testing of only web-based QTP supports testing of both the web-based
under Test applications application and windows based application
Object Object Repository needs to be created as a QTP automatically creates and maintains
Repository separate entity Object Repository
Vendor Support As Selenium is a free tool, user would not get Users can easily get the vendor’s support in
the vendor’s support in troubleshooting issues case of any issue
Object Repository is a term used to refer to the collection of web elements belonging
to Application Under Test (AUT) along with their locator values. Thus, whenever the
element is required within the script, the locator value can be populated from the
Object Repository. Object Repository is used to store locators in a centralized
location instead of hardcoding them within the scripts.
In Selenium, objects can be stored in an excel sheet which can be populated inside
the script whenever required.
Exceptions are events due to which java program ends abruptly without giving
expected output. Java provides a framework where a user can handle exceptions.
When you start working with Selenium webdriver, you will come across different
exceptions based on the code you write. When an exception occurs, the normal flow
of program halts and an exception object is created. Exception Handling is a
mechanism to handle runtime errors such as ClassNotFoundException,
IOException, SQLException, RemoteException, etc.
NoSuchElementException
NoSuchWindowException
NoSuchFrameException
NoAlertPresentException
InvalidSelectorException
ElementNotVisibleException
ElementNotSelectableException
TimeoutException
NoSuchSessionException
StaleElementReferenceException
p = driver.current_window_handle
parent = driver.window_handles[0]
child = driver.window_handles[1]
driver.switch_to.window(child)
__init__ method
"__init__" is a reserved method in python classes. It is called as a constructor in
object oriented terminology. This method is called when an object is created from
a class and it allows the class to initialize the attributes of the class.
Hope in this article you will find answers to most frequently asked Selenium and
WebDriver Interview questions.
No, JMeter does not support the actual browser behavior. It does not render the
HTML webpages as the normal browser does. The response can be viewed in
HTML format but the actual timings are not present in the generated samples.
Distributed Testing means using multiple machines for load testing in which one of
the machines can be made master and others can be kept as a slave. It is very
important to note that all the machines should be on the same network and should
have the same version of Java and JMeter.
Regular Expression is used for extracting some values dynamically from the
responses. These values can be used in the subsequent request or can be saved for
reporting purposes. Regular Expression is used in both Pre-Processors as well as
Post Processors.
Basically, there are two types of processors in JMeter namely Pre-Processor and
Post Processor.
Pre-Processors execute before the main sampler and can change the scope of the
sampler whereas Post Processors execute after the main sampler and are
applicable to all samplers in the same scope of Test Plan. They can be used to
extract some fields from the server response and store them in variables.
Data Parametrization makes the scripts reusable where the values is not required to
be hardcoded for the same request with different parameters.
Below is the data parametrization that is supported in JMeter:
CSV Data Set Config
User-Defined Variables.
Both Gaussian and Poisson Timers work on a mathematical formula with some
constant delay and additional offset. Difference between the two lies in the fact that
how the lambda value is calculated in the case of Poisson timer and how deviation is
calculated in the case of Gaussian Timer.
12.9. What are the major differences between JMeter and Load Runner?
It has more technical capabilities. Less technically sound as compared to Load Runner.
Supports SAP, Siebel and Peoplesoft. Doesn’t support SAP and Siebel
Co-relation is a process of extracting the values from the server response and
storing it in a variable to be used in any other request which is to follow.
For Example, for testing any login functionality if you have to use the session
ID/cookie ID, you can extract the values from the response of GET Request of the
login page and then dynamically use the same while making POST request for a
login.
Listeners are used for storing the execution results of load testing in different forms
be it in a table, graph, tree or in any other presentable format so that it can be
presented to the client. There are different type of inbuild listeners in JMeter and
many others can be imported into it by using plugins as per the requirement.
HTTP(s) Test Script Recorder is used to record all the Http(s) requests going to the
server from your application. Some configurations require to be done in JMeter in
order to make it work.
Steps followed to record https traffic are:
Add HTTP(s) Test script recorder to WorkBench.
Enter the port number to start your proxy server.
Choose the target either as “Workbench” or add a Recording Controller in your
test plan and select the same target for storing all the recordings under it.
Start the proxy server.
Configure your browser with manual proxy settings pointing to the same port
number used in the test script recorder.
Yes, JMeter can record HTTP or Https request going to the server from your mobile
application also. It is required that mobile and JMeter are on the same network.
Below is the configuration required:
Configure your proxy server in JMeter to run at a specified port.
Set up the proxy on your mobile wifi settings and enter the same port number
that is used in the recorder.
Install the Root CA certificate on your mobile.
Hit server requests from your mobile and observe it getting captured by the
specified controller.
Just as in any other programming language, variables and functions are used in
JMeter also in order to make the scripts reusable.
Syntax of Variable – ${var}
There are many inbuilt functions that are available in JMeter to perform various
actions. Function string can be generated from the Function Dialogue Box itself.
For Example, if you want to get the machine IP stored in a machineIP variable, you
can use the string ${__machineIP(machineIP)}.
JMeter tests can be run both GUI as well as Non-GUI Mode. It is highly
recommended to run the load test in non-GUI mode because the AWT event thread
can kill the tests in case of high load scenarios.
The various non-GUI mode supported with JMeter are:
Command-line
ANT plugin
MAVEN plugin
Jenkins
Yes, it is possible to run selenium scripts in JMeter to get some ideas on their
performance.
There are two ways of doing it. Either you can use JUnit libraries to build selenium
scripts and save as Jars and copy the same in the JMeter directory. And then add
JUnit sampler to your test plan and import the Jar file.
Otherwise, the Webdriver sampler plugin can be added in the JMeter ext folder.
Restart the JMeter. Write your selenium code in the Webdriver sampler and then
execute it to see the performance.
Sessions and cookies can be managed in JMeter by using config elements such as
HTTP Cache Manager which provides an option to clear the cookies in every
iteration and also allows to add user-defined cookies.
HTTP Cache manager helps you in clearing cache after each iteration as per your
requirement in the load tests and also limits the number of elements that can be
stored in the cache. Both of these config elements can be attached to the HTTP
sampler.
12.20. What are the important steps for testing JDBC request?
JDBC requests are used to establish a connection with the databases and then
measure the response time of the queries.
Important steps for testing JDBC requests are:
Setting up Config Element, JDBC Connection configuration in which
Database URL and JDBC Driver Class needs to be added as per the
database which is being used. Also, add the variable name for this
connection configuration so as to use it in the sampler.
Add JDBC Request. Add the same variable name added above and write
your queries to the test.
12.22. Can JMeter measure the performance of a complete application? For Example,
you have multiple screens in your mobile app. Can JMeter measure the time
taken to flip the screens?
No, JMeter does not measure the transition time between the screens. It can only
measure the server actions not the UI interactions.
12.24. Which factors decide the maximum threads that one should generate per
system?
Tidy Parsing is a type of parsing that is used in Xpath extractor. If the response is in
pure XML then tidy parsing is not required whereas, in the case of XHTML, it is
mandatory to check the tidy parsing option in order to fetch the correct results.
12.26. What are the important plugins that are supported in JMeter?
JMeter supports different types of plugins which are helpful in generating high-quality
results.
Below are the major plugins that are supported:
Thread group plugin – Stepping thread group plugin.
Samplers’ plugins like Webdriver.
Listener’s plugins.
How does a Jmeter knows what type of request has been sent to server???
It is through Samplers. Samplers are a must to add to a Test Plan as only it can let
Jmeter know what type of request need to go to which server and with any
predefined parameters or not. Requests could be HTTP, HTTP(s), FTP, TCP,
SMTP, SOAP, JDBC etc.
Till now, we have covered how JMeter hits the server and how the responses are
displayed via listeners. To ensure that the response received is correct and as per
expectation, we need to add assertions. Assertions are simply validations which we
need to put on responses to compare the results.
Below are the types of assertions commonly used:
Response Assertion
Duration Assertion
I’m sure that this article on JMeter interview questions would have helped to enrich your
knowledge on JMeter concepts to a great extent.
A thorough understanding of all the questions covered here would help you to crack any
interview confidently.
13.1. If you have a 5-litre jug and a 3-litre jug, how would you measure exactly 4
liters?
Answer
1. Fill the 3L jug fully and empty it in the 5L jug
2. Now again fill 3L fully and pour its water in the 5L jug (remember it already has 3 liters of
water in it) until it full.
3. Now you're left with only 1 liter of water in the 3L jug (*hope you are getting it)
4. Now empty 5L jug and pour that remaining 1-liter water that we got in step 3 into the 5L
jug.
a. Now 5L jug contains 1 liter of water.
5. Now fill the 3L jug fully and empty it into the 5L jug so you will now have 4 liters of water
in 5L jug.
That's how you get 4litres of water.
13.2. I give you 4 tablets which contain 2 for fever and 2 for cold, all the same
size, shape, taste, weight and color, no cover. You have to take 1 cold and 1
fever tablet right now. How will you choose correctly?
Answer
So basically, you have 4 tablets. 2 for cold and other 2 for fever. Now start dividing the
tablets into half. Keep one half in your hand and other half on table. Once you are
done dividing all the tablets into half, take either of them. Problem solved.
13.3. There is a room with a door (closed) and three light bulbs. Outside the
room, there are three switches, connected to the bulbs. You may manipulate
the switches as you wish, but once you open the door you can’t change them.
Identify each switch with its bulb. All bulbs are in working condition.
Answer
Answer
Firstly, break each of the pills in half, and as you do this pop one half in your mouth
and lay the other half aside for tomorrow. When he’s done this with all four pills he will
have consumed one red pill and one blue pill. And have the same leftover.
13.5. A car has 4 tyres and 1 spare tyre. Each tyre can travel a maximum distance
of 20000 miles before wearing off. What is the maximum distance the car can
travel before you are forced to buy a new tyre? You are allowed to change
tyres (using the spare tyre) an unlimited number of times.
Answer
3. 15000 KMs: Put B back to its original position and replace C with S.
Answer
On the back of 45, it is 46. The pages are such that for each page p, 65-p
will be also on the same page.
Then,
65-45 = 20
65-46 = 19
So, the four pages in this sheet are 19, 20, 45, 46.
13.7. You have a birthday cake and have to cut it into 8 equal pieces by making 3
cuts only. How do you do it?
Answer
Step 1: Cut the cake into quarters (4 pieces) using 2 of the cuts – one
horizontally down the center of the cake and the other vertically down the
center of the cake. This will leave you with 4 pieces (or slices) of cake.
Prepared by: Mr. Umar Arshad | Software Quality Assurance Engineer
Step 2: Then take all 4 pieces and arrange them in a stack that is 4 pieces
high.
Step 3: Finally, you can just cut that stack of 4 pieces in half – using your third
and final cut – and then you will end up with 8 pieces of cake!
13.9. A Lady (L) bought an item of Rs 100 from the Shopkeeper (C). She paid him
through a 500 Rs Note. Realizing that he did not have change, the shopkeeper
C got change for that note from another shopkeeper (S) and paid Rs 400 to
the Lady.
After a few days, S realized that the note is fake, And this railed at C and took
500 Rs back from him.
So in this whole process how much money did C loose in the end?
Answer: 500
This is based on the user perspective for the perfect solution based on the situation
where in it is used.
This is because each of the n people can shake hands with n - 1 people (they would
not shake their own hand), and the handshake between two people is not counted
twice.
This formula can be used for any number of people. For example, with a party of 5
people, find the number of handshakes possible.
# handshakes = 5*(4)/2.
# handshakes = 20/2.
# handshakes = 10
13.12. You have 9 balls, equally big, equally heavy - except for one, which is a little
heavier.
How would you identify the heavier ball if you could use a pair of balance
scales only twice?
ANS:
Divide the 9 balls into 3 groups of 3. Compare the weight of two of those groups.
The heavier group should then be obvious, it will either tip the scales, or, if the scales
stay balanced, then it is the group you didn't include.
Now, choose 2 balls from this group and compare their weights, and using the same
logic as before, the heavier ball will be obvious.