Describe how you would set up automated tests in a CI/CD pipeline for a web application.
What the interviewer wants to hear
- Fast checks first: lint, type check, unit tests
- API and integration tests next
- E2E smoke on preview or staging deploy
- Parallelism, caching and artifacts on failure
- Quality gates block merge or release
Model answer
On every pull request I run the fast stages first: lint, type checks and unit tests, so most mistakes fail within a few minutes. Next come API and component tests, often with services in containers. Then the app is deployed to a preview environment, and a focused E2E smoke suite runs against it with Playwright, sharded across a few machines. Failing tests upload traces, screenshots and JUnit reports as artifacts, and the results show on the pull request. These stages are required checks, so a red build blocks the merge. After merge to main, a fuller regression suite runs, and after deploying to production a short smoke and synthetic monitoring check the critical journeys. I cache dependencies and use prebuilt browser images to keep the pipeline fast, and I track flaky tests separately so the gate stays trustworthy.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Automation Test Engineer questions
- How would you design a test automation framework from scratch for a web app?
- A test fails randomly in CI about 1 in 20 runs. Walk me through how you find and fix the cause.
- How do you manage test data in an automated suite that runs in parallel on shared environments?
- When should automated tests mock external services, and when should they use real ones?
- How do you make automated test results useful to developers and managers?
- How do you handle authentication in a large UI test suite without making every test log in through the UI?
- Your suite needs to run in parallel across many workers. What do you change to make that safe?
- You are asked to load test a new checkout API before a big sale. How do you plan and run it?
- How would you approach test automation for a mobile app on Android and iOS?