Cypress E2E Testing Interview
Curated 20+ questions covering Cypress architecture, assertions, network interception, support commands, sessions, and configurations.
Difficulty Filters
Tools & Options
What is Cypress, and what is its main architecture?
Cypress is a next-generation frontend testing tool built for the modern web. Unlike older testing tools (like Selenium) that run outside the browser and execute commands over network protocols, Cypress runs **directly inside the browser** in the same loop cycle as the application, allowing it to inspect DOM elements, network traffic, and local storage instantly.
Explain the difference between Cypress and Selenium.
Cypress runs in-browser, is written in JavaScript, executes commands quickly, and has built-in auto-waiting and network mocking. Selenium runs out-of-browser, communicates via WebDriver protocols, supports multiple programming languages (Java, Python, C#), and is better suited for cross-browser testing across legacy browsers.
How does Cypress handle automatic waiting?
Cypress automatically waits for elements to become visible, enabled, and exist in the DOM before performing actions (like clicking or typing). It also automatically retries assertions until they pass or a default timeout (typically 4 seconds) is reached, eliminating the need to write manual sleeps or timeouts.
What are the common assertions used in Cypress?
What is `cy.intercept()`, and why is it used?
How do you query elements in Cypress? What is the difference between `cy.get()` and `cy.find()`?
What are Cypress Custom Commands, and where are they defined?
Explain the use of Fixtures in Cypress.
What is the Page Object Model (POM) pattern in Cypress, and is it recommended?
How do you handle testing iframes in Cypress?
What is Cypress Session and `cy.session()`, and why is it used?
What is a Cypress plugin?
How does Cypress handle file upload testing?
Explain Cypress environment variables and how to configure them.
Why does Cypress commands seem asynchronous?
How do you handle uncaught exceptions on the target website in Cypress?
What is Cypress Cloud (formerly Dashboard)?
Explain the difference between `cy.visit()` and `cy.request()`.
How do you run tests in headless mode in Cypress?
Explain the `origin` command (`cy.origin()`) in Cypress.
Technical Interview Mastery Blueprint
Proven methodologies and frameworks to succeed in technical and architecture rounds.
1. The Engineering STAR Technique
When responding to architectural or situational questions, structure your answer using Situation, Technical Constraint, Action, and Measurable Result. Rather than jumping straight to syntax, articulate the business problem, why certain patterns (e.g. caching, queuing, immutability) were selected over alternatives, and what latency or throughput improvements were achieved.
2. Defending Architectural Trade-Offs
Senior interviewers evaluate how you weigh trade-offs. Always explain why you chose an approach: e.g., memory overhead vs CPU cycle speed, consistency vs availability (CAP theorem), or normalized schemas vs denormalized fast reads. Stating the drawbacks of your own proposal demonstrates maturity and production experience.
3. Clean Code & Edge-Case Proactivity
In live-coding rounds, communicate your thinking aloud before typing. State edge cases explicitly: null or undefined inputs, extreme boundary values, concurrency races, and network timeouts. Writing modular, well-named functions with deterministic unit tests separates junior candidates from staff-level engineers.
4. Antipatterns to Avoid
Avoid reciting memorized definitions without practical context. Never dismiss non-functional requirements such as security (CSRF, injection, token rotation), observability (logging, metrics), and accessibility (ARIA, semantic standards). Always ask clarifying scope questions before writing complex implementations.
Explore Related Tools
Hand-picked utilities and calculators related to this tool.
