P0 / P1 · Chapter 14 / 15

Senior interview Q&A

The 60-second cheat sheet#

Answer in layers: define the concept, give a condition-based choice, show how it works, then name the failure mode and evidence. The bank below covers both automation roles. Each answer contains practical points, a pitfall and a link to the full chapter. Practice saying the short answer before opening it.

Top 25 highest-likelihood questions#

The following shortlist prioritizes the recruiter's Playwright/TypeScript focus and the supplied mock-interview gaps. It is a preparation judgment, not a prediction of actual EPAM questions.

  1. When should you use Promise.all?
  2. Does Promise.all cancel other requests?
  3. Does TypeScript validate JSON?
  4. How do you group API results by status?
  5. Is getByRole itself a wait?
  6. What does click wait for?
  7. Why prefer toHaveText over innerText plus toBe?
  8. Why register waitForResponse before clicking?
  9. How should a response predicate match?
  10. Does goto prove the app is ready?
  11. Does page.route mock request.get?
  12. What does strict locator failure mean?
  13. What belongs in a Page Object?
  14. What does await use mean?
  15. Can a worker fixture use request fixture?
  16. Does worker scope mean once globally?
  17. What does storageState contain?
  18. Why can saved state expire?
  19. parallelIndex versus workerIndex?
  20. 401 versus 403?
  21. How do you find the latest row per user?
  22. How do you prevent SQL injection?
  23. What artifacts should be retained?
  24. How do you prevent invented endpoints?
  25. What is a mutation kill?

TypeScript / async#

What does async return?
  • Always a Promise, including Promise<void>.
  • A thrown error becomes rejection; await obtains fulfillment or throws.

Pitfall: Assuming an async function returns its bare value synchronously.

Full explanation →

Why can response.status fail after request.get?
  • request.get returns Promise<APIResponse>.
  • Await it first; status() is synchronous and json() must be awaited.

Pitfall: Confusing response, Promise and parsed body.

Full explanation →

When should you use Promise.all?
  • Independent operations that can safely overlap.
  • Results follow input order; assert each HTTP response.

Pitfall: Concurrent dependent POST and GET.

Full explanation →

Does Promise.all cancel other requests?
  • No.
  • It rejects on a rejected input but remaining operations continue; partial side effects may exist.

Pitfall: Treating rejection as transaction rollback.

Full explanation →

When is allSettled better?
  • When every outcome matters for reporting or independent cleanup.
  • Inspect each status and explicitly fail required operations.

Pitfall: Returning a successful test despite rejected required work.

Full explanation →

Why is async forEach dangerous?
  • forEach ignores returned callback Promises.
  • Use for-of for sequence or Promise.all(map) for independent bounded concurrency.

Pitfall: Awaiting forEach itself.

Full explanation →

Does TypeScript validate JSON?
  • No, types are erased.
  • Parse unknown with a runtime guard or an optional schema library.

Pitfall: Using `as User` as proof of schema.

Full explanation →

unknown versus any?
  • unknown requires narrowing before use.
  • any disables checking and propagates unsafe assumptions.

Pitfall: Casting everything to any to silence compiler errors.

Full explanation →

const versus immutability?
  • const prevents rebinding, not object mutation.
  • Spread is shallow; copy nested values when isolation requires it.

Pitfall: Sharing nested fixture data accidentally.

Full explanation →

What does await do to the event loop?
  • It suspends that async function.
  • Other queued work can run; Promise continuations are microtasks after the current stack.

Pitfall: Claiming await blocks the whole Node process.

Full explanation →

Why use try/finally?
  • To attempt cleanup on success or failure.
  • Preserve the primary error and record secondary cleanup failure.

Pitfall: Assuming finally guarantees deletion during service outage.

Full explanation →

How do you group API results by status?
  • Use a Map from status to array; iterate once for expected O(n) time and O(n) output space.
  • Define handling for malformed input.

Pitfall: Using default lexical sort for numeric ordering.

Full explanation →

Playwright locators / waits / network#

