JS Guide
HomeQuestionsSearchResources
Search

Built for developers preparing for JavaScript, React & TypeScript interviews.

ResourcesQuestionsSupport
HomeQuestionsSearchProgress
HomeQuestionstesting

testing

Unit testing, integration testing, and E2E testing strategies

Your Progress

0 of 5 completed

0%

5 Questions

senior Level
1
What are E2E tests and when should you use Cypress vs Playwright?
senior
e2e
E2E tests simulate real user scenarios across the full application stack. Cypress excels in developer experience with time-travel debugging and automatic waiting. Playwright offers cross-browser support, better parallelization, and handles multiple contexts.
2
How do you design a testing strategy for a large application?
senior
strategy
A testing strategy defines what to test, how much, and when. Use the testing trophy/pyramid as a guide: prioritize integration tests, supplement with unit tests for complex logic, and use E2E for critical paths. Consider cost, speed, and confidence.
3
How do you test application performance and prevent regressions?
senior
performance
Performance testing includes benchmarks for code execution time, Lighthouse CI for web vitals, and load testing with tools like k6. Set performance budgets, run tests in CI, and alert on regressions. Focus on critical user paths.
4
What is visual regression testing and how do you implement it?
senior
visual
Visual regression testing captures screenshots and compares them against baseline images to detect unintended UI changes. Tools like Percy, Chromatic, or Playwright screenshots help catch CSS regressions. Best for component libraries and design systems.
5
What is TDD and how does it compare to BDD?
senior
methodology
TDD (Test-Driven Development) writes tests before code in a red-green-refactor cycle. BDD (Behavior-Driven Development) extends TDD with natural language specifications focusing on behavior from user's perspective. TDD is developer-focused; BDD involves stakeholders.