01 / 10

How do you install and set up Cypress?

Difficulty: 3/10
installation, configuration, CI integration
  1. 1

    npm install cypress --save-dev

  2. 2

    npx cypress open : This will: Create a cypress/ folder and a cypress.config.js file (or .ts)

Inside cypress/e2e, create a file like sample.cy.js:
Run tests in the terminal without the UI:
you can specify a browser like Chrome:

Scenario Questions

0-2 years experience

  1. 1You need to add Cypress to a new React project. Walk me through the commands you'd run and the files you expect to see after installation.
  2. 2After running `npx cypress open` you get a 'Cypress not found' error. What steps would you take to troubleshoot it?
  3. 3How would you configure Cypress to run tests in headless mode on your local machine?

2-5 years experience

  1. 1Your team wants to run Cypress tests in GitHub Actions, but they fail because the baseUrl isn't set for CI. How would you adjust the Cypress configuration to support both local and CI environments?
  2. 2A flaky test only appears on Chrome in CI. Explain how you'd modify the Cypress setup to isolate and stabilize that test.
  3. 3You need to integrate Cypress results with an existing test reporting tool. Which parts of the Cypress setup would you change and why?

5-8 years experience

  1. 1Design a strategy to scale Cypress test execution across multiple containers in a Kubernetes cluster, ensuring test isolation and efficient resource usage. What configuration changes and tooling would you use?
  2. 2Your monorepo contains several applications, each with its own Cypress suite. How would you structure the installation and configuration to avoid duplication while allowing per‑app overrides?
  3. 3Explain the trade‑offs of using Cypress's built‑in test runner versus a custom Docker image for CI, focusing on maintainability, speed, and debugging.

8+ years experience

  1. 1Your organization is migrating from Selenium to Cypress across dozens of services. Outline the architectural considerations, rollout plan, and how you'd manage shared configuration and versioning to minimize disruption.
  2. 2Discuss how you would set up a centralized Cypress dashboard and reporting pipeline that serves multiple product teams, balancing data privacy, access control, and cost.

Follow-up Questions

  • What problems have you run into when configuring Cypress for different environments?
  • How do you keep Cypress versions consistent across multiple projects?
  • Can you share an example where Cypress setup impacted your CI pipeline performance?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.