[go: up one dir, main page]

0% found this document useful (0 votes)
14 views14 pages

Mock Interview - Topic - Kubernetes (Freshers, Medium, Advanced)

The document is a comprehensive mock interview guide for Kubernetes, featuring questions categorized by experience level: freshers, medium-level, and advanced. It includes expected answers, hints, and scenario-based questions to facilitate a conversational interview process. The guide aims to help interviewers assess candidates' knowledge and practical understanding of Kubernetes concepts and functionalities.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views14 pages

Mock Interview - Topic - Kubernetes (Freshers, Medium, Advanced)

The document is a comprehensive mock interview guide for Kubernetes, featuring questions categorized by experience level: freshers, medium-level, and advanced. It includes expected answers, hints, and scenario-based questions to facilitate a conversational interview process. The guide aims to help interviewers assess candidates' knowledge and practical understanding of Kubernetes concepts and functionalities.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Mock Interview Guide - Kubernetes

🗃️ Instructions for Interviewer:


●​ You are playing the role of interviewer. Use this guide as a script.
●​ Ask each question one at a time. Follow the steps: Definition → Details → Scenario
→ Follow-up.
●​ If the interviewee struggles, use the hint.
●​ The goal is to keep it conversational and practical. Help the interviewee think and
express their learning.
●​ colors assigned: Questions Answers Hint

Freshers - Level
Kubernetes (10 Easy DevOps Interview Questions)

1.​ Ask: 🗣️ "What is Kubernetes and what problem does it solve?"


✅ Expected Answer: "Kubernetes is an open-source platform that
automates container deployment, scaling, and management. It
solves the problem of managing large-scale containerized
applications."

💡 Hint: "Think of it as a container orchestration system."


2.​ Ask: 🗣️ "What is a Pod in Kubernetes?"
✅ Expected Answer: "A Pod is the smallest deployable unit in
Kubernetes. It can hold one or more containers that share storage,
network, and context."

💡 Hint: "Think of a Pod as a wrapper around containers."


3.​ Ask: 🗣️ "What is the role of kubelet?"
✅ Expected Answer: "The kubelet is an agent that runs on each
node and ensures containers are running in a Pod."

💡 Hint: "It's the component that communicates between the control


plane and the node."

4.​ Ask: 🗣️ "What is a Deployment in Kubernetes?"


✅ Expected Answer: "A Deployment provides declarative updates
to Pods and ReplicaSets."

💡 Hint: "It helps in scaling and rolling updates."


5.​ Ask: 🗣️ "What command is used to view running Pods?"
✅ Expected Answer: "kubectl get pods"
💡 Hint: "It starts with 'kubectl get ...'’
6.​ Ask: 🗣️ "What is a Service in Kubernetes?"
✅ Expected Answer: "A Service exposes an application running
on a set of Pods as a network service."

💡 Hint: "Think of it as a stable endpoint for accessing Pods."


7.​ Ask: 🗣️ "What types of Services are there in Kubernetes?"
✅ Expected Answer: "ClusterIP, NodePort, LoadBalancer,
ExternalName."

💡 Hint: "Think about how services can be exposed inside or outside


the cluster."

8.​ Ask: 🗣️ "What is a ConfigMap used for?"


✅ Expected Answer: "ConfigMap is used to store non-sensitive
configuration data such as key-value pairs."

💡 Hint: "Used to pass environment-specific values into Pods."


9.​ Ask: 🗣️ "What is the function of a namespace in Kubernetes?"
✅ Expected Answer: "Namespaces allow you to divide cluster
resources between users or teams."

💡 Hint: "Useful for managing multi-tenant clusters."


10.​ Ask: 🗣️ "How do you scale a Deployment?"
✅ Expected Answer: "Use 'kubectl scale deployment --replicas='
or update the YAML file."

💡 Hint: "Scaling means increasing or decreasing the number of Pod


replicas."
Scenario-Based Questions

🗣️
1️. Ask: “You want to run your app in Kubernetes. What’s the first thing
you need to create?”

✅ Expected: “A Pod or a Deployment using a YAML file.”


💡 Hint: “What object actually runs the container?”


2.🗣️ Ask: “Your container keeps restarting again and again. What would
you check?”

✅ Expected: “Check pod status using kubectl describe or logs to


find crash loop reason.”

💡 Hint: “Use kubectl get pods and then describe/logs.”


🗣️
3️. Ask: “You want to expose your pod so it can be accessed from
outside. What would you use?”

✅ Expected: “Use a Service (type NodePort or LoadBalancer).”


💡 Hint: “Think about networking in Kubernetes.”