Is getByRole itself a wait?
  • It creates a Locator.
  • Actions perform their checks; web-first assertions retry expected state.

Pitfall: Treating locator construction as success evidence.

Full explanation →

What does click wait for?
  • Unique target and applicable actionability checks such as visible, stable, enabled and receiving events.
  • Business completion still needs assertion.

Pitfall: A successful click proves a saved record.

Full explanation →

Why prefer toHaveText over innerText plus toBe?
  • toHaveText rereads and retries a live locator.
  • innerText returns a single snapshot before a generic comparison.

Pitfall: Thinking any expect automatically retries browser state.

Full explanation →

Why register waitForResponse before clicking?
  • A fast response may arrive during the click.
  • Create the promise first, trigger action, await response and assert status.

Pitfall: Listening after the event already occurred.

Full explanation →

How should a response predicate match?
  • Use method, exact path and relevant identity/correlation.
  • Assert status afterward when failures need immediate evidence.

Pitfall: Broad substring matches an unrelated request.

Full explanation →

Does goto prove the app is ready?
  • It normally waits for load.
  • Asynchronous application and backend state need explicit readiness checks.

Pitfall: Using page load as a Kafka completion signal.

Full explanation →

Does page.route mock request.get?
  • No.
  • It intercepts matching browser requests, not direct APIRequestContext calls.

Pitfall: Calling a mocked UI test real backend coverage.

Full explanation →

When use a test ID over role?
  • Use role/label for stable user semantics, test ID for an explicit testing contract where semantics are ambiguous.
  • Stable CSS IDs can also be appropriate.

Pitfall: Blanket bans on every CSS selector.

Full explanation →

What does strict locator failure mean?
  • An operation needing one element matched multiple.
  • Scope to the intended entity or accessible name.

Pitfall: Blindly adding first() and clicking a wrong record.

Full explanation →

How do you handle popup/download races?
  • Register waitForEvent first, trigger action, then await the event.
  • Assert popup target or download metadata/content as required.

Pitfall: Waiting only after clicking.

Full explanation →

expect.poll versus expect.toPass?
  • poll retries a returned observation; toPass retries a whole assertion block.
  • Use explicit budgets and keep repeated code side-effect safe.

Pitfall: Putting non-idempotent writes inside the retried block.

Full explanation →

What timeout should you increase?
  • Only the operation whose legitimate latency is demonstrated.
  • Fit assertion/action/navigation budgets within test budget.

Pitfall: Globally increasing everything to mask shared-state errors.

Full explanation →

What does a browser mock prove?
  • Frontend behavior for the supplied contract response.
  • Real service correctness needs separate integration evidence.

Pitfall: Passing a mocked VERIFIED response as proof of backend verification.

Full explanation →

What does Playwright Test add beyond a browser library?
  • Runner, fixtures, projects, workers, assertions, retries and reporters.
  • Browser contexts/pages are test-scoped by default.

Pitfall: Writing an unmanaged script and assuming runner isolation/reporting.

Full explanation →

POM / fixtures / auth / parallelism#

What belongs in a Page Object?
  • Stable locators and semantic page actions.
  • Keep business intent/outcome assertions visible in tests unless a cohesive page-specific helper helps.

Pitfall: A giant page class owning DB, Jira and every workflow.

Full explanation →

Fixtures versus beforeEach?
  • Hooks suit local common setup.
  • Fixtures compose typed lazy dependencies with reusable lifecycle and teardown.

Pitfall: Abstracting one trivial navigation into many layers.

Full explanation →

What does await use mean?
  • Setup before it; dependent test/fixtures execute at the yield boundary; teardown afterward.
  • Dependencies set up first and tear down last.

Pitfall: Placing cleanup only on the happy path.

Full explanation →

Can a worker fixture use request fixture?
  • Not the test-scoped request fixture.
  • Create and dispose a separate APIRequestContext for worker lifetime.

Pitfall: A long-lived fixture depending on shorter-lived page/request.

Full explanation →

