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