Interview preparation guide

Automation Testing Interview Questions With Design Exercises

Practice automation testing interview questions by explaining the model, working through a small problem and checking failure cases. These original exercises test reasoning rather than recall of a claimed employer question list.

Scope and assumptions

This guide is tool-neutral. The runnable example uses Node.js 22’s built-in test runner, so it needs no browser, database or external test package.

Confirm the version, deployment model and permissions in the interview. The examples use fictional data and are deliberately small. A snippet demonstrates one idea; it is not a complete production system.

What should be automated first?

Choose repeatable checks that protect meaningful behavior and give useful feedback. Consider risk, frequency and maintenance cost. A large test count does not help if the assertions fail to detect a real regression.

How do unit, integration and end-to-end checks differ?

They exercise different boundaries and trade speed for coverage of interactions. Use a narrow test for local logic and a broader check when the risk lies in a real handoff. Avoid testing every behavior only through the UI.

How do you reduce flaky tests?

Control data, isolate state and wait for observable conditions. Diagnose the failure before adding retries. A retry can hide timing or shared-state problems rather than fixing them.

What makes an assertion useful?

It checks the behavior the user or caller depends on. Include an edge case that would fail under a plausible bug, and avoid simply reproducing the implementation in the test.

Worked exercise

Save the example as totals.test.cjs and run node --test totals.test.cjs. Explain why the second assertion protects more than the happy path.

const test = require('node:test');
const assert = require('node:assert/strict');

function totalCents(items) {
  return items.reduce((sum, item) => sum + item.cents * item.quantity, 0);
}

test('totals a cart and handles an empty cart', () => {
  assert.equal(totalCents([{ cents: 125, quantity: 2 }]), 250);
  assert.equal(totalCents([]), 0);
});

Expected result and explanation

The test passes with a total of 250 cents and zero for an empty cart. Removing the initial reduce value would break the empty-cart case. The function is a small illustration; a real checkout would also need validation, currency rules and integration checks.

Before changing the example, predict the result. Then vary one input or constraint and explain why the behavior should change. Keep the distinction between a measured result and an assumption clear.

Debugging and follow-up

When a browser test fails only in CI, compare timing, viewport, environment and shared data. Keep evidence such as the failing assertion and relevant trace before changing waits.

  • What evidence would distinguish your first explanation from an alternative?
  • Which boundary, permission or failure case should be checked?
  • How would you reproduce the issue without affecting live users?

Practice checklist

Explain one design decision aloud and support it with the worked example. Use the official documentation below to check version-specific behavior.

  • I stated the relevant version and environment.
  • I can explain the expected result and an edge case.
  • I can separate correctness, performance and security concerns.
  • I know which parts require a real runtime or service to verify.

Questions, answered

Are these questions used by a particular employer?

No. They are original practice questions. Employers can assess different tools, versions and levels of depth.

How should I verify the exercise?

Use an isolated local or sandbox environment with the stated prerequisites. Compare the expected result, then test an edge case. Do not run service commands against a shared or production system.

Sources and examples

ResumizeAI team. Examples are fictional teaching material, not customer results. Replace sample details with your own facts.

Your experience. A complete resume.

Build in Resumize with ATS-friendly templates, guided editing and a live preview. Start free, then upgrade when you need more.

Free account required. Free-plan PDF exports include a watermark.