How do you find the process using the most CPU?
Use top or ps aux --sort=-%cpu. Start by identifying the process, then inspect its logs, workload and recent changes before deciding whether it should be stopped or restarted.
DevOps Interview
Practical interview questions covering Linux, Git, Docker, Kubernetes, AWS, Terraform, Jenkins, Ansible, Prometheus and SRE.
Use top or ps aux --sort=-%cpu. Start by identifying the process, then inspect its logs, workload and recent changes before deciding whether it should be stopped or restarted.
Use free -h for a high-level view and ps aux --sort=-%mem to identify processes consuming memory. vmstat can help investigate memory pressure and swapping.
Check systemctl status for the service, inspect journalctl -u for logs, validate configuration and dependencies, then verify ports, permissions and environment variables.
A process has its own address space and resources. Threads are execution units within a process and generally share the process memory and resources.
Merge combines histories with a merge commit when needed. Rebase moves commits onto another base and creates a more linear history. Rebasing shared commits requires care because it rewrites commit history.
git reset --soft HEAD~1 keeps changes staged, while git reset --mixed HEAD~1 keeps the changes in the working tree. For a pushed commit, git revert is generally used to create a new reversing commit.
Inspect conflicted files, choose the desired changes, remove conflict markers, stage the resolved files and complete the merge or rebase. Test the resulting code before pushing.
An image is an immutable template containing application files and metadata. A container is a running or stopped instance created from an image.
Check docker ps -a, then inspect docker logs <container> and docker inspect <container>. Verify the entrypoint, command, environment variables, mounted files and application exit code.
A volume is Docker-managed persistent storage that can survive container recreation. It is commonly used for databases and application data that should not live only in the container writable layer.
A Pod is the smallest deployable unit in Kubernetes. It contains one or more containers that share networking and storage contexts.
It indicates that a container repeatedly starts and exits. Common causes include application errors, invalid configuration, missing environment variables, failed dependencies and incorrect commands. kubectl logs and kubectl describe pod are key investigation commands.
Deployment is commonly used for stateless replicated workloads. StatefulSet provides stable identities and ordered behavior useful for stateful workloads such as databases and clustered systems.
A Service provides a stable network endpoint for a group of Pods selected by labels. Common service types include ClusterIP, NodePort and LoadBalancer.
Use kubectl describe pod to inspect scheduler events. Check node capacity, resource requests, taints, tolerations, affinity rules and whether suitable nodes are available.
An IAM user represents a long-term identity. A role is an identity that can be assumed and is commonly used by AWS services, workloads and users who need temporary credentials.
An Availability Zone is an isolated location within an AWS Region. Deploying across multiple Availability Zones can improve application resilience against an issue affecting one zone.
Security Groups are stateful controls associated with network interfaces. Network ACLs operate at the subnet boundary and are stateless, requiring explicit inbound and outbound rules.
Terraform state maps configuration resources to real infrastructure objects and stores information Terraform uses to determine planned changes.
Remote state allows teams and automation systems to share state from a controlled backend. Many remote backends also provide locking or coordination capabilities.
terraform plan compares the desired configuration with Terraform's state and provider information and shows proposed changes without applying them.
A Pipeline defines a delivery workflow as code. It can contain stages for checkout, build, testing, security scanning, packaging and deployment.
The controller coordinates Jenkins workloads and manages the system. Agents execute build and pipeline workloads, allowing jobs to run on appropriate machines or environments.
Start with console output, identify the failing stage, inspect environment variables and credentials, verify dependencies and tools, and check the agent's CPU, memory and disk.
Ansible is an automation platform commonly used for configuration management, application deployment and operational tasks.
Inventory defines the hosts and groups that Ansible can manage. It can be static or dynamically generated from infrastructure sources.
An idempotent task can be executed repeatedly while converging the system toward the desired state without making unnecessary changes once that state has been reached.
Prometheus is a monitoring and alerting system that collects time-series metrics, commonly through a pull-based scraping model.
PromQL is Prometheus Query Language. It is used to select, aggregate and calculate values from Prometheus time-series data.
Check the target address, network connectivity, exporter availability, service discovery, scrape configuration and Prometheus target status.
A Service Level Indicator is a measured signal representing a service characteristic such as availability, latency or successful request rate.
A Service Level Objective defines a target level of service performance or reliability over a specified measurement period.
An error budget represents the amount of unreliability permitted by an SLO. Teams can use it to balance reliability work against feature delivery.
Establish the impact, assign roles, stabilize the service, communicate clearly, preserve useful evidence, investigate systematically and conduct a blameless review afterward.