13 โ Mock Interview (self-test)¶
~70 questions by topic. Cover the answer, say it aloud, then check 14-mock-interview-answers.md. โญ = high-probability.
A. Screening / behavioural¶
- โญ Walk me through your automation experience and why you want to test AI agents.
- โญ You've done deterministic automation. What changes when the system under test is non-deterministic?
- Tell me about a flaky test you root-caused. What was it and how did you fix it?
- Describe owning a suite end-to-end in CI. What did you gate on?
- How do you decide what to automate vs test manually?
- A dev says "the test is wrong, my code is fine." How do you handle it?
B. Pytest โญ¶
- โญ Explain fixtures and the scopes. When would you use
sessionvsfunction? - What's
conftest.pyand why is it useful? - โญ Difference between
yieldandreturnin a fixture? - How does
parametrizework? How do you parametrize a fixture? - What are markers? How would you run only smoke tests in CI?
- โญ How do you mock an external dependency? Where do you patch โ definition or use site?
monkeypatchvsunittest.mock.patch?- How do you test async agent code?
- How do you run tests in parallel, and what must be true for that to be safe?
- How do you handle a genuinely flaky test vs a badly-written one?
pytest.approxโ when and why?
C. Playwright / Angular โญ¶
- โญ How does Playwright auto-waiting work? Why is it more stable than Selenium sleeps?
- What's your locator strategy for an Angular app? Why avoid CSS classes?
- โญ Web-first assertions vs plain asserts โ what's the difference?
- โญ How do you test a streaming (token-by-token) agent response?
- How do you prove the response streamed incrementally, not dumped at once?
- โญ How would you test a human-in-the-loop approval queue?
- How do you test two approvers acting on the same item concurrently?
- How do you mock a backend/SSE response in Playwright?
- How do you handle auth once and reuse it across tests?
- How do you debug a Playwright failure in CI?
D. API / contract โญ¶
- โญ Difference between contract testing and schema validation?
- How do you validate a response schema in Python?
- What is consumer-driven contract testing (Pact)? Why does it help independently-deployed services?
- How would you use an OpenAPI spec in testing?
- โญ Beyond happy path, what API cases do you cover?
- How do you test idempotency?
- Why validate error response bodies?
- โญ How do you validate an agent API response when the content is non-deterministic?
E. Python¶
- Mutable default argument trap โ explain.
- Write a retry decorator with backoff.
- What's a context manager and when do you write one?
asyncio.gatherโ what does it do?- Write cosine similarity from scratch.
- Parse possibly-malformed JSON from an LLM.
F. SQL / NoSQL โญ¶
- โญ How do you isolate test data between tests?
- Transaction rollback vs truncate vs containers โ trade-offs?
- โญ How do you validate DB state after an agent action? What exactly do you assert?
- INNER vs LEFT join.
- How do you store money and why?
- Mongo vs Redis vs SQL โ when each?
- What's eventual consistency and how does it affect your assertions?
G. Azure DevOps โญ¶
- โญ Sketch a pipeline that runs Pytest as a quality gate.
- Stage vs job vs step?
- How does one stage gate another?
- How do you publish and surface test results?
- โญ How would you add an LLM eval as a quality gate?
- How do you handle secrets in a pipeline?
H. LLM non-determinism โญโญ¶
- โญโญ Why are LLM outputs non-deterministic? Is temperature 0 deterministic?
- โญโญ Why do exact-match assertions fail, and what replaces them?
- Explain semantic-similarity assertion and its limitation.
- What is LLM-as-Judge? What biases does it have and how do you mitigate them?
- โญ What is metamorphic/property testing for LLMs? Give an example.
- How do you test that an agent abstains instead of hallucinating?
- How do you set a pass criterion for a non-deterministic suite?
I. Agent graphs โญโญ¶
- โญโญ Why isn't asserting the final answer enough for an agent? What else do you assert?
- โญ How do you deterministically test an agent's branching logic?
- How do you test tool-error handling and infinite loops?
- What agent-specific failure modes do you test for?
- How would you test that a high-value action can't execute without approval?
J. Langfuse / regression / Ragas / audit โญ¶
- โญ What does a Langfuse trace contain? What's a span vs a generation vs a score?
- โญ How would you assert on a trace in CI?
- โญโญ How do you detect quality degradation when a model version changes?
- Shadow vs canary vs A/B rollout?
- โญ Name the 4 Ragas metrics and which failure each catches.
- Which RAG metric matters most in finance and why?
- โญ How do you verify audit-log immutability and a correlation-ID chain?
- What does SOX require of the audit trail, and how do you test segregation of duties?
K2. Safety / red-team โญ (see file 16)¶
- โญ How do you test that a chatbot handles harmful content? What do you gate on?
- โญโญ How do you test that a chatbot isn't revealing sensitive information / its system prompt?
- What's a canary token and how does it help leakage testing?
- โญ How do you test for jailbreaks in a chatbot or its tools? Name techniques and tools.
- โญ What's the highest-value safety test for a tool-calling agent? (indirect injection via tool/RAG output)
- โญ The model says "I'm ChatGPT, made by OpenAI." How does QA catch and prevent that?
- Why must you also test over-refusal, not just refusal?
- Does QA build the guardrails? (No โ QA validates them; defense-in-depth verification.)
K3. Agents that take real-world actions โญ (see file 17)¶
- โญโญ An agent can release payments / send emails / delete records. How is testing that different from testing a chatbot?
- โญ What is Excessive Agency (OWASP LLM06)? Name its three root causes.
- โญ How do you test an irreversible action is contained? (human gate, dry-run, reversibility)
- โญ How do you stop a retried step from executing a payment twice? (idempotency)
- How do you bound blast radius / runaway cost? (least privilege, spend/rate caps, kill switch)
- How do you test an acting agent safely without touching production? (sandbox + synthetic data + dry-run/shadow)
- What's the safe-rollout pipeline for an agent that takes actions?
K. System design¶
- โญ Design a test strategy for a new financial agent feature end-to-end.
- Design an eval/regression pipeline for the agent platform.
- How do you gate a model upgrade safely?