Does worker scope mean once globally?
  • No, once per worker lifetime.
  • Different shards/jobs have workers and failures may restart them.

Pitfall: One account allocated once for every CI process.

Full explanation →

Is test.extend class inheritance?
  • No.
  • It builds a test API with typed resource dependencies and lifecycle.

Pitfall: Explaining fixture composition as an OOP subclass.

Full explanation →

What does storageState contain?
  • Cookies/localStorage; IndexedDB opt-in where supported.
  • sessionStorage is not automatically persisted.

Pitfall: Assuming it captures every browser or server state.

Full explanation →

Why can saved state expire?
  • Backend TTL, revocation, password change or single-session policy can invalidate it.
  • Re-authenticate/refresh through real protocol.

Pitfall: Rewriting identical expired JSON.

Full explanation →

Why do four shards with one account fail?
  • Later logins may revoke earlier sessions or writes collide.
  • Use independent leased/provisioned accounts across jobs and pipelines.

Pitfall: Treating browser-context isolation as account isolation.

Full explanation →

When do tests need unique accounts?
  • When mutations, password changes or session policy can interfere.
  • Worker sharing is acceptable only with compatible state and ownership.

Pitfall: Sharing a destructive-test account with later read tests.

Full explanation →

parallelIndex versus workerIndex?
  • parallelIndex is worker slot stable across replacement; workerIndex identifies a process within run.
  • Neither is globally unique across jobs.

Pitfall: Using a worker number alone as global account key.

Full explanation →

API factory versus UI setup?
  • API factory is fast for test preconditions.
  • UI setup remains when that interaction itself is under test.

Pitfall: Removing all real login/create coverage.

Full explanation →

API / SQL / Kafka / integration#

What is the API testing checklist?
  • Assert exact status, runtime body and business effects.
  • Cover boundaries, permissions, invalid state, concurrency and cleanup.

Pitfall: Only checking response.ok().

Full explanation →

401 versus 403?
  • 401 usually means absent/invalid authentication; 403 means authenticated/identified but forbidden under policy.
  • Check resource-concealment rules.

Pitfall: Testing only token presence and calling authorization covered.

Full explanation →

Is POST idempotent?
  • Not inherently.
  • An enforced backend idempotency contract can make a particular submission safely repeatable.

Pitfall: Assuming a header name alone prevents duplicates.

Full explanation →

How do you test POST then GET?
  • Await creation, validate returned ID, fetch that resource and assert contents
  • own cleanup.

Pitfall: Hard-coded IDs or concurrent dependent calls.

Full explanation →

What if a payment request times out?
  • Outcome is unknown.
  • Query by operation/correlation identity before replay; use only documented enforced idempotency in sandbox.

Pitfall: Assuming timeout means no charge happened.

Full explanation →

What does HTTP 202 prove?
  • Acceptance according to contract, not final outcome.
  • Poll the operation/status endpoint to a terminal business state.

Pitfall: Equating HTTP code with VERIFIED status field.

Full explanation →

How do you test Kafka duplicates?
  • Send controlled duplicate business/event identity and verify one logical DB/audit/ledger effect.
  • Include restart boundary when relevant.

Pitfall: Assuming delivery semantics guarantee all external effects once.

Full explanation →

Is Kafka globally ordered?
  • Ordering depends on partition/key and configuration.
  • Specify the exact ordering/version contract and test out-of-order handling.

Pitfall: Expecting global order across unrelated partitions.

Full explanation →

How do you reconcile source and target?
  • Compare keys both directions
  • duplicates, values and compatible grouped totals with a stable watermark/snapshot.

Pitfall: Equal counts imply identical records.

Full explanation →

Why can LEFT JOIN lose unmatched rows?
  • A right-side condition in WHERE can reject NULL extended rows.
  • Put intended match restrictions in ON or handle NULL explicitly.

Pitfall: Accidentally turning the outer join into inner behavior.

Full explanation →

