# KodeKloud: Beta Courses DevOps Interview Questions and Answers: Scenario-Based Prep

## DevOps Interview Questions and Answers: Scenario-Based Prep

### Docker 

- [Why is Your Docker Image 2GB](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Docker/Why-is-Your-Docker-Image-2GB/page.md): How to reduce oversized Docker images using multi-stage builds, minimal base images, and .dockerignore to improve deploy time, autoscaling, security, and storage costs.
- [CMD vs ENTRYPOINT](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Docker/CMD-vs-ENTRYPOINT/page.md): Explains Docker CMD versus ENTRYPOINT behavior, exec versus shell forms, signal handling, and recommends ENTRYPOINT plus CMD with docker exec for debugging.
- [Container Died with Exit Code 137](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Docker/Container-Died-with-Exit-Code-137/page.md): Explains why Docker containers exit with code 137, identifying SIGKILL causes like OOM killer or orchestrator timeouts and steps to diagnose and investigate
- [Container Data Bind Mounts vs Volumes](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Docker/Container-Data-Bind-Mounts-vs-Volumes/page.md): Comparison of Docker bind mounts and named volumes for persisting container data, use cases and production considerations.

### Kubernetes

- [Your Kubernetes Rollout is Stuck](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Kubernetes/Your-Kubernetes-Rollout-is-Stuck/page.md): Guide to diagnose and safely recover stuck Kubernetes Deployment rollouts by inspecting deployment conditions, pod statuses, events, probes, logs, ReplicaSets and configuration without deleting resources.
- [Managed vs Self Managed Kubernetes](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Kubernetes/Managed-vs-Self-Managed-Kubernetes/page.md): Comparison of managed, self-managed, and lightweight Kubernetes hosting options highlighting trade-offs in control, cost, operational burden, and compliance to guide deployment decisions
- [Privileged Pod with hostPath](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Kubernetes/Privileged-Pod-with-hostPath/page.md): Risks and mitigations for Kubernetes pods with privileged hostPath mounts, showing attack vectors, containment steps, and staged hardening and policy enforcement to prevent node and cluster compromise.
- [DNS Failing in Pods](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Kubernetes/DNS-Failing-in-Pods/page.md): Guide to diagnosing and troubleshooting DNS resolution failures in Kubernetes pods with lookup flows, debugging steps, example outputs, and a concise troubleshooting checklist.

### CI/CD & DevOps

- [You Pushed Secrets to GitHub](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/CICD-DevOps/You-Pushed-Secrets-to-GitHub/page.md): Guide for handling accidentally committed secrets to GitHub, rotate credentials immediately, purge them from git history, and enable pre-commit and CI secret scanning.
- [Server at 98 CPU Scale Up or Out](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/CICD-DevOps/Server-at-98-CPU-Scale-Up-or-Out/page.md): Guidance on diagnosing high CPU and choosing between vertical scaling and horizontal autoscaling by making applications stateless and fixing root causes before adding capacity
- [Your Database Query Takes 30 Seconds](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/CICD-DevOps/Your-Database-Query-Takes-30-Seconds/page.md): Explains diagnosing and fixing slow SQL queries by examining execution plans, adding appropriate indexes, eliminating N+1 application patterns, optimizing joins and statistics before considering hardware upgrades.
- [GitOps vs Traditional CD](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/CICD-DevOps/GitOps-vs-Traditional-CD/page.md): Compares traditional push-based CD with GitOps pull-and-reconcile, showing how GitOps prevents cluster drift, improves auditability and rollbacks, and enforces Git as the single source of truth.
- [Amazon DevOps Parse This Nginx Log](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/CICD-DevOps/Amazon-DevOps-Parse-This-Nginx-Log/page.md): Explains using awk to parse NGINX access logs, correctly identify status and URL fields to count 5xx errors, and avoid false matches from naive pattern searches.

### Security 

- [Leaked S3 Bucket](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Security/Leaked-S3-Bucket/page.md): Practical incident response guide for a leaked S3 bucket covering immediate containment, log collection and forensics, remediation, legal notification, and preventive AWS configuration guardrails.

### Networking

- [TCP vs UDP When to Pick Which](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Networking/TCP-vs-UDP-When-to-Pick-Which/page.md): Comparing TCP and UDP for different app needs, using WhatsApp examples to explain when reliability or low latency is preferred and how security and application protocols fit
- [What is a Webhook](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Networking/What-is-a-Webhook/page.md): Explains webhooks versus polling, how webhooks work, security, retries, and implementation best practices for real time event notifications between applications.
- [Pod Cant Reach Cluster DNS](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Networking/Pod-Cant-Reach-Cluster-DNS/page.md): Troubleshooting Kubernetes pod DNS failures by checking CoreDNS health and configuration and verifying network connectivity and NetworkPolicy egress rules allowing UDP and TCP on port 53.
- [dnsPolicy Trap](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Networking/dnsPolicy-Trap/page.md): Explains Kubernetes pod DNS failures caused by dnsPolicy and /etc/resolv.conf misconfiguration, causing external names to resolve but cluster service names like kubernetes.default to fail.
- [ndots5 Trap](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Networking/ndots5-Trap/page.md): Explains ndots behavior in Kubernetes pods, how ndots 5 multiplies DNS queries causing latency, and fixes like trailing dots or reducing ndots to cut unnecessary lookups.

