Interview questions and model answers
"Describe Jenkins architecture and how you'd run it in production."
A controller schedules work, stores config and build history in JENKINS_HOME and interprets pipelines; agents execute build steps over the remoting channel. In production I'd run the controller on EKS from a custom image with pinned plugins and JCasC, JENKINS_HOME on a PVC with snapshots, zero executors on the controller, and ephemeral agents via the Kubernetes plugin with per-build pod templates and IRSA for AWS access. SSO with role-based folder permissions, credentials scoped per folder, and everything — config, jobs, pipelines — in Git.
"How do you secure Jenkins?"
Authentication via SSO, least-privilege authorization with roles and folders, no builds on the controller, the Groovy sandbox with careful script approvals, restricted script console, agent-to-controller security on, folder-scoped credentials used with withCredentials and single-quoted shell steps, no static AWS keys (IRSA or OIDC role assumption), TLS and network restrictions in front of the controller, prompt LTS and plugin updates driven by security advisories, a minimal plugin set, and audit logging with config changes through Git.
"Builds are stuck in the queue. How do you troubleshoot?"
Read the queue reason. If it's waiting for a label, check whether any online agent has that label and free executors. With Kubernetes agents, check whether pods are being created and why they're Pending — quotas, node capacity, image pulls, taints — and the cloud's concurrency cap. If the controller itself is slow, check heap and GC and thread dumps. Longer term: autoscaling agents and alerts on queue length.
"How do you make Jenkins reproducible and recoverable?"
Controller image with pinned core and plugins, JCasC for system config, Job DSL or Organization Folders for jobs, pipelines and shared libraries in Git, secrets injected from a secret manager. Plus scheduled snapshots of JENKINS_HOME with tested restores. Then losing the controller means redeploying from Git and restoring history from a snapshot.
"Is Jenkins highly available?"
Not active-active in open source — one controller owns JENKINS_HOME. I design for fast recovery: Kubernetes reschedules the controller, the PVC reattaches, running pipelines resume from checkpoints, JCasC rebuilds config, and I split large estates into multiple controllers to reduce blast radius. For true HA, CloudBees CI.
"How would you deploy to EKS from Jenkins in a GitOps model?"
Jenkins does CI: test, scan, build the image with Kaniko, push to ECR with the git SHA tag. Then it updates the GitOps repo — kustomize edit set image in the environment overlay — via a commit or PR. Flux in the cluster reconciles. Promotion to prod is a reviewed change to the prod overlay with the same tag. Jenkins never holds cluster-admin credentials.
"Jenkins or GitHub Actions?"
Depends on context. Jenkins suits complex, on-prem or heavily customised pipelines and teams that already have the expertise, but it carries operational overhead — controller upkeep, plugins, security patching. GitHub Actions removes most of that, integrates with PRs and OIDC to AWS natively, and reusable workflows replace shared libraries. For a GitHub-centric team starting fresh I'd pick Actions plus Flux for CD; for an existing large Jenkins estate I'd modernise it (JCasC, ephemeral agents, shared libraries) or migrate in waves.