How do you find the latest row per user?
  • ROW_NUMBER partitioned by user ordered by timestamp DESC plus deterministic ID tie-breaker
  • select rn=1.

Pitfall: MAX(timestamp) alone returns no associated coherent row.

Full explanation →

How do you prevent SQL injection?
  • Parameterized driver query with bound values, approved read-only access and bounded queries.
  • Identifiers need allowlisting rather than value placeholders.

Pitfall: Concatenating an untrusted user ID into SQL.

Full explanation →

CI / debugging / architecture#

Does allow_failure true block merge?
  • The job may fail while pipeline succeeds.
  • Critical checks need false and project settings requiring successful pipelines.

Pitfall: Thinking job YAML alone enforces every merge policy.

Full explanation →

Shards versus workers?
  • Shards partition across runs/jobs; workers execute within each run.
  • Four by four gives up to sixteen slots.

Pitfall: Allocating accounts only for four total processes.

Full explanation →

How should CI install Playwright?
  • npm ci from lockfile plus matching browser installation, or approved version-matched official image.
  • Keep OS/browser/package compatible.

Pitfall: Fake image tags or stale cached browsers.

Full explanation →

What artifacts should be retained?
  • Sanitized HTML/JUnit
  • traces/screenshots when useful, always-on-failure availability with restricted access and expiry.

Pitfall: Publishing auth state or token-bearing traces broadly.

Full explanation →

Why do retries not fix flakes?
  • They repeat execution but leave root cause.
  • They can also duplicate non-idempotent effects.

Pitfall: Reporting a recovered retry as proven reliability.

Full explanation →

What is your first CI-only failure action?
  • Preserve exact command/environment/data and evidence.
  • Compare trace/network/logs and form hypotheses.

Pitfall: Changing many timeouts before collecting evidence.

Full explanation →

What can Trace Viewer show?
  • Action timeline, DOM snapshots and network context.
  • Link backend events through separate correlation logs.

Pitfall: Assuming trace automatically contains all Kafka/DB evidence.

Full explanation →

How do you classify a timeout?
  • Distinguish product, test, environment, data and timing.
  • Check which observable condition never occurred and why.

Pitfall: Every timeout is a slow server.

Full explanation →

How do you reduce a 60-minute UI suite?
  • Map risk/coverage
  • remove true redundancy, move business combinations lower, use API setup, fix flakes, then shard/tune.

Pitfall: Parallelizing shared-state failures.

Full explanation →

Pyramid or trophy?
  • Both are heuristics.
  • Choose lowest layer proving the risk, retain deployed integration/E2E where needed.

Pitfall: Enforcing fixed percentages regardless of architecture.

Full explanation →

How do you quarantine responsibly?
  • Issue
  • owner, expiry, explicit missing coverage/risk acceptance and replacement checks/manual evidence.

Pitfall: test.skip as a permanent hidden repair.

Full explanation →

What framework quality criteria matter?
  • Readable intent
  • cohesive boundaries, single-test execution, isolation, diagnostic evidence, secure configuration and reasonable maintenance.

Pitfall: More abstractions automatically mean better design.

Full explanation →

AI agents / MCP / evals#

What is MCP?
  • A protocol for AI applications and servers exposing supported tools/resources/prompts.
  • It is not itself the agent or project rules.

Pitfall: Calling MCP a model or autonomous orchestrator.

Full explanation →

Skills/Powers versus AGENTS.md?
  • Skills/Powers package procedures and potentially scripts/tools where platform supports them.
  • AGENTS.md directs project behavior with conditional rules.

Pitfall: Reducing executable capabilities to cosmetic prompts.

Full explanation →

What does an agentic workflow change?
  • The model selects tools, observes results and adapts actions.
  • A deterministic pipeline follows predefined steps.

Pitfall: Assuming autonomy removes the need for permission boundaries.

Full explanation →

How do you prevent invented endpoints?
  • Conditional rule to inspect actual OpenAPI/repo, verified context tools, runtime contract checks and reviewer evidence.
  • Block unresolved work.