### Advanced Concepts

- [What is gRPC vs HTTP](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Advanced-Concepts/What-is-gRPC-vs-HTTP/page.md): Compares gRPC and HTTP, showing how gRPC leverages HTTP/2, protobuf, and generated stubs for efficient, low‑latency microservice communication versus HTTP/1.1 and JSON.
- [gRPC vs RESTful API](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Advanced-Concepts/gRPC-vs-RESTful-API/page.md): Comparison of gRPC versus RESTful APIs using a ride‑sharing backend, covering performance, payload formats, streaming, tooling, browser support, and when to choose each

### Interview Setup

- [What Happens on docker run nginx](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Interview-Setup/What-Happens-on-docker-run-nginx/page.md): Step-by-step explanation of what happens when running docker run nginx, covering image layers, writable layer, namespaces, cgroups, container runtimes, filesystem mounting, and networking
- [What is Kubernetes](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Interview-Setup/What-is-Kubernetes/page.md): Overview of Kubernetes fundamentals for DevOps interview covering desired state model, control plane components, scheduling, kubelet responsibilities, and running containerized workloads at scale.
- [How Does Terraform Actually Work](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Interview-Setup/How-Does-Terraform-Actually-Work/page.md): Explains how Terraform translates declarative HCL into infrastructure changes, using state, planning, providers, dependency graph, and remote state for collaboration and drift management.
- [How Does Kafka Work](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/Interview-Setup/How-Does-Kafka-Work/page.md): Explains how Kafka works, covering producers, topics, partitions, consumer groups, replication, and delivery semantics using an e-commerce checkout example

### System Design 

- [Design an Image Upload Pipeline](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/System-Design/Design-an-Image-Upload-Pipeline/page.md): Guide to designing a scalable production image upload pipeline covering object storage, asynchronous processing, CDNs, and security for optimized, reliable, and moderated image delivery.
- [Design a Home Feed For Instagram](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/System-Design/Design-a-Home-Feed-For-Instagram/page.md): Progressive designs for scalable Instagram-style home feeds explaining fan-out, hybrid push-pull strategies and Redis caching to handle celebrity write storms
- [Centralized Logging for 100 Microservices](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/System-Design/Centralized-Logging-for-100-Microservices/page.md): Designing a resilient centralized logging pipeline for 100+ Kubernetes microservices using Fluent Bit, Kafka, stream processing, Elasticsearch for hot search and S3 for long term storage
- [Design a Payment Processing System](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/System-Design/Design-a-Payment-Processing-System/page.md): Designing a resilient payment processing system using idempotency keys, an append only payment event ledger, and webhook based eventual consistency with operational best practices
- [Webhook Delivery System](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/System-Design/Webhook-Delivery-System/page.md): Designing a scalable, durable webhook delivery system using transactional outbox, per-customer concurrency lanes, retries with backoff, DLQ and replay UI, and HMAC signing
- [Why 3 or 5 Nodes Never 2 Quorum Split Brain](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/System-Design/Why-3-or-5-Nodes-Never-2-Quorum-Split-Brain/page.md): Explains why etcd clusters use three or five nodes, quorum voting prevents split brain and how odd-sized clusters maximize fault tolerance
- [Logs Pipeline Alloy Loki S3 Grafana](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/System-Design/Logs-Pipeline-Alloy-Loki-S3-Grafana/page.md): Designing a scalable Kubernetes logging pipeline using Grafana Alloy collectors, Loki label-indexing, and S3 object storage for cost-effective centralized log storage and querying
- [Designing a Caching System](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/System-Design/Designing-a-Caching-System/page.md): Guide to designing a robust caching layer for user profile services, covering cache-aside, staleness mitigation, TTL and invalidation, single-flight, jitter, replication, and operational best practices.
- [Designing Pipeline with Prometheus and Thanos](https://notes.kodekloud.com/docs/DevOps-Interview-Questions-and-Answers-Scenario-Based-Prep/System-Design/Designing-Pipeline-with-Prometheus-and-Thanos/page.md): Guide to building a scalable Prometheus metrics pipeline with Thanos and S3 for long term storage, global querying, downsampling, and Grafana integration in Kubernetes