🗣️
4️. Ask: “You made a change to your container image. How can you
make Kubernetes pull the new version?”

✅ Expected: “Update the image version in the deployment and do


a rollout.”

💡 Hint: “Use kubectl set image or edit the deployment.”


Project-Based Questions

🗣️
5️. Ask: “Suppose you built a simple Python Flask app. How would
you run it on Kubernetes?”

✅ Expected: “Create a Docker image, push to Docker Hub, write a


Deployment YAML, and apply it.”

💡 Hint: “Think: Docker + YAML + kubectl apply.”


🗣️
6️. Ask: “You want to deploy a static website using NGINX. How would
you do that in Kubernetes?”

✅ Expected: “Use an NGINX image in a pod or deployment and


expose it via a Service.”

💡 Hint: “Use official NGINX image + NodePort service.”

Medium-Level
( DevOps Interview Questions - 1 to 2 Years Experience)

1.​ Ask: 🗣️"What are the main components of the Kubernetes control
plane?"

✅ Expected Answer: "API Server, Scheduler, Controller Manager,


and etcd are the key components."

💡 Hint: "These components manage the state and desired behavior of


the cluster."
2.​ Ask: 🗣️ "What is the role of kube-proxy in Kubernetes?"
✅ Expected Answer: "kube-proxy maintains network rules and
enables communication between pods across nodes."

💡 Hint: "It handles routing of traffic inside the cluster."


3.​ Ask: 🗣️"How does Kubernetes handle container restarts when a
pod fails?"

✅ Expected Answer: "The kubelet on the node restarts the


container based on the pod's restart policy."

💡 Hint: "Check the restartPolicy in the pod spec (Always, OnFailure,


Never)."

4.​ Ask: 🗣️
"What is a ReplicaSet and how is it related to
Deployments?"

✅ Expected Answer: "A ReplicaSet ensures the desired number of


pod replicas. Deployments manage ReplicaSets."

💡 Hint: "Deployment is a higher-level object managing ReplicaSets."


5.​ Ask: 🗣️
"How would you update a running application in
Kubernetes?"

✅ Expected Answer: "Use 'kubectl apply -f deployment.yaml' or


update image with 'kubectl set image'."

💡 Hint: "Think rolling updates using Deployments."


6.​ Ask: 🗣️
"What is the difference between ConfigMap and Secret in
Kubernetes?"

✅ Expected Answer: "Both store configuration, but Secrets are


used for sensitive data and are base64 encoded."

💡 Hint: "Use Secret for passwords or tokens."


7.​ Ask: 🗣️ "What is a StatefulSet and when would you use it?"
✅ Expected Answer: "StatefulSet is used for stateful applications
requiring stable identities and storage."

💡 Hint: "Databases like MongoDB, Cassandra use StatefulSets."


8.​ Ask: 🗣️
"What is the difference between a DaemonSet and a
Deployment?"

✅ Expected Answer: "A DaemonSet runs one pod per node, while
a Deployment manages replicas of pods."

💡 Hint: "DaemonSet is for background services like monitoring


agents."

9.​ Ask: 🗣️
"What is a namespace in Kubernetes and why is it
useful?"

✅ Expected Answer: "Namespaces help organize cluster


resources and isolate teams/projects."

💡 Hint: "Useful in multi-tenant clusters."


10.​ Ask: 🗣️ "What is the use of liveness and readiness probes?"
✅ Expected Answer: "Liveness checks if app is running;
readiness checks if app is ready to serve traffic."

💡 Hint: "Helps Kubernetes restart or route traffic based on app state."


Scenario-Based Questions

🗣️
1️. Ask: “You need to make your deployment scale automatically when
traffic increases. What would you use?”

✅ Expected: “Use a Horizontal Pod Autoscaler based on CPU or


custom metrics.”

💡 Hint: “Think metrics + replicas.”


🗣️
2️ . Ask: “One of your pods isn’t scheduling on any node. What do you
check first?”

✅ Expected: “Check node resources, taints, tolerations, or pod


affinity rules.”

💡 Hint: “Describe the pod and check events.”


🗣️
3️. Ask: “You want to give a pod access to secrets or config. How
would you do that?”

✅ Expected: “Use ConfigMaps and Secrets mounted as env vars


or volumes.”
💡 Hint: “Which object stores environment-specific values?”
🗣️
4️. Ask: “Your app needs to persist data even if the pod restarts. What
would you use?”

✅ Expected: “Use Persistent Volumes and Persistent Volume


Claims.”

💡 Hint: “Ephemeral vs Persistent storage?”

Project-Based Questions

🗣️
5️. Ask: “You want to deploy a web app and a database together that
talk to each other. How would you design it in Kubernetes?”

