Skip to main content

Explain the difference between implicit waits, explicit waits, and hard sleeps. Which should you use?

  • waits
  • synchronization
  • best practices

Answer it first, then compare. Nothing here is saved or scored.

Model answer

Hard sleeps (`sleep(5000)`) waste time and are still flaky, avoid them. Implicit waits set a global timeout for element lookups but hide real problems. Explicit waits (`waitForSelector`, `waitForResponse`) wait for specific conditions and are the gold standard, they're precise and self-documenting. Playwright's auto-wait handles most cases, so you rarely need manual waits. When you do, always wait for a specific condition (element visible, network idle) rather than a fixed time.

What interviewers listen for

  • Test architecture instincts
    You can defend why your suite is shaped like a pyramid, a trophy, or a honeycomb.
  • Locator discipline
    You rank selector strategies by stability and explain when to break the rule.
  • Flaky test ownership
    You debug to a structural fix instead of retry-until-green.
  • Parallelisation literacy
    You know how your framework isolates state, fixtures, and database access across workers.

See all 35 automation questions

Written by , Senior QA Automation Engineer, 50+ QA candidate interviews conductedLast updated July 2026