Containers and Kubernetes
25 questions in 7 subtopics.
JVM in containers
A Spring Boot service runs in a container with a 2 GiB memory limit and no JVM flags. How does the JVM pick its heap size, and why might it be either too small or too large?A Java pod restarts several times a day with exit code 137 and reason OOMKilled, but heap usage in metrics never exceeds 60 percent of -Xmx. How would you investigate?Your fleet runs 2,000 Java containers with inconsistent JVM flags copied between teams. How would you set and roll out standard JVM container settings?The company spends a large share of its cloud budget on memory for JVM containers. As the senior technical leader, how do you decide between tuning the existing fleet, adopting newer JDK features, moving some services to native images, or rewriting hot services in another language?Container images for Java
Compare building a container image for a Spring Boot app with a simple Dockerfile copying the fat jar, with layered jars, and with Cloud Native Buildpacks via spring-boot:build-image.A Spring Boot container works on a developer's laptop but fails in the cluster with 'exec format error'. Another image fails with permission denied writing to /tmp. Explain both.You need to reduce container image size and startup time for 30 Spring Boot services. What options do you have and what do they cost?Your security team requires all Java images to be rebuilt within 48 hours of a critical CVE in the base image or JDK. Design the image supply chain for 200 services.Health probes
Explain liveness, readiness and startup probes in Kubernetes and how Spring Boot Actuator supports them.During a database outage, all pods of a Spring Boot service were restarted repeatedly by Kubernetes, making recovery slower. The liveness probe pointed at /actuator/health. What went wrong?Define the health probe standard for all Spring Boot services on your Kubernetes platform, including what each probe may check and the default timings.Graceful shutdown
What happens when Kubernetes stops a Spring Boot pod during a rolling deployment, and how do you make in-flight requests finish?A Spring Boot service consumes Kafka messages and also runs a long batch export. During deployments, some messages are processed twice and exports are left half-written. How would you make shutdown safe?Your error budget reports show that every deployment across 100 services causes a short spike of 5xx errors. How would you eliminate this across teams?Resource limits
Explain Kubernetes CPU requests and limits and what CPU throttling looks like for a Java service.A latency-sensitive Spring Boot API has p99 spikes every few seconds. The pod has a CPU limit of 1 and requests of 0.5. GC logs show short pauses. What is happening and what would you change?Your cluster costs are rising and utilisation is around 20 percent, mainly due to Java services with large requests. How would you lead a right-sizing effort across teams?As the senior technical leader, you must set a company-wide policy for Kubernetes resource requests and limits and JVM sizing for 1,500 Java services. Teams argue for large safety margins; finance wants high utilisation. How do you set and govern the policy?Autoscaling
Explain how a Horizontal Pod Autoscaler scales a Spring Boot service on CPU and why JVM warmup can cause problems.A Spring Boot service consumes orders from Kafka with large daily spikes. CPU-based HPA reacts too late. Design an autoscaling approach.Your company is deciding whether to keep running Java services on self-managed Kubernetes clusters or move to a managed serverless container platform. As the senior technical leader, how do you evaluate this over several years?Your traffic has strong daily and seasonal peaks, and the platform keeps enough Java pods for peak load all day. As the senior technical leader, how would you decide the autoscaling strategy and how much to invest in faster JVM startup to support it?Docker CLI basics
Explain what these Docker commands do and when you would use each: docker build -t orders:1.2 ., docker run -d -p 8080:8080 --name orders -eSPRING_PROFILES_ACTIVE=dev orders:1.2, docker logs -f orders, docker exec -it orders sh, docker ps -a, docker image ls, docker rm -f orders.A Spring Boot container exits immediately after docker run. docker ps shows nothing, and the app works when started with java -jar on the laptop. Which Docker commands would you use to find the cause, and what are the common reasons?During an incident, a Java container in a Docker host (not Kubernetes) uses 100 percent CPU and responds slowly. Using only Docker CLI and JDK tools, how would you gather evidence without restarting it?No question matches these choices.