Interview questions

738 interview questions.
Free for every member.

Real DevOps, cloud, data and security questions with model answers, plus 53 take home challenges. Practise them in your member app and mark what you know.

Topics

22 topics. Linux to system design.

How it works

Practise like the real thing.

  1. Answer out loud

    Read the question and say your answer as you would in the interview.

  2. Check the model answer

    Open the answer and compare. Most explain the why behind the tool.

  3. Mark it

    Mark it known or to review again. Your marks follow you across devices.

  4. Practise a random set

    Five, ten or twenty questions from the topics you choose.

Try a few

Sample questions.

How does Kubernetes decide which node to schedule a pod on?

Show the answer

The Kubernetes scheduler follows a two-phase process:

  1. Filtering (Predicates): eliminates nodes that can't run the pod — checks resource requests (CPU/memory), node selectors, taints/tolerations, affinity/anti-affinity rules, volume topology constraints, and port availability.
  2. Scoring (Priorities): ranks the remaining nodes using weighted scoring functions — least-requested resources, balanced resource allocation, inter-pod affinity, image locality (prefer nodes that already have the image).

The node with the highest score wins. If scores are tied, one is chosen at random. Custom schedulers or scheduler extenders can augment this logic.

What happens internally when you run docker run?

Show the answer
  1. Docker CLI sends a REST API request to the Docker daemon (dockerd).
  2. The daemon checks if the image exists locally. If not, it pulls it from the registry layer by layer.
  3. The daemon calls containerd to create a container from the image.
  4. containerd uses runc (OCI runtime) to set up Linux namespaces (PID, NET, MNT, UTS, IPC, USER) and cgroups for resource isolation.
  5. The overlay filesystem is assembled: read-only image layers + a thin writable container layer on top.
  6. Network namespace is configured (veth pair bridged to docker0 by default).
  7. The container's entrypoint/cmd process starts as PID 1 inside the namespace.

How does Terraform dependency graph (DAG) work internally?

Show the answer

Terraform builds a Directed Acyclic Graph (DAG) of all resources defined in configuration files. Edges in the DAG represent dependencies:

  • Explicit: depends_on meta-argument.
  • Implicit: reference to another resource's attribute (e.g., aws_subnet.main.id in an EC2 resource).

During terraform plan/apply:

  1. Terraform parses all .tf files and builds the resource graph.
  2. It performs a topological sort — resources with no dependencies are processed first (in parallel up to -parallelism=N, default 10).
  3. Resources downstream in the graph wait for their dependencies to be created/updated first.
  4. For destroy, the graph is traversed in reverse order.

terraform graph | dot -Tsvg > graph.svg renders the full dependency graph visually.

Your application running on EC2 suddenly starts failing health checks behind an ALB. How would you troubleshoot the issue step by step?

Show the answer
  1. Check ALB target group: AWS Console → EC2 → Target Groups → select the TG → Targets tab. Look at the health status reason for each instance (e.g., "Request timed out", "Connection refused", "HTTP 5xx").
  2. Check ALB access logs: enable and review logs in S3 for target_status_code and target_processing_time on the failing target.
  3. CloudWatch metrics: check UnHealthyHostCount, TargetResponseTime, and HTTPCode_Target_5XX_Count.
  4. SSH to the EC2 instance: test the health check endpoint locally:
curl -v http://localhost:<port>/health

If it succeeds locally but fails from ALB, the issue is network-level (security group, NACL). If it fails locally, the application is down.

  1. Application logs: journalctl -u myapp -n 200 or check /var/log/app/. Look for OOM, startup errors, DB connection failures.
  2. Security groups: verify the ALB security group is allowed as an inbound source in the EC2 security group on the health check port.
  3. Resource exhaustion: top, df -h, free -m — check CPU, disk, and memory. A full disk or OOM can cause the app to crash.
  4. Recent changes: check deploy history, AMI change, user-data script changes, or security group rule modifications.