// Interview Prep/Practice Labs

Interview Prep → Practice Labs

Practice labs.

Short, focused QA drills — 5 to 15 minutes each. Train one skill at a time: test design, locators, API checks, bug reports, automation smells, exploratory. Read the prompt, work it out, then reveal a model answer. No setup, no scoring — just reps.

72 drills · 9 skills · free · no signup

// TODAY'S DRILL

⚡ Today's drillLocatorsMid8 min

Write locators for an accessible form using ARIA

A contact form has <label for='email'> associated with an email input, aria-describedby pointing to a hint paragraph on that field, and a <fieldset> with <legend>Newsletter</legend> containing checkboxes. Write Playwright locators for: the email input, a specific checkbox inside the fieldset, and the submit button. Explain why these locators also verify accessibility.

// FULL LIBRARY · 72 DRILLS

72 drills

Test designBeginner8 min

Write test cases for a login form

You are testing a login form with username and password fields, a 'Remember me' checkbox, and a 'Forgot password?' link. Write a set of test cases covering the main positive and negative paths. For each case describe: the input, the expected result, and why it matters.

Test designBeginner8 min

Test cases for a file upload field

A web form has a file upload field that accepts images only (JPEG, PNG, GIF). The maximum file size is 5 MB. Files are stored in cloud storage and a thumbnail is shown after upload. List the test cases you would run, covering valid uploads, invalid file types, size limits, and edge cases.

Test designMid10 min

Boundary analysis for a search results page

A search results page shows up to 20 results per page with pagination. The search query must be between 2 and 200 characters. Identify the boundary values for both the query length and results-per-page behaviour, and describe the expected outcome at each boundary.

Test designMid12 min

Decision table for a checkout payment flow

A checkout flow accepts Visa, Mastercard, and PayPal. Cards require a CVV and expiry date. Orders over £100 get a 10% loyalty discount; logged-in users get an additional 5% off. Build a decision table capturing the discount conditions and their combined outcomes. Then list the test cases you would derive from it.

Test designSenior15 min

State transition testing for a password reset flow

A password reset flow has these states: (1) Reset requested, (2) Email sent, (3) Link opened, (4) New password set, (5) Link expired. Describe the state transition diagram in text, then identify the tests covering each valid and invalid transition.

LocatorsBeginner7 min

Fix a fragile absolute XPath selector

A Selenium test clicks a Submit button using this locator: driver.findElement(By.xpath('/html/body/div[3]/div[1]/form/div[5]/button[2]')) The test breaks every time the page layout changes. Identify why it is fragile and rewrite it using a more stable strategy.

LocatorsMid8 min

Handle dynamically generated element IDs

Your app renders a list of product cards. Each 'Add to cart' button has an ID like btn-add-cart-4f8a2c, where the hex suffix is regenerated on every page load. Your locator By.id('btn-add-cart-4f8a2c') broke after a deployment. How do you handle this situation?

LocatorsMid8 min

Choose between getByRole, getByText, and data-testid in Playwright

You are writing Playwright tests for a checkout page. The page has a 'Proceed to payment' button, a paragraph showing the order total, and an order summary table. For each element, explain which Playwright query method you would use and why.

LocatorsSenior10 min

Locate elements inside shadow DOM in Playwright

A payment form uses a custom web component <payment-widget> that renders a card number input inside its shadow root. Standard page.locator('#card-number') returns no elements. Describe how shadow DOM encapsulation works and explain how to locate the input in Playwright.

LocatorsSenior10 min

Select elements inside an iframe

A payments page embeds a third-party card form inside an iframe pointing to an external domain. Your Playwright test cannot interact with the card number input using page.locator(). Explain the iframe boundary and show the correct approach.

API checksBeginner7 min

Assert a GET /users/{id} response

A REST API returns this response for GET /users/42: { "id": 42, "name": "Alice", "email": "alice@example.com", "role": "admin", "createdAt": "2024-01-15T10:30:00Z" } List the assertions you would write for the happy path and for a 404 case. Explain what each assertion proves.

API checksBeginner8 min

Assertions for a POST /users create endpoint

A POST /users endpoint creates a new user. The request body is { "name": "Bob", "email": "bob@example.com", "role": "viewer" }. Describe the assertions you would write for: a successful creation, a duplicate email attempt, and a missing required field.

API checksMid10 min

