Session clustering with Spring Session, fixing session loss across servers, YAML vs properties performance, your CI/CD toolchain and deployment structure, writing a Jenkins pipeline, flaky pipeline builds, rolling back a bad release, securing secrets in the pipeline, and automating microservice deployments.
Published September 25, 2026
Deployment questions ask about your project, so prepare a concrete, honest description of your pipeline and runtime. Around it, show the principles interviewers look for: build once, automated gates, fast rollback, and secrets never in Git.
Short answer: Use Spring Session with a shared store, usually Redis. Add spring-session-data-redis plus spring-boot-starter-data-redis, and point it at Redis. Spring Boot 3 auto-detects the store (the old spring.session.store-type property was removed), and replaces the container's HttpSession with one backed by Redis. Every instance then sees the same sessions.
spring:
data:
redis:
host: redis.internal
port: 6379
session:
timeout: 30m
redis:
namespace: shop:sessions
flush-mode: on-save
Key points to cover:
Short answer: The session lives in one instance's memory, so when the load balancer sends the next request to another instance, or the instance restarts, the session is gone. The options:
Key points to cover:
SameSite, Secure) behind the load balancer..properties affect performance?Short answer: Not in any way that matters. Configuration is parsed once at startup. YAML parsing is marginally slower, a matter of milliseconds, and it has zero runtime impact afterwards. Choose based on readability and team conventions: YAML for nested and list-heavy configuration, properties for simple flat keys. The real risks are correctness ones (YAML indentation and type coercion), not speed.
Short answer (describe yours honestly): For example:
"GitHub Actions runs CI on every PR: build, unit and integration tests with Testcontainers, SpotBugs, a dependency scan and an image scan. On merge, it builds a container image, tagged with the commit SHA, and pushes it to ECR. Argo CD (GitOps) deploys by syncing Helm charts from a deployment repository. We promote dev → staging → prod by updating the image tag in a PR, with canary analysis through Argo Rollouts, and automatic rollback."
Key points to cover:
Learn it in depth → CI/CD Pipeline Design
Short answer (a model):
Short answer: Create a Pipeline (or Multibranch Pipeline) job that reads a Jenkinsfile from the repository, as pipeline as code. Use the declarative syntax, with stages, agents, credentials, post-actions and quality gates.
pipeline {
agent { label 'docker' }
options { timeout(time: 30, unit: 'MINUTES'); disableConcurrentBuilds() }
stages {
stage('Build & Test') { steps { sh './mvnw -B verify' } }
stage('Image') {
when { branch 'main' }
steps {
withCredentials([usernamePassword(credentialsId: 'registry', usernameVariable: 'U', passwordVariable: 'P')]) {
sh 'docker build -t registry.acme/orders:${GIT_COMMIT} . && echo $P | docker login -u $U --password-stdin registry.acme && docker push registry.acme/orders:${GIT_COMMIT}'
}
}
}
stage('Deploy staging') { when { branch 'main' } steps { sh './deploy.sh staging ${GIT_COMMIT}' } }
}
post { always { junit '**/target/*-reports/*.xml' } failure { slackSend channel: '#orders-ci', message: "Build failed: ${env.BUILD_URL}" } }
}
Short answer: Treat flakiness as a bug, not bad luck:
Thread.sleep, async code without proper waiting (use Awaitility).Short answer:
kubectl rollout undo deployment/orders, or re-point the image tag in GitOps.Short answer:
Common trap: "Kubernetes Secrets are secure". By default they're only base64-encoded. Enable encryption at rest (KMS), and restrict access with RBAC, or source them from an external manager.
Short answer (a model story): "We had 18 services deployed by hand-run scripts, and releases took a day. I introduced a shared pipeline template (a reusable workflow), so each service repository got the same stages: build, test, SAST and dependency scans, image build with Jib, image scan, and pushing the image tagged with the commit SHA. Deployment moved to GitOps: Argo CD watching a repository of Helm values, with the pipeline opening an automated PR to bump the image tag. Staging deploys automatically. Production uses canary rollouts with Prometheus-based analysis, and automatic rollback. Deployments went from about 1 a week to about 20 a day, and failed changes are rolled back in minutes."
Key points to cover:
Q: What's the difference between continuous delivery and continuous deployment? A: Continuous delivery: every change is automatically built, tested and made ready to release, and a human approves production. Continuous deployment: every change that passes the pipeline goes to production automatically.
Q: Why tag images with the commit SHA rather than latest?
A: SHA tags are immutable and traceable to the exact source. latest is mutable, so you can't tell what's running, and rollbacks become ambiguous.
Q: What is GitOps? A: The desired state of the environment (manifests, Helm values) lives in Git. An agent (Argo CD, Flux) continuously reconciles the cluster to match it. Changes and rollbacks are Git commits, which gives you audit trails and easy reverts.
Q: How do you keep a Jenkins controller secure? A: Run builds on ephemeral agents (never on the controller), keep the plugins minimal and updated, use RBAC, store credentials in Jenkins' credential store or an external vault, and enforce pipeline-as-code with review.