← All topics

Cypress Interview Questions and Answers

End-to-end and component testing with Cypress: the command queue and retry-ability, selectors and actions, assertions, aliases, cy.intercept and fixtures, cy.session and logins, custom commands and tasks, test isolation and data, CI, parallel runs, flaky tests and suite architecture.

228 questions for Cypress interviews with answers and explanations - Junior, Middle and Senior levels. Sample questions, online quizzes and coding tasks.

Questions by level

Sample questions

A few questions from each level with the correct answer and an explanation.

Cypress · Junior

  1. Where do Cypress tests run?
    Show the answer

    Correct answer: Inside the browser, next to the app under test

    Cypress runs test code in the same browser run loop as the app, with a Node.js process alongside for tasks like files and network proxying. That's why it can read app state directly.

  2. Which command opens the interactive Cypress app?
    Show the answer

    Correct answer: npx cypress open

    cypress open launches the app where you pick a browser and spec and watch tests run. cypress run runs tests headlessly, as in CI.

  3. Which command runs all Cypress tests headlessly, e.g. in CI?
    Show the answer

    Correct answer: npx cypress run

    cypress run runs every spec in the terminal, records failure screenshots, and returns a non-zero exit code on failures.

  4. Where is the main Cypress configuration usually defined?
    Show the answer

    Correct answer: In cypress.config.ts or cypress.config.js

    The config file sets baseUrl, spec patterns, viewport, timeouts, retries and Node event handlers via defineConfig.

All 75 questions with answers →

Cypress · Middle

  1. In Cypress 12+, what is the difference between queries and action commands?
    Show the answer

    Correct answer: Queries like get are retried; actions like click run once

    Queries re-run until assertions pass. Actions such as .click() or .type() aren't retried, though they wait for actionability first.

  2. In cy.get('.list').find('li').should('have.length', 3), what is retried?
    Show the answer

    Correct answer: The whole chain of queries before the assertion

    Since Cypress 12, a failing assertion re-runs the chain of linked queries, so newly rendered elements are found.

  3. What does .its('length') do?
    Show the answer

    Correct answer: Gets a property of the subject, with retrying

    .its() is a query, so cy.get('li').its('length').should('be.gt', 2) retries. .invoke() calls a method on the subject.

  4. How do you check the body a form sends to the API?
    Show the answer

    Correct answer: Intercept it and assert interception.request.body

    This catches frontend bugs like wrong field names or types that a stubbed backend would accept silently.

All 77 questions with answers →

Cypress · Senior

  1. What is the main architectural trade-off of Cypress running inside the browser?
    Show the answer

    Correct answer: Direct access to the app, but limits like one tab and same-origin rules

    Running in the browser gives time travel, app access and reliable waits. The cost is single-tab control, origin limits and JavaScript-only tests.

  2. When would you choose Cypress over Playwright for a team?
    Show the answer

    Correct answer: When the team values its interactive runner and the app fits its limits

    Cypress shines for single-app JS teams wanting fast feedback in the app runner. Multi-tab, multi-origin or multi-language needs favour Playwright.

  3. Why does Cypress need cy.origin for SSO flows while Playwright doesn't?
    Show the answer

    Correct answer: Cypress runs inside one origin's page and must switch context explicitly

    Playwright drives the browser from outside, so origins don't matter. Cypress runs in the page, so other origins need a separate execution context.

  4. What is the most common root cause of flaky Cypress tests in large suites?
    Show the answer

    Correct answer: Shared state and timing assumptions, like fixed waits or leaked data

    Most flakes trace to tests depending on each other, on real timing, or on shared backend data. Fix the cause; retries only hide it.

All 76 questions with answers →

Coding tasks

Write your solution right in the browser, and tests check it instantly. JavaScript interview classics (debounce, deepClone, Promise.all, an LRU cache), TypeScript tasks on generics, narrowing and utility types checked by the real compiler, Node.js backend logic (middleware, rate limiters, job queues), SQL queries in real PostgreSQL, and React components and hooks like a todo list, tabs, useDebounce and useInterval.

Open tasks →