Auth and negative test coverage for a protected endpoint

GET /orders is a protected endpoint requiring a Bearer token. Describe the auth-related negative tests you would write, covering missing auth, expired tokens, wrong roles, and tampered tokens.

API checksMid12 min

Schema and contract validation for an API response

Your team just shipped a new /products endpoint. A frontend team depends on the exact response shape. Describe how you would write schema and contract tests, what tools you would use, and what changes would constitute a breaking change.

API checksSenior12 min

Test idempotency and pagination for a collection endpoint

GET /transactions?page=1&limit=50 returns a paginated list. The API also exposes DELETE /transactions/{id}. Describe tests for: correct pagination behaviour, idempotency of GET, and the consequences of calling DELETE twice on the same resource.

Bug reportsBeginner8 min

Identify what is missing from this bug report

A tester filed this report: Title: Login broken Description: The login page doesn't work. I tried to log in and it showed an error. Please fix ASAP. Identify everything that is missing and explain the impact each gap has on the developer trying to fix it.

Bug reportsBeginner7 min

Classify severity and priority for four bugs

Classify each bug by severity and priority, and explain your reasoning: 1. The checkout 'Place order' button is invisible on mobile Safari. 2. A spelling mistake on the About page ('Welcme to our site'). 3. The admin panel crashes when a user role is edited. 4. The dark mode toggle remembers the wrong preference after logout.

Bug reportsMid8 min

Write a precise bug report title

Rewrite each vague title into a precise, actionable bug title: 1. 'Button broken' 2. 'Error on upload' 3. 'Profile page wrong' 4. 'App crashes' Then explain what makes a good bug title.

Bug reportsMid8 min

Choose the right evidence to attach to a bug report

You found a bug: when a user with a Japanese locale setting places an order, the order total displays as '¥0' instead of the correct amount. What evidence should you attach to maximise the developer's ability to diagnose and fix this without needing to ask you questions?

Bug reportsSenior10 min

Write high-quality reproduction steps

You found a bug: the 'Export to CSV' button in the admin dashboard produces an empty CSV when filtering by date range (last 7 days). Write the reproduction steps for the bug report. Then explain what makes reproduction steps high quality.

Automation smellsBeginner7 min

Fix a flaky sleep-based wait

A Selenium test has this code: driver.findElement(By.id("submit-btn")).click(); Thread.sleep(3000); String text = driver.findElement(By.id("success-message")).getText(); Explain why this is a smell and show the correct fix.

Automation smellsBeginner8 min

Identify and fix test interdependence

A test suite has three tests that must run in order: 1. test_create_user — creates a user and stores the ID in a shared variable. 2. test_update_user — uses the shared ID to update the user's name. 3. test_delete_user — uses the shared ID to delete the user. What are the risks of this design and how would you restructure it?

Automation smellsMid8 min

Fix hard-coded credentials in test files

A Playwright test signs in with email: 'testuser@company.com' and password: 'Password123!' hardcoded in the test file. The same credentials appear in 14 other test files. The test environment rotated passwords last week and 14 tests broke. Describe the smell and the correct fix.

Automation smellsMid10 min

Reduce over-asserting in a UI test

A Playwright test for 'Add to cart' asserts 12 things: the cart icon count, page title, URL, cart sidebar header text, currency symbol, product name, product SKU, quantity (default 1), unit price, subtotal, shipping cost, and the 'Checkout' button visibility. Identify the problem and recommend what to keep.

Automation smellsSenior12 min

Refactor brittle selectors in a Playwright snippet

Review this Playwright snippet and identify all automation smells: const btn = page.locator('.sc-bdfxgf.hObGSN'); await btn.click(); await page.waitForTimeout(2000); const count = await page.locator('#root > div > div:nth-child(3) > span').textContent(); expect(count).toBe('1 item'); For each smell, explain the risk and give the fix.

ExploratoryBeginner8 min

Write an exploratory test charter

A new 'Bulk upload contacts' feature has just been deployed to staging. You have 45 minutes for exploratory testing. Write charters for this session. Use the format: EXPLORE [target] TO DISCOVER [information] USING [resources or approach].

ExploratoryMid10 min

Apply the SFDPOT heuristic to a new feature

A 'Live chat' feature has just been added to a customer support portal. Using the SFDPOT heuristic (Structure, Function, Data, Platform, Operations, Time), generate one concrete test idea per dimension.

