All jobs / Full-stack developer / DevOps Basics
Full-stack developer interview question · 3–5 years
The pipeline builds the client three times, once per environment, because the API URL is baked in at build time.
What do you change, and what stays at build time?
The strongest answer
Build once and promote that artifact: the client reads its API URL and flags at runtime from a small config the server serves, so what you tested ships — and no secret goes in either
Why it works
Right — one artifact through every environment; a build per environment means production runs a binary nobody tested.
What a good answer covers
- Build once, promote the artifact.
- Configuration arrives at runtime.
- Test the bytes you will ship.
- No secrets in the client, ever.
Answers that fall short
- Close, but not the strongest: Keep the three builds, but pin them to the same commit so at least the code is identical
Same source, different outputs: the bytes in production are still produced by a job whose variables or cache could differ. - Weak: Read the environment from the hostname in the browser and pick the API URL from a lookup table
It works until a preview domain, a custom domain or a local port appears, and the mapping lives in code you must rebuild to change. - Red flag: Put every environment’s configuration, analytics and payment keys included, in the bundle and choose one at startup
Anything in the bundle is public, and shipping every environment’s keys hands over the ones you never meant to expose.
Who gets asked this
More DevOps Basics questions
- A feature flag has been on for everyone for four months. Both code paths are still there. When is the flag…
- Every PR gets a preview URL. The default env still has the production API base. What must a preview deploy…
- Prod: 'submit does nothing'. API dashboards look calm. The SPA error rate ticked up after a mixed deploy…
- API 5xx is 0.1%. Users still report 'save failed' because the SPA cannot reach a new path. Which errors go in…
- Platform wants daily UI deploys and weekly API deploys from the same repo. When may UI and API ship on…
- What would you set up so that the next one does not?
- Someone wants to put the API URL and the database password in `.env` for Vite. What can go in the frontend…
- A user says 'save failed'. You have UI logs and API logs and no join. How do you trace one click?