Intermediate & Advanced Interview Questions
Docker, Kubernetes, Kafka & Jenkins (Java
Developer – 5+ Years Experience)
This document contains production-oriented interview questions and answers frequently asked for Java developers
with 5+ years of experience. The questions focus on Docker, Kubernetes, Kafka, and Jenkins used in enterprise
microservices environments.
Docker Interview Questions
Q1. What is Docker?
Answer: Docker is a containerization platform used to package applications and dependencies together.
Q2. Why is Docker popular in microservices?
Answer: It provides portability, consistency, and lightweight deployments.
Q3. Difference between Docker and Virtual Machine?
Answer: Containers share the host OS kernel while VMs run separate operating systems.
Q4. What is a Docker Image?
Answer: A read-only template used to create containers.
Q5. What is a Docker Container?
Answer: A running instance of a Docker image.
Q6. Explain Docker architecture.
Answer: Docker uses client-server architecture with Docker daemon managing containers.
Q7. What is Docker Hub?
Answer: A cloud registry for storing and sharing Docker images.
Q8. What is Dockerfile?
Answer: A script containing instructions to build Docker images.
Q9. Difference between CMD and ENTRYPOINT?
Answer: ENTRYPOINT defines executable while CMD provides default arguments.
Q10. What are Docker Volumes?
Answer: Volumes provide persistent storage independent of containers.
Q11. What is bind mount?
Answer: A host directory mapped into a container.
Q12. What is Docker Compose?
Answer: A tool for managing multi-container applications.
Q13. How do containers communicate?
Answer: Using Docker networking like bridge or overlay networks.
Q14. What is multi-stage build?
Answer: A method to reduce image size by separating build and runtime stages.
Q15. How to reduce Docker image size?
Answer: Use alpine images, multi-stage builds, and minimize layers.
Q16. Explain Docker layers.
Answer: Each Dockerfile instruction creates a cached immutable layer.
Q17. What is Docker Swarm?
Answer: Docker’s native container orchestration platform.
Q18. How do you debug a container issue?
Answer: Using docker logs, exec, inspect, and monitoring tools.
Q19. What happens if a container crashes?
Answer: Docker restart policies can automatically restart containers.
Q20. Difference between COPY and ADD?
Answer: ADD supports URLs and extraction while COPY only copies files.
Kubernetes Interview Questions
Q1. What is Kubernetes?
Answer: An orchestration platform for managing containerized applications.
Q2. What is a Pod?
Answer: The smallest deployable unit in Kubernetes.
Q3. What is a Node?
Answer: A machine where Kubernetes workloads run.
Q4. Explain Kubernetes architecture.
Answer: Master and worker nodes coordinate cluster operations.
Q5. What is a Deployment?
Answer: Manages stateless application deployments.
Q6. What is StatefulSet?
Answer: Used for stateful applications with stable identities.
Q7. Difference between Deployment and DaemonSet?
Answer: DaemonSet runs one Pod per node.
Q8. What is a Service?
Answer: Provides stable networking for Pods.
Q9. Types of Kubernetes Services?
Answer: ClusterIP, NodePort, LoadBalancer, and ExternalName.
Q10. What is Ingress?
Answer: Manages external HTTP/HTTPS traffic routing.
Q11. What is ConfigMap?
Answer: Stores non-sensitive configuration data.
Q12. What is Secret?
Answer: Stores sensitive data securely.
Q13. What are namespaces?
Answer: Logical partitions inside a cluster.
Q14. What is HPA?
Answer: Horizontal Pod Autoscaler scales Pods automatically.
Q15. What is a liveness probe?
Answer: Checks if an application is alive.
Q16. What is readiness probe?
Answer: Checks if an application is ready to receive traffic.
Q17. What happens when a Pod fails?
Answer: Kubernetes recreates it automatically.
Q18. What is rolling deployment?
Answer: Gradual replacement of application Pods.
Q19. What is Helm?
Answer: A package manager for Kubernetes.
Q20. How do you monitor Kubernetes?
Answer: Using Prometheus, Grafana, ELK, and metrics-server.
Kafka Interview Questions
Q1. What is Apache Kafka?
Answer: A distributed event-streaming platform.
Q2. Why is Kafka used?
Answer: For high-throughput and fault-tolerant messaging.
Q3. Explain Kafka architecture.
Answer: Kafka consists of brokers, topics, partitions, producers, and consumers.
Q4. What is a Topic?
Answer: A category where Kafka stores messages.
Q5. What is a Partition?
Answer: A division of a topic enabling parallelism.
Q6. Why are partitions important?
Answer: They improve scalability and throughput.
Q7. What is a Broker?
Answer: A Kafka server storing messages.
Q8. What is replication in Kafka?
Answer: Copies partitions across brokers for fault tolerance.
Q9. What is ISR?
Answer: In-sync replicas fully synced with leader.
Q10. What is consumer lag?
Answer: Difference between produced and consumed offsets.
Q11. How does Kafka guarantee durability?
Answer: By persisting messages on disk with replication.
Q12. Difference between at-most-once and exactly-once?
Answer: Exactly-once avoids duplication and loss.
Q13. What causes consumer lag?
Answer: Slow processing or insufficient consumers.
Q14. What is retention policy?
Answer: Defines how long Kafka stores messages.
Q15. What is offset?
Answer: A unique identifier for messages in partitions.
Q16. How does Kafka handle failures?
Answer: Leader election and replica synchronization.
Q17. What is idempotent producer?
Answer: Prevents duplicate message production.
Q18. What is Kafka Streams?
Answer: A library for stream processing.
Q19. What is dead letter queue?
Answer: Stores failed messages for later analysis.
Q20. How do you monitor Kafka?
Answer: Using Prometheus, Grafana, Burrow, and JMX metrics.
Jenkins Interview Questions
Q1. What is Jenkins?
Answer: An open-source CI/CD automation server.
Q2. Why is Jenkins used?
Answer: To automate build, test, and deployment pipelines.
Q3. What is Jenkins Pipeline?
Answer: A code-based CI/CD workflow.
Q4. Difference between Declarative and Scripted Pipeline?
Answer: Declarative is structured while scripted is flexible.
Q5. What is Jenkinsfile?
Answer: Pipeline definition stored in source control.
Q6. What are Jenkins agents?
Answer: Machines executing Jenkins jobs.
Q7. What is Blue-Green deployment?
Answer: Switching traffic between old and new environments.
Q8. What is Canary deployment?
Answer: Releasing features to a subset of users first.
Q9. How do you integrate Jenkins with Git?
Answer: Using Git plugins and webhooks.
Q10. How do you secure Jenkins?
Answer: RBAC, HTTPS, credentials management, and restricted plugins.
Q11. How does Jenkins integrate with Docker?
Answer: Pipelines can build and deploy Docker containers.
Q12. How does Jenkins integrate with Kubernetes?
Answer: Dynamic agents can run as Kubernetes Pods.
Q13. What are Jenkins stages?
Answer: Logical pipeline execution steps.
Q14. What is CI?
Answer: Continuous Integration for automated builds/testing.
Q15. What is CD?
Answer: Continuous Delivery/Deployment automation.
Q16. What are shared libraries?
Answer: Reusable pipeline code across projects.
Q17. How do you troubleshoot failed builds?
Answer: Analyze logs, environment, and dependency failures.
Q18. What is rollback strategy?
Answer: Reverting deployment to stable versions.
Q19. What plugins are commonly used?
Answer: Git, Docker, Kubernetes, Maven, SonarQube, Slack.
Q20. How do you optimize Jenkins performance?
Answer: Distributed builds, cleanup jobs, and optimized pipelines.