ExploratoryMid10 min

Plan exploratory tours for a new admin dashboard

A new admin reporting dashboard has been deployed. You have one day of exploratory testing. Using the tours technique, plan four distinct tours and describe what each one investigates.

ExploratorySenior15 min

Risk-based exploratory focus for a payment feature

A 'Saved payment methods' feature is releasing next week. You have two days of exploratory testing. Describe how you would prioritise your effort using risk analysis and identify the three highest-risk areas to test first.

ExploratorySenior12 min

Structure session-based exploratory test notes

You are 30 minutes into an exploratory session on a PDF export feature. Your current notes are: 'tested export, slow sometimes, some pdfs look wrong'. Rewrite these notes in SBTM format and explain why structure matters.

Test designMid10 min

Apply equivalence partitioning to a quantity input

An e-commerce product page has a quantity input. The valid range is 1 to 99 inclusive. Using equivalence partitioning and boundary value analysis, identify the test classes and write the specific test cases you would run.

Test designMid12 min

Write acceptance criteria for a user story

The user story is: 'As a registered user, I want to save up to 3 delivery addresses so I can check out faster.' Write acceptance criteria using the Given/When/Then format that a QA engineer could use to derive test cases. Cover the happy path, the limit, and at least one negative case.

Test designSenior15 min

Prioritise test cases for a risky sprint

A sprint ships three changes: (1) a new payment method (Apple Pay), (2) a minor UI tweak to product listing sort order labels, (3) a back-end caching change that affects all product pages. You have capacity for 25 manual test cases. Describe how you would allocate effort across these three areas and explain the risk reasoning behind your split.

LocatorsBeginner7 min

Choose between implicit and explicit waits in Selenium

A junior QA engineer says: 'I set driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS) globally. Why does my test still intermittently throw NoSuchElementException when the page loads slowly?' Explain what implicit waits actually do, why they fail here, and show the correct fix.

LocatorsMid9 min

Select the third item in a dynamic product list

A product listing renders between 0 and 12 product cards. Each card has a class 'product-card' and a 'Buy now' button inside it. Write a Playwright locator that selects the 'Buy now' button in the third product card, and explain the trade-offs compared to alternatives.

LocatorsMid8 min

Write locators for an accessible form using ARIA

A contact form has <label for='email'> associated with an email input, aria-describedby pointing to a hint paragraph on that field, and a <fieldset> with <legend>Newsletter</legend> containing checkboxes. Write Playwright locators for: the email input, a specific checkbox inside the fieldset, and the submit button. Explain why these locators also verify accessibility.

API checksMid12 min

Assert a GraphQL query response

A GraphQL endpoint accepts this query: query GetUser($id: ID!) { user(id: $id) { id name email orders { id total } } } Describe the assertions you would write for: a successful response, a non-existent user ID, and a malformed query.

API checksMid10 min

Design tests for API rate limiting

An API enforces a rate limit of 100 requests per minute per API key. Describe the tests you would write to verify rate limiting is correctly implemented, including assertions for normal usage, the threshold boundary, and the response once the limit is exceeded.

API checksSenior15 min

Decide when to mock versus stub an API dependency

Your service calls an external SMS provider to send one-time passcodes. Describe when you would use a mock, when you would use a stub, and when you would test against the real SMS API. Explain the trade-offs of each.

Bug reportsMid8 min

Classify bugs as regression, new defect, or environment issue

Classify each bug and explain your reasoning: 1. Feature X worked correctly in v2.1. After the v2.2 deploy, feature X fails. 2. Feature Y has never worked since it was built in v2.0 and no one noticed. 3. A test fails in staging but passes on the same build in production.

Bug reportsMid10 min

Write a bug report for an intermittent failure

A checkout completes successfully 9 out of 10 times. On the 10th attempt, the order is created but the confirmation email is not sent. You have reproduced this twice in two hours of testing. Write the complete bug report and explain what extra information you would try to gather.

Bug reportsSenior15 min

Distinguish symptoms from root cause in a bug report

A tester files: 'The payment confirmation page shows the wrong total.' Explain the difference between a symptom and a root cause in bug reporting, why the distinction matters, and rewrite the report to include a root cause hypothesis with supporting evidence.

Automation smellsMid10 min

Identify the missing page object pattern

