Skip to the notes
JSGroundwork
JSGroundwork handwritten · web dev
✎Playground→⌘Problems↻Review🔥Progress

Chapters

20 chapters
⌕
Beginner15›
00Scouting reportR1Screening callR2Machine codingR3JavaScript & TSR3·TSTypeScriptR4React & Next.jsR5Node & NestJSR6Databases & RedisR7DSA roundR8System designR9AWS, Docker, CI/CDR10Resume grillingR11BehaviouralR12HR & the number✓The week before
Advanced5›
50LWhat changes at ₹50L50LHard DSA50LDistributed systems50LRuntime internals50LStaff behavioural
/ search[ ] chaptert top

Ready to read

JSJavaScript⑂Git◎Interview prepΣDSA in JSSDSystem Design
More topics15›
</>HTML{ }CSS⚛ReactNNext.jsNeNest.jsTSTypeScriptNoNode.js🐳DockerDBSQL & Databases✓Testing🔒Web Security☁Cloud & DevOps◈GraphQL◆Redis☸Kubernetes
100%
R9

AWS, Docker & CI/CD

Length20–30 min, usually folded in
WhoBackend lead or DevOps
DecidesWhether your deployment claims are real
Fail modeOverclaiming cloud depth
productsaasserviceagency

Your AWS surface is narrow — EC2, S3, IAM. That is completely fine at six years for a full-stack role. What is not fine is letting them discover it. Own the boundary before they find it and it becomes honesty; let them find it and it becomes a gap.

9.1
Describe your deployment pipeline end to end.
What they are really testingWhether "4 hours to 15 minutes" is a real pipeline you built or a line you wrote.

That last paragraph is worth more than pretending. Every interviewer has been burned by a candidate who listed Kubernetes and could not explain a pod — and they test for it, so the downside of overclaiming is severe and the upside of honesty is real.

Say it like this

A push to a branch triggers a GitHub Actions workflow: install, lint, type-check, unit tests, then a Docker build. On merge to main it builds the image, tags it with the commit SHA, pushes to the registry, and deploys to EC2 by pulling the new tag and restarting the container behind a health check. That took our release from a roughly four-hour manual process — SSH in, pull, install, build, restart, check by hand — to about fifteen minutes, which is the difference between a hotfix being an event you schedule and a hotfix being routine.

To be straight about the shape of it: this is Docker on EC2 instances, not a managed orchestrator. We did not run Kubernetes or ECS, because at four applications and this traffic the operational cost was not worth what it would have bought us. I can hold a conversation about ECS task definitions, but I would be learning it properly on the job rather than claiming it.

They will push with
  • How do you roll back?
  • What runs in CI that is not a test?
  • Why tag with the SHA rather than latest?
9.2
How did you cut infrastructure cost 25%?
What they are really testingThe metric interrogation again, in the infrastructure round.

Have the specific levers ready, and name which one accounted for most of it. The credible ones for your setup:

  • Right-sizing. Instance sizes chosen at project start and never revisited against actual CloudWatch utilisation. This is usually the biggest single win and it is the most honest answer.
  • Non-production environments. Five environments running production-sized instances 24/7. Shrink them, and shut them down outside working hours — that alone is roughly a 65% saving on those instances.
  • S3 lifecycle rules moving old assets to infrequent-access or Glacier.
  • Orphaned resources — unattached EBS volumes, idle Elastic IPs, old snapshots, unused load balancers. Every long-running AWS account has these.
  • Savings plans or reserved instances for the steady-state baseline, on-demand for the rest.
  • Data transfer — often the invisible line item. Serving assets from S3 and CloudFront instead of from the instance.
Say it like this

Mostly it was right-sizing and the non-production environments. We had picked instance sizes at the start of the project and never revisited them against real utilisation, and the four non-production environments were running the same sizes as production around the clock.

They will push with
  • How did you measure the baseline?
  • What did you look at to decide a size was wrong?
  • What would you cut next?
9.3
Walk me through a Dockerfile for a Node service. What makes it good?
What they are really testingWhether you copied a Dockerfile or understand layer caching and image size.

Score the points explicitly as you go:

  • Multi-stage, so build tooling and dev dependencies never ship. Often a 10× size difference.
  • Copy the manifest before the source, so the npm ci layer is reused when only code changes. This is the single biggest build-time win and the thing most Dockerfiles get wrong.
  • npm ci not npm install — reproducible from the lockfile, and it fails rather than silently updating.
  • Non-root user.
  • Exec-form CMD. Shell form wraps the process in /bin/sh, which does not forward SIGTERM — so your graceful shutdown from R5 never runs and every deploy kills in-flight requests.
  • .dockerignore with node_modules, .git, .env — otherwise you copy the host's node_modules into the build context and both slow the build and risk shipping secrets.