Pitfall: Claiming instructions mathematically eliminate hallucination.

Full explanation →

Why not one agent per tool?
  • Tools are capabilities, agents are decision contexts.
  • Use a simple agent plus CI unless separable tasks justify coordination.

Pitfall: More agents guarantee higher quality.

Full explanation →

How do you handle prompt injection from Jira?
  • Treat retrieved text as untrusted task data, preserve governing instructions and restrict tool/environment permissions.
  • Validate changes before review.

Pitfall: Allowing a ticket to authorize production writes.

Full explanation →

How do you evaluate generated tests?
  • Versioned reviewed dataset
  • compile/run, criterion mapping, assertion strength, fault detection, flakiness, cost and review effort.

Pitfall: CI pass rate alone.

Full explanation →

What is a mutation kill?
  • A valid controlled defect makes the intended generated test fail for the relevant behavior.
  • Exclude equivalent/unexercised mutants with evidence.

Pitfall: Counting unrelated setup crash as meaningful detection.

Full explanation →

Agent A passes more but covers less: which wins?
  • Classify failures and missing risks, compare detection/review cost under same conditions.
  • A failure can expose a real product bug.

Pitfall: Automatically choosing 95 passes over 85.

Full explanation →

Can an LLM judge be sole authority?
  • No.
  • Calibrate a rubric and sample disagreements; deterministic checks prove executable facts and humans assess domain meaning.

Pitfall: The judge shares the generator's blind spots.

Full explanation →

When is LangGraph justified?
  • Use explicit graph orchestration for resumable state, branching or governance.
  • Prefer a simple agent or deterministic pipeline when coordination adds little value.

Pitfall: Adding a framework before identifying control-flow needs.

Full explanation →

What must a generated MR report include?
  • Changed criteria/scenarios, actual commands and results, evidence links and unresolved risks.
  • Keep human review before protected merge.

Pitfall: Reporting tests as passed without executed evidence.

Full explanation →

How can a custom Skill enforce verification?
  • It can include executable branch/environment checks, repository inspection and validation commands.
  • Combine those capabilities with constrained permissions and CI enforcement.

Pitfall: Assuming the Skill name alone proves it ran correctly.

Full explanation →

Do project rules guarantee zero hallucinations?
  • No.
  • Verified context, conditional rules, scoped tools, typecheck, tests and review substantially reduce risk but do not eliminate all errors.

Pitfall: Dismissing useful preventive rules because they are not mathematical guarantees.

Full explanation →

Senior behavior / strategy#

How do you prioritize under deadline?
  • Rank business/regulatory impact, likelihood/change and critical journeys.
  • Negotiate scope and report residual risk with owner.

Pitfall: Claiming all testing is complete after smoke passes.

Full explanation →

How do you disagree with a developer?
  • Share requirement and reproducible evidence
  • listen to their hypothesis, agree a discriminating experiment and document outcome.

Pitfall: Arguing from job title instead of evidence.

Full explanation →

How do you mentor?
  • Use a real skill gap
  • pair on a concrete example, explain reasoning, then let them complete and explain the next task.

Pitfall: Invented productivity percentages.

Full explanation →

What makes you Senior versus Lead?
  • Senior owns dependable technical delivery and diagnosis; Lead often coordinates strategy/people.
  • Give grounded Frame.so scope and personal contributions.

Pitfall: Unproven architect or team-size claims.

Full explanation →

How much Playwright experience do you claim?
  • State actual backoffice use and distinguish earlier Python automation
  • broad QA tenure and current preparation.

Pitfall: Turning 2018 QA start into continuous Playwright years.

Full explanation →

Why AI QA?
  • Ground it in AI feature testing and tool familiarity
  • then describe a proposed governed agent/eval workflow.

Pitfall: Presenting proposed architecture as deployed achievement.

Full explanation →

What is useful requirements traceability?
  • Jira criterion to TestRail scenario/test ID to CI run to defect
  • with coverage gaps explicit.

Pitfall: A green CI badge equals all business requirements covered.

