Layer tests by cost and speed: unit tests for domain logic, integration tests for DB and services, contract tests for HTTP API, and E2E tests for critical user flows using Playwright.
Unit tests: pure functions, domain logic, error handling — fast, no I/O, run on every commit
Integration tests: repository + real DB (testcontainers), service + message queue — run on PR
API contract tests: HTTP handlers with httptest.NewServer + real DB — verify request/response shapes
E2E tests: Playwright/Cypress against a deployed staging environment — run before production deploy
Race detector: go test -race in CI catches data races missed by functional tests
You need to add unit tests for a new Go handler that returns JSON. Walk me through how you'd set up the test file and which tools you'd use.
For the React component that displays a list fetched from the Go API, how would you write a test to verify it renders correctly with mock data?
If a test for your Go service fails locally but passes in CI, what steps would you take to investigate?
We want to introduce integration tests that spin up the Go server and the React app. What approach would you take, and why might you choose Docker Compose over a mock server?
A teammate reports that the end‑to‑end test suite became flaky after a recent auth change. How would you debug and stabilize it?
Explain the trade‑offs between running Go tests in parallel versus serially when they share a test database.
Our service handles 10k requests per second and the CI pipeline runs the full test suite on every PR. How would you design a testing strategy that keeps feedback fast while maintaining confidence at scale?
We need to ensure contract compatibility between the Go API and the React frontend across multiple versions. What testing patterns would you put in place and how would you enforce them?
If we decide to migrate from a monolithic test suite to a micro‑service‑oriented testing framework, what architectural changes would you prioritize?
The company plans to adopt a unified testing platform across several product teams, each with Go backends and various frontends. How would you define standards, tooling, and governance to make this sustainable?
We have legacy Go services without tests and a React codebase with ad‑hoc tests. Design a phased migration plan to bring both sides up to a modern testing strategy without blocking feature delivery.
When evaluating a cloud‑based CI/CD solution that promises auto‑scaling test runners, what criteria would you use to decide if it fits our full‑stack Go/React testing needs?