SQA Interview Preparation by Umar Arshad
SQA Interview Preparation by Umar Arshad
Functional Testing
Non-Functional Testing
Agile
Database + SQL
OOP
Automation Testing
The Software Development Lifecycle is a systematic process for building software that ensures
the quality and correctness of the software built. SDLC process aims to produce high-quality
software which meets customer expectations. The software development should be complete
in the pre-defined time frame and cost.
Why SDLC?
Here, are prime reasons why SDLC is important for developing a software system.
1. Requirements Gathering/Analysis.
This is a process with much communication taking place between stakeholders, end
users and the project team. Meetings with managers, stake holders and users are held
in order to determine the requirements like; who is going to use the system? How will
they use the system? What data should be input into the system? What data should be
output by the system? These are general questions that get answered during a
requirement gathering phase. The QA engineer playing the role to configure the
requirements using requirements traceability matrix.
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. 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.
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,
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.
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.
V-Model
Spiral Model
The spiral model is a risk-driven process model. This SDLC model helps the team to adopt
elements of one or more process models like a waterfall, incremental, waterfall, etc.
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.
Software Testing reduces the probability of undiscovered defects remaining in the software
but even if no defects are found, it is not a proof of correctness.
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.
3. Early testing
4. Defect clustering
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.
5. Pesticide Paradox
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.
It is the testing process which is executed in systematic and planned manner. In STLC process,
different activities are carried out to improve the quality of the product.
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
Act - A Quality Assurance tester should implement actions that are necessary to achieve
improvements in the processes
Quality assurance system standards, including ISO 9001, are defined as frameworks that
provide regulations to organizations to ensure that their processes, inputs, products, and
services are capable of meeting every customer requirement.
While verification is concerned with whether the system is well-engineered, error-free, and so
on. Verification will help to determine whether the software is of high quality, but it will not
ensure that the system is useful. Verification includes all the activities associated with the
producing high quality software: testing, inspection, design analysis, specification analysis, and
so on. It is a relatively objective process.
Static Testing involves in reviewing the documents to identify the defects in the early stages of
SDLC.
Dynamic testing involves in the execution of code. It validates the output with the expected
outcome.
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.
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.
Positive Testing: It is to determine what system supposed to do. It helps to check whether
the application is justifying the requirements or not.
Negative Testing: It is to determine what system not supposed to do. It helps to find the
defects from the software.
Test plan document is a document which contains the plan for all the testing activities to be
done to deliver a quality product. Test Plan document is derived from the Product Description,
SRS, or Use Case documents for all future activities of the project. It is usually prepared by the
Test Lead or Test Manager.
Test Suite is a collection of test cases. The test cases which are intended to test an application.
Test Scenario gives the idea of what we have to test. Test Scenario is like a high-level test case.
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.
A test harness is the collection of software and test data configured to test a program unit by
running it under varying conditions which involves monitoring the output with expected output.
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.
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)
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.
Repeated testing of an already tested program, after modification, to discover any defects
introduced or uncovered as a result of the changes in the software being tested or in another
related or unrelated software components.
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.
Perform abnormal action on the application deliberately in order to verify the stability of the
application.
Top down and bottom up are carried out by using dummy modules known as Stubs and Drivers.
These Stubs and Drivers are used to stand-in for missing components to simulate data
communication between modules.
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.
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.
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.
Non-Functional Testing
What is Performance Testing? imp
It is to verify that the system/application can handle the expected number of transactions and
to verify the system/application behavior under both normal and peak load conditions.
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.
Bucket or Split testing is a method to compare two versions of an application against each other
to determine which one performs better.
Defect cascading in Software testing means triggering of other defects in an application. When
a defect is not identified or goes unnoticed while testing, it invokes other defects. It leads to
multiple defects in the later stages and results in an increase in a number of defects in the
application.
For example, if there is a defect in an accounting system related to negative taxation then the
negative taxation defect affects the ledger which in turn affects other reports such as Balance
Sheet, Profit & Loss etc.,
A walkthrough is an informal meeting conducts to learn, gain understanding, and find defects.
The author leads the meeting and clarifies the queries raised by the peers in the meeting.
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.
We can’t compile or run a program due to a coding mistake in a program. If a developer unable
to successfully compile or run a program, then they call it as an error.
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 up next
based on the priority. It can be High, Medium or Low. Most of the times the priority status is set
based on the customer requirement.
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 affects 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.
Standalone application:
Client-Server Application:
Client-server applications follow two-tier architecture. Presentation and Business layer are in a
client system and Database layer on another server. It works majorly in Intranet.
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.
Bug life cycle is also known as Defect life cycle. In Software Development process, the bug
has a life cycle. The bug should go through the life cycle to be closed. Bug life cycle varies
depends upon the tools (QC, JIRA etc.,) used and the process followed in the organization.
1. New: When a defect is logged and posted for the first time. Its state is given as new.
2. Assigned: After the tester has posted the bug, the lead of the tester approves that the
bug is genuine and he assigns the bug to corresponding developer and the developer
team. Its state given as assigned.
3. Open: At this state the developer has started analyzing and working on the defect fix.
4. Fixed: When developer makes necessary code changes and verifies the changes then
he/she can make bug status as ‘Fixed’ and the bug is passed to testing team.
5. Pending retest: After fixing the defect the developer has given that particular code for
retesting to the tester. Here the testing is pending on the testers end. Hence its status is
pending retest.
6. Retest: At this stage the tester does the retesting of the changed code which developer
has given to him to check whether the defect got fixed or not.
7. Verified: The tester tests the bug again after it got fixed by the developer. If the bug is
not present in the software, he approves that the bug is fixed and changes the status to
“verified”.
8. Reopen: If the bug still exists even after the bug is fixed by the developer, the tester
changes the status to “reopened”. The bug goes through the life cycle once again.
9. Closed: Once the bug is fixed, it is tested by the tester. If the tester feels that the bug no
longer exists in the software, he changes the status of the bug to “closed”. This state
means that the bug is fixed, tested and approved.
10. Duplicate: If the bug is repeated twice or the two bugs mention the same concept of the
bug, then one bug status is changed to “duplicate “.
A bug which is actually missed by the testing team while testing and the build was released to
the Production. If now that bug (which was missed by the testing team) was found by the end
user or customer, then we call it as Bug Leakage.
Releasing the software to the Production with the known bugs then we call it as Bug Release.
These known bugs should be included in the release note.
Defect age can be defined as the time interval between date of defect detection and date of
defect closure.
Assume, a tester found a bug and reported it on 1 Jan 2016 and it was successfully fixed on 5
Jan 2016. So the defect age is 5 days.
Error seeding is a process of adding known errors intendedly in a program to identify the rate of
error detection.
A showstopper defect is a defect which won’t allow a user to move further in the application.
It’s almost like a crash.
Assume that login button is not working. Even though you have a valid username and valid
password, you could not move further because the login button is not functioning.
What is HotFix?
A bug which needs to handle as a high priority bug and fix it immediately.
Testing Techniques
What is Boundary Value Analysis? imp
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.
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
Equivalence Partitioning or Equivalence Class Partitioning is type of black box testing technique
which can be applied to all levels of software testing like unit, integration, system, etc. In this
technique, input data units are divided into equivalent partitions that can be used to derive test
cases which reduces time required for testing because of small number of test cases.
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.
Submit
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.
The prerequisites that must be achieved before commencing the testing process.
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).
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.
There are many factors involved in the real-time projects to decide when to stop testing.
Testing should provide enough information about the status or health of an application, so the
stakeholders can make an informed decision on whether to release the software or spend more
time on testing.
The following questions contain short answers to provide quick hints to some ISTQB Interview
Questions.
Audit: An audit is the examination of the work products and related information to
assesses whether the standard process was followed or not.
1. Functional testing
Testing is done by certifying the requirements. like whether the application is working
based on the requirements or not.
This is an 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.
- Device emulators are cost effective and they come in handy during the initial development
phase.
- But, to test the real-life scenarios, physical devices are the must. Both emulators and
physical devices are to be used in a balanced manner for an optimized result.
This testing is done mostly in the form of two matrices of OS Vs app and Device model Vs
app. Usually, a list of supported OS (and sometimes devices) is provided by the product
owner or customer.
4. Interface Testing
This testing is done after all the modules of the app are completely developed, tested
individually and all the bugs are fixed verified.
5. Network Testing
During this testing, request/response to/from the service is tested for various conditions.
This test is mainly done to verify the response time in which the activity is performed like
refreshing data after sync or loading data after login etc.
6. Performance Testing
7. Installation/Uninstallation testing
This is to ensure smooth installation and uninstallation of the application without ending up
in errors, partial installation etc.
8. Security Testing
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.
9. Field testing
Field testing is done specifically for the mobile data network and not in-house but by going
out and using the app as a normal user.
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:
Agile Testing
Q #1) What is Agile Testing?
Answer: Agile Testing is a practice that a QA follows in a dynamic environment where
testing requirements keep changing according to customer needs. It is done parallel to the
development activity where the testing team receives frequent small codes from the
development team for testing.
Q #6) Explain the difference between a traditional Waterfall model and Agile testing?
Answer: Agile testing is done parallel to the development activity whereas a traditional
waterfall model testing is done at the end of the development.
As done in parallel, agile testing is done on small features whereas, in a waterfall model,
testing is performed on the whole application.
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.
At the beginning of every Sprint, Sprint planning meeting is held. Usually, the entire team is
expected to be present during this meeting, including the product owner and the Scrum
Daily Scrum meeting, or daily standups – as many people call them, are short 15 minutes
meetings which occur on daily basis. They are typically held at the same time and same
place every day and are strictly time boxed to no longer than 15 minutes. This ensures the
discussion to stay light, relevant, and quick.
At the end of each Sprint, a Sprint Review meeting is held. The core objective of this
meeting is to demonstrate the functionality of the product and what has been achieved
during a particular Sprint. Generally, product owner, Scrum Master, and other stakeholders
are present to review the product.
A retrospective is a meeting held after a product ships to discuss what happened during the
product development and release process, with the goal of improving things in the future
based on those learnings and conversations.
I Hope, these questions will help you in preparing for the Agile testing and methodology
interview.
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.
3-tier Architecture
A 3-tier architecture separates its tiers from each other based on the complexity of the users
and
how they use the data present in the database. It is the most widely used architecture to design
a DBMS.
Database Data Tier − At this tier, the database resides along with its query processing
languages. We also have the relations that define the data and their constraints at this level.
Application Middle Tier − At this tier reside the application server and the programs that
access the database. For a user, this application tier presents an abstracted view of the
database. End-users are unaware of any existence of the database beyond the application.
At the other end, the database tier is not aware of any other user beyond the application tier.
Hence, the application layer sits in the middle and acts as a mediator between the end-user
and the database.
User Presentation Tier − End-users operate on this tier and they know nothing about any
existence of the database beyond this layer. At this layer, multiple views of the database can
be provided by the application. All views are generated by applications that reside in the
application tier.
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
c) DCL (Data Control Language): These statements are used to set privileges such as
GRANT and REVOKE database access permission to the specific user.
Q #4) How do we use the DISTINCT statement? What is its use?
Answer: 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;
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;
FROM table_name
GROUP BY column_name
HAVING condition;
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:
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);
Q #6) Why do we use SQL constraints? Which constraints we can use while creating
a database in SQL?
Answer: 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.
4 major types of Joins are used while working on multiple tables in SQL databases:
FROM table_name1
ON column_name1=column_name2;
For Example,
In this example, we have a table Employee with the following data:
FROM Employee
ORDER BY Employee.Emp_id;
ON column_name1=column_name2;
For Example,
In this example, we have a table Employee with the following data:
FROM Employee
ON Employee.Emp_id = Joining.Emp_id
ORDER BY Employee.Emp_id;
RIGHT JOIN (RIGHT OUTER JOIN): This joins returns all rows from the RIGHT table and
its matched rows from the LEFT table.
Syntax:
SELECT column_name(s)
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;
Output:
Emp_id Joining_Date
E0012 2016/04/18
E0013 2016/04/19
E0014 2016/05/01
FULL JOIN (FULL OUTER JOIN): This joins returns all results when there is a match either
in the RIGHT table or in the LEFT table.
Syntax:
SELECT column_name(s)
ON column_name1=column_name2;
For Example,
In this example, we have a table Employee with the following data:
FROM Employee
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.
Syntax:
CREATE TRIGGER name {BEFORE|AFTER} (event [OR..]}
SELECT column_name(s)
FROM table_name
WHERE condition
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.
REVOKE command: This command is used to provide database deny or remove access to
database objects.
Syntax:
REVOKE privilege_name
ON object_name
FROM {user_name|PUBLIC|role_name};
Q #29) What is the difference between Nested Subquery and Correlated Subquery?
Answer: Subquery within another subquery is called Nested Subquery. If the output of a
subquery depends on column values of the parent query table then the query is called
Correlated Subquery.
SELECT adminid(SELEC Firstname+' '+Lastname FROM Employee WHERE
The result of the query is the details of an employee from the Employee table.
(
)
AS
BEGIN
END
Further, we can also create a Unique Index using the following syntax:
WHERE <Condition>
How often does the test need to be executed? i.e. is that going to be a regression test?
Sometimes the test will need to be executed once, but with a large set of data.
How much time does automating this test will save me so that I can use my time in
exploratory testing.
How important is the test to the business; i.e. is the test scenario a typical user journey
through the application.
How complex is it to automate the test and how likely is it that the complexity doesn’t
cause many false positives which increases results analysis time?
How likely is it that a feature or functionality will break and what is the impact of it on
the business? If it is high impact, then it should be automated to ensure it passes from
release to release
Tests that only need to be executed once – unless the same test needs to be executed
for a large dataset then it makes sense to automate.
Tests without predictable results – test automation should give us confidence in the
results of the tests. If there are intermittent failures then the tests cannot be reliable and
cannot be dependent on.
Tests that need to be executed quickly. At first, writing an automated test takes longer. If
we want a quick check, we should test manually, however, if that test is a good one which
should be run regularly, then it should be automated in time
UI automated tests execute in a way that simulates a user interacting with the system. So
it is very good for validating user journeys and flows
Can cover end-to-end flows that communicate with 3rd party systems
Because tests are run against the system, they can be shown to the customer who can
understand what tests are run
Cons:
UI automated tests can be very brittle (i.e. fail due to UI changes even though
functionality hasn’t changed).
Slow feedback to the team. Execution is slow as you have to wait for the system to
launch and connections with 3rd party system can take a long time.
Limitation on what can be checked from the UI. There is some information that is not
present from the UI.
Because tests are slow from UI, we can’t have a lot of tests running against the UI.
Improve quality?
Here the focus is on testing at the system level, tests which cannot be done without a
fully integrated system.
Sign in with valid login, Close browser and reopen and see whether you are still logged
in or not.
Sign in, then log out and then go back to the login page to see if you are truly logged
out.
Log in, then go back to the same page, do you see the login screen again?
Sign in with one browser, then open another browser to see if you need to sign in again?
Log in, change the password, and then log out, then see if you can log in again with the
old password.
Two types of testing which are very important for testing web applications
are Performance Testing and Security Testing. The difference between a web application
and desktop application is that web applications are open to the world, with potentially
many users accessing the application simultaneously at various times, so load testing
and stress testing are important.
Web applications are also vulnerable to all forms of attacks, mostly DDOS, so security
testing is also very important to consider when testing web applications.
Suppose you search for a product on Amazon.com website. On the search results page,
you will see a list of items related to your search. How can you verify that the results that
you see are really the ones that you are supposed to see?
The answer to this question is rather simple. At first instance, we need to know where
the data is coming from. Are they coming from a database? Or some XML files from 3rd
party websites?
Once we have this information, we can start comparing the results we see on the result
page with the results from the source, e.g. database.
Another option is to use mocks to generate the data that we need so we can fully
control the data that we see on the search results page.
Other important factors that come to play are testing on multiple browsers, multiple
devices, redirection, and responsiveness.
Also, we should not forget about Javascript, CSS, Cookies, W3C standards, traffic
monitoring, third-party tags testing, all of which are important in Web Application
Testing.
The location of the display of error messages, their color and font should be tested at
login web page. Also, if applicable, Javascript and Cookie tests needs to be tested at front-
end login page.
There are many ways to test a website and there could be lots
of test cases to execute, how can you make sure the web
application is fit for release?
We can Automate majority of test cases, but most importantly we can use test
techniques such as Pair-wise testing to reduce combinations and/or model-based testing
to plan user journeys to ensure major functionality of web application works.
We can also use analytics to gain insight into what users do on the website, which page
is most popular and which feature is most used by users.
API Testing
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.
Q #8) What are the tools used for API test automation?
Answer: 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.
Q #9) What is the API framework?
Answer: 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.
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.
Request Method – Get, Post, Put, Delete (these are the common ones)
Response Body – this is the data that comes back to the client from the server
Hope this article will be very helpful for your API Testing interview preparation.
Selenium WebDriver
Q #1) What is Automation Testing?
Automation testing or Test Automation is a process of automating the manual process to
test the application/system under test. Automation testing involves the use of a separate
testing tool which lets you create test scripts which can be executed repeatedly and doesn’t
require any manual intervention.
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.
1. Functional Testing
2. Regression Testing
Q #6) What are the limitations of Selenium?
Following are the limitations of Selenium:
Object Oriented Selenium IDE is not an Selenium RC is semi object WebDriver is a purely
object oriented tool oriented tool. object oriented tool
Handling Alerts, Selenium IDE doesn't Selenium RC doesn't WebDriver offers a wide
Navigations, explicitly provides aids explicitly provides aids to range of utilities and
Dropdowns to handle alerts, handle alerts, navigations, classes that helps in
navigations, dropdowns dropdowns. handling alerts,
navigations, and
dropdowns efficiently and
effectively.
Listener Support Selenium IDE doesn't Selenium RC doesn't WebDriver supports the
support listeners support listeners. implementation of
Listeners
Origin is a sequential combination of scheme, host, and port of the URL. For example, for a
URL https://www.softwaretestinghelp.com/resources/, the origin is a combination of http,
softwaretestinghelp.com, 80 correspondingly.
Thus the Selenium Core (JavaScript Program) cannot access the elements from an origin
that is different from where it was launched. For Example, if I have launched the JavaScript
Program from “https://www.softwaretestinghelp.com”, then I would be able to access the
pages within the same domain such as “https://www.softwaretestinghelp.com/resources” or
“https://www.softwaretestinghelp.com/istqb-free-updates/”. The other domains like
google.com, seleniumhq.org would no more be accessible.
So, In order to handle the same origin policy, Selenium Remote Control was introduced.
Q #15) When should I use Selenium Grid?
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.
Q #16) What do we mean by Selenium 1 and Selenium 2?
Selenium RC and WebDriver, in a combination, are popularly known as Selenium 2.
Selenium RC alone is also referred to as Selenium 1.
Q #17) Which is the latest Selenium tool?
WebDriver
FirefoxDriver
InternetExplorerDriver
ChromeDriver
SafariDriver
OperaDriver
AndroidDriver
IPhoneDriver
HtmlUnitDriver
Q #20) What are the different types of waits available in WebDriver?
There are two types of waits available in WebDriver:
1. Implicit Wait
2. Explicit Wait
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.
Q #21) How to type in a textbox using Selenium?
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”);
Q #22) How can you find if an element in displayed on the screen?
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();
Q #23) How can we get a text of a web element?
Syntax:
String Text = driver.findElement(By.id(“Text”)).getText();
Q #24) 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);
Q #25) What are the different types of navigation commands?
Following are the navigation commands:
navigate().back() – The above command requires no parameters and takes back the user
to the previous webpage in the web browser’s history.
Sample code:
driver.navigate().back();
navigate().forward() – This command lets the user to navigate to the next web page with
reference to the browser’s history.
Sample code:
driver.navigate().forward();
navigate().refresh() – This command lets the user to refresh the current web page there by
reloading all the web elements.
Sample code:
driver.navigate().refresh();
navigate().to() – This command lets the user to launch a new web browser window and
navigate to the specified URL.
Sample code:
driver.navigate().to(“https://google.com”);
Q #26) How to click on a hyper link using linkText?
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();
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();
Q #28) When do we use findElement() and findElements()?
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”));
Q #29) How to find more than one web element in the list?
At times, we may come across elements of the same type like multiple hyperlinks, images
etc arranged in an ordered or unordered list. Thus, it makes absolute sense to deal with
such elements by a single piece of code and this can be done using WebElement List.
Sample Code
// Storing the list
serviceProviderLinks.get(i).click();
// Navigating back to the previous page that stores link to service providers
driver.navigate().back();
Sample Code:
// Instantiating Action Interface
subLinkOption.click();
Syntax:
driver.findElement(By.id(“id“)).getCssValue(“name of css attribute”);
driver.findElement(By.id(“id“)).getCssValue(“font-size”);
Q #37) How to capture screenshot in WebDriver?
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class CaptureScreenshot {
WebDriver driver;
@Before
driver.get("https://google.com");
@After
driver.quit();
@Test
Q #38) What is Junit?
Junit is a unit testing framework introduced by Apache. Junit is based on Java.
Q #39) What are Junit annotations?
Following are the JUnit Annotations:
@Test: Annotation lets the system know that the method annotated as @Test is a
test method. There can be multiple test methods in a single test script.
@Before: Method annotated as @Before lets the system know that this method
shall be executed every time before each of the test methods.
@After: Method annotated as @After lets the system know that this method shall be
executed every time after each of the test method.
@BeforeClass: Method annotated as @BeforeClass lets the system know that this
method shall be executed once before any of the test methods.
@AfterClass: Method annotated as @AfterClass lets the system know that this
method shall be executed once after any of the test methods.
@Ignore: Method annotated as @Ignore lets the system know that this method shall
not be executed.
Q #40) What is TestNG and how is it better than Junit?
TestNG is an advanced framework designed in a way to leverage the benefits by both the
developers and testers. With the commencement of the frameworks, JUnit gained
enormous popularity across the Java applications, Java developers and Java testers with
remarkably increasing the code quality. Despite being easy to use and straightforward,
JUnit has its own limitations which give rise to the need of bringing TestNG into the picture.
TestNG is an open source framework which is distributed under the Apache Software
License and is readily available for download.
import org.testng.annotations.*;
@Test(priority=0)
@Test(priority=1)
@Test(priority=2)
1 JXL supports “.xls” format i.e. binary based format. POI jar supports all of these
JXL doesn’t support Excel 2007 and “.xlsx” format i.e. formats
XML based format
2 JXL API was last updated in the year 2009 POI is regularly updated and
released
3 The JXL documentation is not as comprehensive as POI has a well prepared and
that of POI highly comprehensive
documentation
4 JXL API doesn’t support rich text formatting POI API supports rich text
formatting
5 JXL API is faster than POI API POI API is slower than JXL API
Browser Selenium supports almost all the QTP supports Internet Explorer,
Compatibility popular browsers like Firefox, Chrome, Firefox and Chrome. QTP only
Safari, Internet Explorer, Opera etc supports Windows Operating System
Application Selenium supports testing of only web QTP supports testing of both the web
under Test based applications based application and windows based
application
Vendor As Selenium is a free tool, user would Users can easily get the vendor’s
Support not get the vendor’s support in support in case of any issue
troubleshooting issues
In Selenium, objects can be stored in an excel sheet which can be populated inside the
script whenever required.
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.
Hope in this article you will find answers to most frequently asked Selenium and WebDriver
Interview questions. The answers provided here are also helpful for understanding the
Selenium basics and advanced WebDriver topics.
Jmeter
Q #1) Explain the architecture of JMeter.
Answer: Jmeter is a Java-based open-source application that is basically designed for the
purpose of Load Testing. It supports all major protocols that are supported in Load Runner.
Unlike any browser, JMeter works on levels of protocols and does not execute JavaScript
present in HTML web pages.
It has more technical capabilities. Less technically sound as compared to Load Runner.
Supports SAP, Siebel and Peoplesoft. Doesn’t support SAP and Siebel
Q #10) What is the use of co-relation in JMeter?
Answer: 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, if you want to get the machine IP stored in a machineIP variable, you can
use the string ${__machineIP(machineIP)}.
Q #17) Why is it recommended to run JMeter in GUI mode?
Answer: 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
Q #18) Is it possible to run selenium scripts in JMeter? If yes, how?
Answer: 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.
Q #20) What are the important steps for testing JDBC request?
Answer: 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.
Q #21) What is BeanShell scripting?
Answer: BeanShell is a lightweight Java scripting that is used in JMeter to perform some
complex task. BeanShell sampler can perform various functions with the use of coding. You
can print the thread number, get the current sampler executed, fetch the cookies, etc.
Q #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?
Answer: No, JMeter does not measure the transition time between the screens. It can only
measure the server actions not the UI interactions.
Q #23) What is a Root CA certificate?
Answer: HTTPS connection requires a certificate to authenticate the connections which get
established when the browser hits the webserver. JMeter generates it temporarily to
intercept the SSL traffic in order to record the actions. For recording actions via mobile, you
need to have this certificate on your mobile to record the actions.
Q #24) Which factors decide the maximum threads that one should generate per
system?
Answer: It depends on the hardware of the system.
For Example, on a 2-3 GHz CPU, 400-600 threads can be generated. It also depends on
the components in your test plan. More the processors and XML parsing elements, the
more the CPU load and hence fewer threads. For high load, it is recommended to use
multiple machines for load testing.
Q #25) What is a Workbench and why is it required?
Answer: Workbench is a storage area for adding some components which can be added to
the test plan if required.
Components of workbench do not get saved with the test plan automatically. They have to
be saved separately as test fragments. A most important part of the Workbench is HTTP(s)
Test script recorder which is highly useful in recording the https request and later load can
be applied to+9859 them to measure the response time.
Conclusion
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.
Aptitude Questions
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.
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?
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.
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.
4. A blind man is alone on a deserted island. He has two blue pills and two red
pills. He must take exactly one red pill and one blue pill or he will die.
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.
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.
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.
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?
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.
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!
L:O
R:I
E:V
M:?
Solution : N, because if we assign the values as A=1, B=2…..Z=26, then each pair adds
upto 27.
example : L O
12+15 = 27.
And for M:N
13+14=27
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