How would you set up parallel test execution to reduce CI pipeline time?
- parallel execution
- CI optimization
- sharding
Answer it first, then compare. Nothing here is saved or scored.
Model answer
Approaches: (1) Playwright sharding, split tests across N workers/machines. (2) CI matrix strategy, run different test groups in parallel jobs. (3) Test splitting by time, use historical timing data to balance shards. (4) Isolated test data, each parallel worker uses its own test accounts/data. Key considerations: avoid shared state between parallel tests, use unique ports/databases per worker, collect and merge reports from all shards. Typical speedup: 4x with 4 shards, diminishing returns beyond 8.
What interviewers listen for
- Test architecture instinctsYou can defend why your suite is shaped like a pyramid, a trophy, or a honeycomb.
- Locator disciplineYou rank selector strategies by stability and explain when to break the rule.
- Flaky test ownershipYou debug to a structural fix instead of retry-until-green.
- Parallelisation literacyYou know how your framework isolates state, fixtures, and database access across workers.