Cypress Senior interview questions and answers
76 questions for a Cypress (Senior) interview - with correct answers, explanations and links to the docs.
Take this quiz- 1.What is the main architectural trade-off of Cypress running inside the browser?
- 2.When would you choose Cypress over Playwright for a team?
- 3.Why does Cypress need
cy.originfor SSO flows while Playwright doesn't? - 4.What is the most common root cause of flaky Cypress tests in large suites?
- 5.What does flaky test management in Cypress Cloud provide?
- 6.What is a "burn-in" for new or changed tests?
- 7.How should a team use test retries responsibly?
- 8.What does Test Replay in Cypress Cloud help with?
- 9.How does Cypress Cloud balance specs across parallel machines?
- 10.Why split very long spec files?
- 11.How can you run only tests tagged
@smokein Cypress? - 12.What is a sensible test split between PRs and nightly runs?
- 13.Why can heavy network stubbing make a Cypress suite give false confidence?
- 14.How can fixtures be kept in sync with the real API?
- 15.How should per-test database setup work in a parallel Cypress suite?
- 16.What is a pitfall of
cy.sessionwithout avalidatefunction? - 17.How would you test an app behind a third-party SSO provider?
- 18.How should the balance between component and end-to-end tests be decided?
- 19.What should a team consider when migrating from Cypress to Playwright?
- 20.What makes a good custom command in a large Cypress codebase?
- 21.What does
eslint-plugin-cypresshelp prevent? - 22.How should a monorepo with several apps organise Cypress?
- 23.Why run Cypress against preview deployments per pull request?
- 24.What does
numTestsKeptInMemoryaffect? - 25.Why might you turn off video recording in CI?
- 26.How can third-party scripts like chat widgets make Cypress tests flaky?
- 27.What is the risk of setting
chromeWebSecurity: false? - 28.Why are WebSocket features harder to test in Cypress?
- 29.How do service workers interfere with Cypress network stubbing?
- 30.How do you make date-dependent tests stable across time zones?
- 31.How should feature flags be handled in Cypress tests?
- 32.What does
experimentalMemoryManagementaddress? - 33.Which reporting setup works well for Cypress in CI dashboards?
- 34.How do you test across browsers without slowing every PR?
- 35.What are the limits of mobile testing with
cy.viewport? - 36.How can accessibility checks be enforced in a Cypress suite?
- 37.Is gating merges on Cypress code coverage a good idea?
- 38.How should test accounts used by Cypress be secured?
- 39.What makes a Cypress suite hard to maintain over time?
- 40.How do you decide which flows deserve Cypress E2E coverage?
- 41.What metric best shows whether the Cypress suite helps the team?
- 42.How should tests interact with apps that use heavy client-side routing?
- 43.Why should you avoid
cy.waiton a fixed number before an assertion even in CI-only tests? - 44.How do you test that an API error shows a friendly message without a real failing backend?
- 45.Why keep assertions in tests rather than inside custom commands?
- 46.What happens when tests share one user whose data changes?
- 47.What is a good approach to testing emails sent by the app?
- 48.How can Cypress tests verify analytics events without real tracking?
- 49.What is the trade-off of Cypress's automatic waiting for page loads?
- 50.How do you keep a Cypress suite's run time in check as it grows?
- 51.Why should Cypress tests not depend on production-like data in staging?
- 52.How should you handle a known bug that makes a test fail?
- 53.What should a review of a new Cypress test look for?
- 54.How do you test file uploads to cloud storage with signed URLs?
- 55.Why may a Cypress test pass locally but fail in CI with the same code?
- 56.What is the benefit of running the same suite against several locales?
- 57.How should network-heavy dashboards be tested to stay fast?
- 58.What is a sign that a Cypress suite has too much E2E coverage?
- 59.How do you test permissions for many roles efficiently?
- 60.What does
Cypress.on('uncaught:exception')returningfalsedo, and why use it carefully? - 61.How do you test long-running background jobs triggered from the UI?
- 62.What does a stable selector policy for a team look like?
- 63.How can Cypress catch hydration or runtime errors that don't break visible UI?
- 64.What should happen when a Cypress test is consistently slow?
- 65.How do you test a drag-and-drop UI in Cypress?
- 66.When is testing a canvas-based UI in Cypress practical?
- 67.How should Cypress tests handle randomness in the app, like shuffled lists?
- 68.What is a risk of very large fixtures?
- 69.How do you check that sensitive data isn't stored in localStorage?
- 70.How can you prevent tests from accidentally hitting production?
- 71.What is a healthy ownership model for E2E tests?
- 72.How do you test that an app works with slow 3G-like networks?
- 73.Why is testing inside Electron (the default) not always enough?
- 74.What is the main risk of using
cy.taskto read the database directly in assertions? - 75.How should screenshots from failing tests be handled for privacy?
- 76.When does a dedicated API test suite beat
cy.requesttests?