Testing and Tooling interview questions
100 Frontend Engineering practice questions. Read what a strong answer covers, then practise it out loud against the clock.
Practise Testing and Tooling questionsBeginner
- A test sometimes passes and sometimes fails
- Adding ESLint to a project with thousands of warnings
- Assertions and matchers
- Code formatting with Prettier
- Continuous integration for frontend projects
- Debugging frontend code with browser DevTools
- Developers skip running tests before pushing
- End-to-end testing tools: Playwright and Cypress
- Linting with ESLint
- Mocks, stubs and spies
- npm, pnpm and Yarn
- Pre-commit hooks
- Semantic versioning and version ranges
- Source maps
- Test runners like Jest and Vitest
- Testing a component that loads data
- Testing a login form
- Testing a price formatting function
- Tests are hard to understand when they fail
- Tests break whenever CSS classes change
- Tests pass but print lots of warnings
- The app works locally but fails in CI
- The Arrange-Act-Assert structure for frontend tests
- The testing pyramid and testing trophy
- Transpiling with Babel, SWC and esbuild
- Unit, integration and end-to-end tests
- Updating an outdated dependency safely
- What code coverage tells you
- What frontend build tools do
- What makes Vite fast in development
- What Testing Library is and its philosophy
- Why frontend code needs automated tests
- Why lockfiles matter
- Writing a first test for a counter component
Intermediate
- A bug only appears in the production build
- Adding accessibility assertions to component tests
- Avoiding testing implementation details
- CI takes too long on every pull request
- Contract testing between frontend and backend
- Dependencies fall badly out of date
- Dependency vulnerabilities and auditing
- E2E tests need to log in through a third-party identity provider
- End-to-end tests are flaky and ignored
- Environment variables in frontend builds
- Error states are never tested
- Every test repeats the same provider setup
- Fake timers and controlling time in tests
- High coverage but bugs still slip through
- Hot module replacement
- Mock Service Worker
- Monorepo tooling: Nx and Turborepo
- Refactoring untested legacy code safely
- Reusing Storybook stories as tests
- Snapshot testing and its trade-offs
- Storybook and component-driven development
- Test setup is duplicated and hard to maintain
- Testing a custom hook
- Testing a modal rendered in a portal
- Testing components that depend on routing
- Tests pass alone but fail when run together
- The unit test suite takes 20 minutes
- Type checking as part of the test strategy
- Understanding act() warnings in React tests
- user-event vs fireEvent
- Visual regression testing
- Where to mock: choosing the right boundary
- Writing reliable end-to-end tests
Experienced
- A compromised npm package is discovered in your dependencies
- Adding automated performance testing to CI
- Automating accessibility testing in the pipeline
- Bugs appear only in Safari
- Designing a frontend test strategy
- Designing a safe frontend release process
- Ephemeral preview environments
- Frontend observability in production
- How bundlers work internally
- Introducing visual regression testing for a design system
- jsdom vs real browser test environments
- Linting and type checking are too slow in a large repo
- Managing test data for E2E tests at scale
- Measuring and managing test flakiness
- Migrating a large app from webpack to Vite
- Migrating a large test suite from Jest to Vitest
- Module federation
- Mutation testing for frontend code
- New developers take days to get the frontend running
- Nobody owns broken tests in a large organisation
- Preventing bundle size regressions automatically
- Quality gates and their trade-offs
- Reproducible builds and supply chain security
- Safely testing frontend changes in production
- Scaling CI for a frontend monorepo with 50 packages
- Testing real-time features that use WebSockets
- Testing strategy for independently deployed micro-frontends
- Too many slow E2E tests duplicate component tests
- Triage a spike in frontend errors after a release
- Turning around a codebase with poor test culture
- Using AI tools to write tests
- Validating a risky frontend change with a canary release
- Writing custom lint rules and codemods