Three separate test files all contain this duplicated login code: await page.locator('[data-testid="email-input"]').fill(email); await page.locator('[data-testid="password-input"]').fill(password); await page.locator('[data-testid="login-btn"]').click(); Identify the smell, explain the risks, and show what the refactored version should look like.

Automation smellsMid8 min

Identify and fix a test with no meaningful assertion

Review this Playwright test: test('user can log in', async ({ page }) => { await page.goto('/login'); await page.fill('#email', 'test@example.com'); await page.fill('#password', 'password123'); await page.click('#login-btn'); await page.waitForURL('/dashboard'); }); What is missing? Why is this dangerous? Rewrite it with the correct assertions.

Automation smellsSenior12 min

Find and fix environment leakage between parallel tests

Two tests run in parallel: TestA sets a global feature flag to 'enabled' via a database helper, exercises the feature, then clears the flag. TestB exercises the same feature with the flag set to 'disabled' and asserts the feature is hidden. TestB intermittently fails — it sees the feature as visible when it should be hidden. Identify the race condition and describe the fix.

ExploratoryBeginner8 min

Apply comparison testing to find regressions

A new version of a pricing calculator has been deployed to staging. The previous version is still live on production. You have no written spec for the calculator — just the two running environments. Describe how you would use comparison testing to find regressions.

ExploratoryMid10 min

Write a coverage report after an exploratory session

You spent 2 hours exploring a new 'Team management' feature — inviting members, assigning roles, and removing members. Write a coverage summary that a QA lead could use to make a release decision. Include what you covered, what you found, and what remains untested.

ExploratoryMid10 min

Use personas to guide exploratory testing

A new keyboard navigation feature has been added to a product search page. You have 1 hour of exploratory testing. Describe how you would use these two personas to structure your session: (1) a power user who navigates exclusively via keyboard, (2) a mobile user on a throttled 3G connection.

SQL / data checksBeginner7 min

Write a query to assert an expected row count

Your test creates 5 user accounts via the API and then runs a validation step. Write a SQL query that asserts exactly 5 rows were inserted into the 'users' table for a given 'test_run_id', and explain what you would investigate if the count differs.

SQL / data checksBeginner8 min

Find duplicate rows in a test dataset

A CSV import tool is supposed to deduplicate contacts by email. After running an import you suspect duplicates were created. Write a SQL query that returns all email addresses with more than one row in the 'contacts' table, along with their duplicate count.

SQL / data checksMid10 min

Verify a JOIN returns the expected test data

A GET /orders/{id} endpoint returns order data joined with customer info. The underlying query joins the 'orders' table to 'customers' via 'customer_id'. You created a test order (order_id=1001) for test customer (customer_id=42, name='Test User'). Write a SQL assertion to verify the join is correct, and describe three join bugs it would catch.

SQL / data checksMid10 min

Assert referential integrity after a delete

Your test deletes a customer via DELETE /customers/42. The 'orders' table has a 'customer_id' foreign key referencing 'customers'. Write SQL to verify no orphaned orders remain, and describe how the expected result differs depending on the FK constraint strategy in use.

SQL / data checksMid12 min

Validate a data migration with before/after counts

A migration moves user preference data from a legacy 'user_settings' table into a new 'user_preferences' table. Describe the SQL assertions you would run before and after the migration to verify it completed correctly and no data was lost or duplicated.

SQL / data checksMid10 min

Spot the data integrity bug in this query result

An order summary report runs this query: SELECT customer_id, SUM(total) AS total_spend FROM orders GROUP BY customer_id ORDER BY total_spend DESC; The result is: customer_id | total_spend -----------+------------ 101 | 1500.00 NULL | 320.00 103 | 280.00 What is wrong with the second row, what caused it, and how do you fix it at the source?

SQL / data checksSenior15 min

Write SQL to set up and tear down isolated test data

You need to write a database-layer test for an orders-by-customer report. The test must not depend on shared data, must not pollute the database for other tests, and must clean up after itself even if it fails. Describe your approach and write the SQL setup and teardown.

SQL / data checksSenior15 min

Use SQL to verify event ordering in an audit log

A payment service writes to an 'audit_events' table with columns: id, order_id, event_type, created_at. A valid payment must follow the sequence CREATED -> AUTHORISED -> CAPTURED. Write SQL assertions to verify the correct sequence occurred for test order 9001, and identify two ways the sequence can be wrong.

