Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

QA Interview Exercises

QA Testing

Your team has been asked to test a gumball machine. List some test cases you would suggest
assuming typical functionality.

Optessa Confidential
QA Interview Exercises

SQL

1. Given the following tables:

a) Write a select statement to return all unique SALESORDER_FEATURE.SF_FEATURE


values.

b) Write a select statement to find the total SO_QUANTITY for all sales orders with
SO_PART = “ABC”.

c) Write a select statement to return the total SO_QUANTITY for all sales orders with
SO_PART = “ABC” that have a child table entry for SF_FEATURE = “COLOR” and
SF_VALUE = “RED”.

Optessa Confidential
QA Interview Exercises

2. Given 2 tables created as follows:

CREATE TABLE testA (id int);


INSERT INTO testA (id) VALUES
(10),
(20),
(30),
(40),
(50);

CREATE TABLE testB (id int);


INSERT INTO testB (id) VALUES
(10),
(30),
(50);

a) How many records does the following statement return?

SELECT a.id
FROM testA a
INNER JOIN testB b ON a.id = b.id

b) How many records does the following statement return?

SELECT a.id
FROM testA a
LEFT OUTER JOIN testB b ON a.id = b.id

Optessa Confidential
QA Interview Exercises

HTML/CSS

Describe which elements in an HTML page would be associated with the follow CSS snippets:

a) div.formContainer

b) #btnSubmit

c) .center, .east, .west, .south

d) table.dataGrid td

e) #results > span

Optessa Confidential
QA Interview Exercises

Programming Logic

Here is a Java method that prints the numbers from 1 to 25:

How would you adjust the logic inside the loop (pseudocode is acceptable) so it prints the
numbers from 1 to 25 but with the following exceptions:

• For any number that is a multiple of 3 print “Three” instead of the number
• For any number that is a multiple of 4 print “Four” instead of the number
• For any number that is a multiple of both 3 and 4 print “Both” instead of the number

The output should be something like:

1
2
Three
Four
5
Three
7

Optessa Confidential
QA Interview Exercises

General Logic

There are 2 jobs (J1 and J2) each consisting of 2 operations (O1 and O2). A job’s second
operation can only start after the first one is complete. An operation cannot be pre-empted (no
break once it has been started).

There are 2 machines (M1 and M2) that can be used for these jobs. The processing time of each
operation and the possible machines that it can be performed on are described in the table below.

Job Operation Possible Machines


J1 O1 M1 (2 hours) or M2 (3 hours)
J1 O2 M1 (2 hours) or M2 (2 hours)
J2 O1 M1 (1 hour)
J2 O2 M2 (4 hours)

How would you schedule the jobs such that they complete as early as possible? Starting at hour
0 give the start and end time of each operation on each machine.

Optessa Confidential
QA Interview Exercises

Selenium

The provided SamplePage.html web page has the following behaviour:

• The user can enter text into the Input textbox


• If the user clicks the Save button any text in the Input textbox is copied into the Output
area (replacing any existing content)
• The copied text is displayed in red in the Output area if its length exceeds 10
characters while it is displayed in green if its length is 10 characters or less
• The Save button is automatically disabled after the user clicks it 4 times

You have been asked to create a Java-based test class to automate the testing of this page using
Selenium WebDriver and TestNG.

Assuming the following code is being used to instantiate the WebDriver:

a) Write a line of code that enters text into the Input textbox

b) Write a line of code that clicks the Save button

c) Write a line of code that asserts the content of the Output area matches an expected
value

Optessa Confidential
QA Interview Exercises

d) Write a line of code that asserts the colour of the text in the Output area matches an
expected value

e) Write a line of code that asserts the Save button is disabled

Optessa Confidential

You might also like