# ---- build ----
FROM node:26-alpine AS build
WORKDIR /app
COPY package*.json ./          # before the source: this layer caches
RUN npm ci
COPY . .
RUN npm run build

# ---- run ----
FROM node:26-alpine
WORKDIR /app
ENV NODE_ENV=production
COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force
COPY --from=build /app/dist ./dist
USER node                      # never run as root
EXPOSE 3000
HEALTHCHECK --interval=30s CMD node healthcheck.js
CMD ["node", "dist/main.js"]   # exec form — receives SIGTERM directly
They will push with
  • Why is the image still 400MB and how would you shrink it? (distroless, or alpine + prune.)
  • What is a layer and why does order matter?
  • How do you get secrets into a build without baking them in?
9.4
How do you manage secrets and configuration across five environments?
What they are really testingA GetDandy question — you claimed five environments, so this is the audit.

Nothing in the repository, ever. Then a layered answer:

  • Pipeline secrets — GitHub Actions encrypted secrets or environments with required reviewers for production.
  • Runtime secrets — AWS Systems Manager Parameter Store (cheap) or Secrets Manager (rotation built in), read at boot or injected by the deploy.
  • IAM roles, not long-lived access keys. An instance profile or OIDC federation from GitHub Actions means there is no static key to leak.
  • A committed .env.example documenting required keys without values, so a new developer knows what is needed.
  • Boot-time validation — ConfigModule with a Joi or Zod schema, so a missing variable fails the process immediately with a clear message rather than causing a null-pointer at 3am inside one request path.

If they push on what you would do differently: per-environment parameter paths (/app/prod/DB_URL) with IAM policies scoped to the path, so the staging role literally cannot read production secrets. That is the control that turns a mistake into a permission error.

They will push with
  • What do you do when a secret leaks?
  • How do you rotate a database password with zero downtime?
  • How does a developer run this locally?
9.5
Rapid-fire infrastructure
What they are really testingBreadth. Answer honestly — this is the round where overclaiming is most likely to be caught.
  • Image vs container vs layer. An image is a read-only template built from stacked layers; a container is a running instance of one with a writable layer on top.
  • docker-compose in development, not production. It has no rolling updates, no health-based routing, no multi-host scheduling. Fine for local dependencies; not a deployment strategy.
  • Blue-green vs rolling vs canary. Blue-green: two full environments, switch traffic, instant rollback, double the cost. Rolling: replace instances gradually, cheap, but both versions run at once so your database schema must support both. Canary: a small percentage first, watch the error rate, then proceed.
  • Rollback in under five minutes. Because images are tagged by commit SHA, rollback is re-deploying the previous tag. The thing that makes rollback hard is a database migration that already ran — which is why expand-migrate-contract from R6 matters.
  • EC2 vs ECS vs Lambda. EC2 when you want full control and a steady load. ECS/Fargate when you want containers without managing the hosts — the natural next step from where you are. Lambda for spiky, short, stateless work; watch cold starts and the 15-minute limit.
  • What a load balancer buys you. Health-checked routing, TLS termination, zero-downtime deploys, and a place to put WAF rules. Without one you cannot deploy without dropping requests.
  • S3 + CloudFront over serving from Node. Your process should never spend its single thread pushing static bytes. The CDN also puts the asset physically closer to the user.
  • IAM role vs user. A user has long-lived credentials; a role is assumed temporarily and its credentials rotate automatically. Prefer roles everywhere — a leaked role session expires, a leaked access key does not.
  • Monitoring — be honest. "Today it is structured logs, and I know that is the gap. What I would add first is error tracking (Sentry), then p95 latency and error rate per endpoint with alerts, then an uptime check. I would add tracing last, because it costs the most to instrument and pays off only once you have several services."
  • Have you been on call? Answer truthfully. If not: "not on a formal rota — I have been the person called when a client system broke, which is the same job without the pager." Then describe an actual incident.
  • Zero-downtime deploy with a migration in it. The expand-migrate-contract sequence, plus: migrations run as a separate step before the new code deploys, never on application boot — otherwise five instances start migrating simultaneously.
  • Infrastructure as code. If you have not used Terraform, say so, and say what you did instead (console plus documented steps) and why that is worse — drift, no review, no reproducibility.
←previousSystem design↑ CovernextResume grilling→