Debugging / triageBeginner8 min

Read a stack trace and identify the root cause

A test fails with this stack trace: java.lang.NullPointerException at com.example.checkout.CartService.calculateTotal(CartService.java:87) at com.example.checkout.OrderController.placeOrder(OrderController.java:42) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Describe how you read this trace, identify the root cause, and determine your first debugging action.

Debugging / triageBeginner7 min

Test passes locally, fails in CI — first move

A Playwright test that clicks a Submit button and asserts a success toast passes every time on your machine but fails intermittently in GitHub Actions with: 'Timeout 30000ms exceeded waiting for [data-testid="success-toast"]'. What is your first move and diagnostic plan?

Debugging / triageMid10 min

Confirm whether a failing test is flaky or a real bug

A test for 'Add to Favourites' has failed twice in the last 10 CI runs but passes the other 8 times. How do you determine whether this is a flaky test (test-code problem) or an intermittent bug in the application?

Debugging / triageMid10 min

Diagnose a failing assertion from the output

A test fails with: AssertionError: expected '£ 120.00' to equal '£120.00' at checkout.spec.ts:45 Walk through your diagnostic steps. What is the underlying cause and what are your fix options?

Debugging / triageMid12 min

Isolate root cause using a binary search strategy

A regression test suite of 200 tests passes on commit A but 40 tests fail on commit B. There are 50 commits between A and B. Describe a systematic approach to identify which commit caused the failures without reading every changed line manually.

Debugging / triageMid10 min

Diagnose a network-related test failure

A test fails immediately at navigation: Error: net::ERR_CONNECTION_REFUSED at page.goto('http://localhost:3000/checkout') Walk through your diagnostic steps.

Debugging / triageSenior15 min

Diagnose an environment-specific test failure

A test that asserts a user clicking 'Upgrade plan' is redirected to the payment page passes in staging but fails in production on the same build. In production, the user lands on an error page. Describe your diagnostic approach.

Debugging / triageSenior15 min

Diagnose a race condition in a parallel test suite

A test creates a user via POST /users and immediately reads back their profile with GET /users/{id}. It passes when run alone but fails intermittently with { "error": "user not found" } on the GET when the full suite runs in parallel. Diagnose the race condition.

CI/CD reasoningBeginner7 min

Assign tests to the correct CI pipeline stage

Your project has three CI stages: (1) unit tests, (2) integration tests, (3) end-to-end tests. You have three new tests to assign: a function that formats a currency string, an endpoint test for POST /orders, and a Playwright checkout flow test. Assign each to a stage and explain why.

CI/CD reasoningBeginner8 min

Decide what should block a merge in CI

Your team is setting up CI merge gates for a new project. Propose which checks should be hard gates (block the merge) and which should be advisory-only (run but not block). Justify each decision.

CI/CD reasoningMid12 min

Diagnose and improve a slow CI test stage

Your integration test stage takes 18 minutes for 200 tests. The team target is 8 minutes. Describe your approach to diagnosing the bottleneck and the changes you would make to hit the target.

CI/CD reasoningMid10 min

Parallelise a Playwright test suite in CI

A Playwright E2E suite of 80 tests runs sequentially in 40 minutes. You need to reduce this to under 10 minutes on GitHub Actions. Describe your parallelisation strategy.

CI/CD reasoningMid10 min

Handle a flaky test that is blocking CI

A Playwright test for a dashboard filter fails in CI 1 in 5 runs. It blocks every PR. The team has started habitually re-running CI to get a green build. What is your approach?

CI/CD reasoningMid10 min

Decide which test artifacts CI should produce

Your team is setting up CI for a Playwright E2E suite. What test artifacts should the pipeline produce, which should block the build, and which should be advisory? Justify your choices.

CI/CD reasoningSenior15 min

Design a CI/CD test strategy for a new microservice

A new payments-service is being built. It exposes a REST API, consumes events from a message queue, and writes to its own PostgreSQL database. Design the full test strategy — what tests, at what stage, in which pipeline.

CI/CD reasoningSenior15 min

Design tests for a canary deployment

Your team deploys a new version of the checkout service using a canary strategy — 5% of production traffic initially. What tests and monitoring should support this deployment, and how should they gate progression to 100%?

// Keep preparing

These drills work best alongside question banks (recall), scenario practice (structured thinking), and practical assignments (full take-home tasks).