Describe a good CI/CD pipeline for a full stack app. What runs on each pull request and how do you deploy safely?
What the interviewer wants to hear
- Lint, type check, unit and integration tests on every PR
- Preview deployments for review
- Database migrations run as a controlled step
- Gradual or blue-green rollout with health checks
- Fast rollback and monitoring after deploy
Model answer
On every pull request, GitHub Actions or a similar tool installs dependencies with a cached lockfile, then runs linting, TypeScript type checks, unit tests and integration tests against a real test database in a container. It also builds the app, and a platform like Vercel creates a preview deployment so reviewers and QA can click through the change. After merge to main, the pipeline runs database migrations as a separate step, written to be backward compatible, and then deploys. I prefer gradual rollouts or blue-green deployments with health checks, so a bad release only reaches a few users. Feature flags let us ship code turned off and enable it later. After deploy, error tracking and dashboards show if error rates or latency go up, and rollback is one click, which is another reason migrations must stay compatible with the previous version.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Full Stack Developer questions
- How would you implement login for a web app? Compare server sessions with JWT access tokens and explain what you would choose.
- Users say the orders page is slow. How do you find and fix the problem across frontend, API and database?
- How would you build a feature that lets users upload profile photos and PDF documents up to 100 MB?
- Your API is used by a web app and an older mobile app that users do not update quickly. How do you make a breaking change safely?
- You need to build a product search page with text search, filters and sorting. Walk through the design from the UI to the database.
- How would you add role-based access control (admin, editor, viewer) to an existing full-stack app?
- What is your testing strategy for a full-stack feature such as "invite a teammate by email"?
- Describe the different layers where you can cache in a typical full-stack web app, and how you keep cached data correct.
- You need to show in-app notifications in real time. How do you choose between polling, server-sent events and WebSockets, and how would you build it?