Full explanation →

How do you own a mistake?
  • Use a genuine example
  • disclose promptly, contain consequences, fix and describe prevention with true outcome.

Pitfall: A fictional flawless story disguised as a weakness.

Full explanation →

Additional worked interview scenarios#

Code calls request.get then status without await: fix it.
  • Await request.get first, then inspect synchronous status and await json.
  • Let failures reach the runner.

Pitfall: Silencing TypeScript with any.

Full explanation →

Save sometimes times out on a very fast API: investigate.
  • Trace event ordering
  • register response promise before click, match method/path and inspect status.

Pitfall: Adding more waitForResponse timeout after missing the event.

Full explanation →

Worker fixture takes page and fails: redesign.
  • Worker resources cannot depend on test page
  • use separate request context or test-scoped fixture.

Pitfall: Making everything global to avoid the error.

Full explanation →

An assertion fails before delete runs: what changes?
  • Move owned cleanup into finally/fixture teardown
  • preserve original and cleanup diagnostics.

Pitfall: Assuming cleanup succeeds whenever finally executes.

Full explanation →

API returns 202 but test claims VERIFIED: review it.
  • 202 is acceptance
  • poll status to terminal state, assert VERIFIED and corresponding effects.

Pitfall: Changing expected HTTP code to business status string.

Full explanation →

Mocked UI passes while live API is broken: explain.
  • The test only proved rendering against synthetic response
  • add real contract/integration evidence.

Pitfall: Removing mocks everywhere rather than defining separate layers.

Full explanation →

Optional critical smoke job fails but MR is green: fix policy.
  • Set critical allow_failure false
  • require successful pipeline in project merge rules and verify the relevant MR pipeline.

Pitfall: Changing the report color instead of enforcement.

Full explanation →

A suite has 30 flaky UI checks: first investment?
  • Classify failures and map coverage
  • repair synchronization/data, lower redundant tests, then parallelize.

Pitfall: Retrying every failure five times.

Full explanation →

Saved JSON exists but user is logged out: why?
  • Check backend expiry/revocation
  • regenerate via real login or supported refresh, verify auth outcome.

Pitfall: File existence means session valid.

Full explanation →

New shard login logs out earlier shard: fix it.
  • Single-active-session collision
  • allocate independent identities across shards/workers/pipelines.

Pitfall: Separate files alone solve server account policy.

Full explanation →

Password test breaks later read tests: isolate it.
  • Dedicated per-test account and lifecycle
  • password changes can revoke shared sessions permanently.

Pitfall: Restoring only browser cookies.

Full explanation →

Agent has high pass rate but checks only headings: evaluate.
  • Map assertions to criteria and inject wrong business state in sandbox
  • meaningful success test must fail.

Pitfall: Counting assertion quantity instead of relevance.

Full explanation →

An AI test uses a nonexistent endpoint: what prevents recurrence?
  • Verify source contract
  • record evidence, add conditional project rule, enforce validation and review.

Pitfall: A blanket guarantee that better prompting eliminates risk.

Full explanation →

Payment POST times out after possible commit: next step?
  • Reconcile by supported correlation/key before any replay
  • respect enforced deduplication contract.

Pitfall: Automatic generic retry of financial writes.

Full explanation →

SQL totals double after joining events: diagnose.
  • One-to-many fanout changes grain
  • aggregate at intended grain before joining or use EXISTS.

Pitfall: DISTINCT blindly hiding a broken financial query.

Full explanation →

Interview delivery#

30 seconds: State the concept and decision rule, then one concrete failure mode. 90 seconds: Add contract assumptions, code sequence, alternatives, isolation, validation and residual risk. Practice the top 25 aloud; revisit linked chapters when reasoning is uncertain.

Memory hook: define → decide → demonstrate → diagnose.

Official references and related topics#

Optional online further reading; all core study material is included above.

Back to library index

Prepared for both Senior automation roles. Hypothetical sandbox contracts; no employer systems or credentials. Content: 16 October 2026.