✅ Expected: “Use 2 deployments (e.g., Node.js + MySQL), expose


using internal services, configure using env variables or secrets.”

💡 Hint: “Think of multi-container design + Services.”


🗣️
6. Ask: “How would you create a reusable setup for development and
testing environments using Kubernetes?”

✅ Expected: “Use Helm charts or Kustomize to manage configs


for each environment.”

💡 Hint: “Templating and configuration management tools?”

Advanced-Level
( DevOps Interview Questions - 3+ Years Experience)

1.​ Ask: 🗣️
"How does Kubernetes handle high availability in the
control plane?"

✅ Expected Answer: "By running multiple control plane nodes


with leader election and etcd clustering."

💡 Hint: "Look into how etcd and kube-API-server achieve HA."


2.​ Ask: 🗣️ "Explain the role of etcd in Kubernetes."
✅ Expected Answer: "etcd is a distributed key-value store used
for storing all cluster configuration data."

💡 Hint: "It's the source of truth for the cluster state."


3.​ Ask: 🗣️ "How do network plugins (CNI) work in Kubernetes?"
✅ Expected Answer: "CNI plugins configure network interfaces in
pods and manage IP addresses."

💡 Hint: "Examples include Calico, Flannel, Cilium."


4.​ Ask: 🗣️ "What is a sidecar container and where is it used?"
✅ Expected Answer: "A sidecar runs alongside the main container
to provide additional features like logging or proxy."

💡 Hint: "Used in service mesh or log collectors."


5.​ Ask: 🗣️ "How would you debug a node issue in Kubernetes?"
✅ Expected Answer: "Use kubectl describe node, journalctl for
kubelet logs, and check resource utilization."

💡 Hint: "Start with kubectl describe and check node taints."


6.​ Ask: 🗣️ "How does Kubernetes perform a rolling update?"
✅ Expected Answer: "It gradually replaces pods with new ones,
ensuring availability during updates."

💡 Hint: "Check strategy in Deployment: RollingUpdate."


7.​ Ask: 🗣️ "What is a Custom Resource Definition (CRD)?"
✅ Expected Answer: "CRDs allow users to define their own
resource types in Kubernetes."

💡 Hint: "Used to extend Kubernetes API."


8.​ Ask: 🗣️ "What is a Pod Disruption Budget (PDB)?"
✅ Expected Answer: "PDB ensures a minimum number of pods
are always running during voluntary disruptions."

💡 Hint: "Used for high availability during upgrades or maintenance."


9.​ Ask: 🗣️ "How do you secure Kubernetes clusters?"
✅ Expected Answer: "Use RBAC, TLS encryption, network
policies, and restrict access to API server."

💡 Hint: "Start with RBAC and secrets management."


10.​ Ask: 🗣️
"What tools can you use to monitor a Kubernetes
cluster?"

✅ Expected Answer: "Prometheus, Grafana, ELK Stack, and tools


like kube-state-metrics."

💡 Hint: "Look into open-source observability stacks."


Scenario-Based Questions

🗣️
1️. Ask: “You notice a memory leak in a container. How can
Kubernetes help you recover automatically?”

✅ Expected: “Set resource limits and liveness probes to restart


unhealthy containers.”

💡 Hint: “How does Kubernetes detect unhealthy states?”


🗣️
2️. Ask: “You need to schedule pods only on specific nodes. How
would you achieve that?”

✅ Expected: “Use node selectors, affinity/anti-affinity, or taints


and tolerations.”

💡 Hint: “Think node-specific rules.”


🗣️
3️. Ask: “A rollout failed in production. How do you roll back your
deployment safely?”

✅ Expected: “Use kubectl rollout undo deployment <name>.”


💡 Hint: “Kubernetes tracks past versions of deployments.”


🗣️
4️. Ask: “Your app needs to scale during peak hours and also reduce
costs at night. How would you automate this?”

✅ Expected: “Use scheduled jobs or CronJob + autoscaler +


possibly custom controller.”

💡 Hint: “Combine time-based triggers + HPA.”


Project-Based Questions
🗣️
5️. Ask: “You are tasked to build a production-grade cluster for a
microservices app. What components would you include?”

✅ Expected: “Use Ingress, ConfigMaps, Secrets, resource limits,


monitoring (Prometheus), and centralized logging.”

💡 Hint: “Think full stack – not just pods.”


🗣️
6️. Ask: “You want to migrate a legacy app to Kubernetes without
downtime. How would you plan it?”

✅ Expected: “Use blue-green or canary deployments, health


checks, and readiness probes.”

💡 Hint: “Safe rollout techniques?”

You might also like