Posts

Dokcer Interview Questions: ============================= 🔥 Advanced Practical Docker Interview Questions 🧱 1. Docker Architecture & Internals Q: Explain how Docker works internally when you run docker run nginx. 👉 Expected: Docker CLI → Docker Daemon → containerd → runc Image pull from registry Creation of container using namespaces & cgroups 🐳 2. Write a Dockerfile (Real Scenario) Q: Create a Dockerfile for a Node.js app. FROM node:18-alpine WORKDIR /app COPY package*.json ./ RUN npm install COPY . . EXPOSE 3000 CMD ["npm", "start"] 👉 Follow-up: How to reduce image size? Why use alpine? 📦 3. Multi-Stage Build (Very Important) Q: Optimize this Dockerfile for production. # Build stage FROM node:18 as builder WORKDIR /app COPY . . RUN npm install && npm run build # Production stage FROM nginx:alpine COPY --from=builder /app/build /usr/share/nginx/html 👉 Key concept: Reduce final image size Separate build & runtime 🔐 4. Secrets Handl...
🔥 1. Advanced Linux Basics (Expected Depth) ❓ What happens when you run a command in Linux? 👉 Expected: Shell interprets command Checks PATH Forks process Uses exec() system call Kernel schedules execution ❓ Difference between process and thread? Process = independent memory Thread = shared memory within process ❓ What is load average? 👉 Example: uptime 1 min, 5 min, 15 min CPU load Compare with CPU cores ⚙️ 2. Process Management (Scenario-Based) ❓ A process is consuming 100% CPU. What will you do? 👉 Steps: top / htop ps -ef | grep renice -n 10 -p kill -15 kill -9 ❓ Difference between kill -9 and kill -15? -15 (SIGTERM) → graceful -9 (SIGKILL) → force kill ❓ How to find parent-child process? pstree -p ps -ef --forest 💾 3. Memory Management ❓ How Linux manages memory? 👉 Answer: Physical memory + Swap Virtual memory Paging ❓ What is OOM Killer? 👉 When memory is full → kills high memory process ❓ Check memory usage? free -m vmstat top 📂 4. File System & Storage ❓ Differenc...
linux interview questions: ========================= Critical Linux Interview Questions (Experienced) 🧠 1. Troubleshooting Scenarios (MOST IMPORTANT) 👉 Q1: Server is slow. How will you troubleshoot? Expected Approach: Check CPU: top / htop Check Memory: free -m Check Disk: df -h du -sh /* Check processes: ps -ef --sort=-%cpu Check I/O: iostat 👉 Q2: Disk is full. What will you do? Answer: df -h du -sh /* | sort -hr Clean logs: /var/log Remove old files Use logrotate 👉 Q3: System not booting. How to recover? Answer: Boot into rescue mode / single-user mode Fix: /etc/fstab GRUB issues Reinstall bootloader: grub2-install 👉 Q4: Service is not starting. What to check? systemctl status journalctl -xe Check config files Check port conflicts: netstat -tulnp 👉 Q5: High CPU usage. How to fix? top ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu Kill process: kill -9 ⚙️ 2. Process & Resource Management 👉 Q6: Difference between nice and renice? nice: start process with priority renice: chan...
terraform Interview Questions: ============================== 1).Terraform Practical Interview Questions (Experienced) 1. Real-time Scenario Questions 👉 Q1: You have created infrastructure manually in AWS. Now you need to bring it under Terraform. How will you do it? Expected Answer: Use terraform import Write resource block first Import using: terraform import aws_instance.myec2 i-1234567890 Run terraform plan to verify 👉 Q2: You deleted a resource manually in AWS, but Terraform state still has it. What will you do? Answer: Run: terraform refresh OR terraform apply Terraform will recreate the resource 👉 Q3: How will you handle multiple environments (dev, qa, prod)? Answer: Use: Workspaces Separate backend configs .tfvars files Example: terraform workspace new dev terraform workspace select dev 👉 Q4: How do you manage secrets in Terraform? Answer: Use: AWS Secrets Manager HashiCorp Vault Environment variables Avoid hardcoding in .tf files 👉 Q5: How do you handle remote state? Ans...
Docker Interview Questions: =========================== Docker interview questions: ================================ 18. How do you troubleshoot a failing container? * Check logs: docker logs * Inspect container: docker inspect * Exec into container: docker exec -it ================================================== 17. What is Docker Registry? A storage for Docker images (e.g., Docker Hub). ============================================== . How will you deploy a microservice using Docker + Kubernetes? ✅ Answer (structured & practical) First, I containerize the application using Docker. Step 1: Create Docker Image * Write a Dockerfile * Build image: docker build -t myapp:v1 . * Push to registry: docker push myrepo/myapp:v1 Step 2: Create Kubernetes Deployment Define a Deployment YAML: apiVersion: apps/v1 kind: Deployment metadata: name: myapp-deployment spec: replicas: 3 selector: matchLabels: app: myapp template: metadata: labels: app: ...
Aws Inteview questions: ===================== Aws Interview Questions: ============================= 1. Core AWS Concepts (Must Know) Q1: What is AWS Global Infrastructure? 👉 AWS consists of: * Regions * Availability Zones (AZs) * Edge Locations (CloudFront) 👉 Example: * Region → ap-south-1 (Mumbai) * AZ → ap-south-1a, 1b Q2: Difference between Region and Availability Zone? * Region = Geographical area * AZ = Isolated data centers inside a region Q3: What is IAM? Best practices? * Identity and Access Management * Controls access to AWS services ✅ Best Practices: * Use roles instead of access keys * Enable MFA * Follow least privilege principle 🔹 2. EC2 (Compute) Q4: What are EC2 instance types? * General purpose → t3, t2 * Compute optimized → c5 * Memory optimized → r5 * Storage optimized → i3 Q5: Difference between Spot, On-Demand, and Reserved Instances? Type Use Case On-Demand Short-term workloads Reserved Long-term, predictable Spot Cost saving (can be interrupted) Q6: Wha...
erraform: 1).which terraform command refreshes the state file refreshing the state file comparing it with real infiratsuruce Without changing. Resoirce ? Terraform refresh 2).what happens if two team members run ‘terraform apply’ simtanously on the same workplace into it ? One apply is failed . That time terraform state file is locked during the operations 3).which backend supports remote lociking natively ? S3 and DynamoDB 4).which terraofm block is responsible for defining the reusable infrsture template ? Modules 5).what will happens if a remove a resource from terraform code ,but keep the state file unchanged into it ? Terraofm shows it as the drift and remove it upon apply into it .. 6).what is the main purpose of terraform taint ocmmadn into terraform ? Resources would be recreated and destroy at next apply Which is already u can marked it as the stained. 7).which file should never be committed to git in real projects? Terraform .tfstsefile 8).what does terr...