Devops
40+ Devops Interview Questions and Answers
Q1. How will you setup a microservice architecture application simple testing environment and deployment pipeline using kubernetes, containers, jenkins and available Cloud services.
Setup microservice testing and deployment using Kubernetes, containers, Jenkins, and Cloud services.
Create a Kubernetes cluster on a Cloud provider
Build Docker containers for each microservice
Create a Jenkins pipeline for testing and deployment
Use Kubernetes to deploy and manage the containers
Use Cloud services for load balancing, monitoring, and scaling
Q2. How will you kill all java process in one command ?
Use 'pkill' command with '-f' option to kill all java processes.
Open terminal or command prompt
Type 'pkill -f java' and press enter
All java processes will be terminated
Devops Interview Questions and Answers for Freshers
Q3. How to run cmd commands using python on windows environment ?
To run cmd commands using python on windows, use the subprocess module.
Import the subprocess module
Use the subprocess.run() method to execute the command
Pass the command as a list of strings to the run() method
Use the shell=True argument to run the command in a shell environment
Capture the output of the command using the stdout attribute of the returned CompletedProcess object
Q4. how do you delete last 30 days logs in tomcat by using shell script
Deleting last 30 days logs in Tomcat using shell script
Use find command to locate files older than 30 days
Use xargs command to pass the file names to rm command
Use crontab to schedule the script to run periodically
Q5. What is difference between deep and shallow copy in python paradigm?
Deep copy creates a new object with a new memory address while shallow copy creates a new object with the same memory address as the original object.
Deep copy creates a completely new object with a new memory address.
Shallow copy creates a new object with the same memory address as the original object.
In deep copy, changes made to the copied object do not affect the original object.
In shallow copy, changes made to the copied object affect the original object.
Deep copy is used...read more
Q6. Given a file with random content, could you find out all the phone numbers ?
Yes, by using regular expressions to match phone number patterns.
Use regular expressions to match phone number patterns
Common phone number patterns include (XXX) XXX-XXXX and XXX-XXX-XXXX
Consider international phone number formats as well
Use a programming language with regex support, such as Python or JavaScript
Share interview questions and help millions of jobseekers 🌟
Q7. what are the stages you regularly write in pipeline job in Jenkins
Stages in pipeline job in Jenkins
Checkout code from version control system
Build the code
Run unit tests
Deploy to staging environment
Run integration tests
Deploy to production environment
Send notification email
Q8. When running DB instance as a Multi-AZ deployment, can I use the standby for read or write operation?
Yes, the standby can be used for read operations but not for write operations.
In a Multi-AZ deployment, the primary DB instance handles write operations.
The standby DB instance can be used for read operations to offload the primary instance.
Read replicas can also be used for read operations in a Multi-AZ deployment.
Devops Jobs
Q9. How will you monitor file change in linux ?
Use inotifywait command to monitor file changes in Linux.
Install inotify-tools package
Use inotifywait command with options like -m for continuous monitoring and -e for specific events
Example: inotifywait -m /var/log/messages -e modify
Output will show the file path, event type and timestamp
Q10. Usecase for chef and why do you need it ?
Chef is a configuration management tool used for automating infrastructure deployment and management.
Chef helps in automating the process of configuring and managing servers and applications.
It allows for consistent and repeatable infrastructure deployments.
Chef can be used to manage both on-premises and cloud-based infrastructure.
It provides a centralized platform for managing configurations and enforcing policies.
Chef can be integrated with other DevOps tools like Jenkins a...read more
Q11. How can you send email with attachment using powershell ?
Send email with attachment using PowerShell
Use Send-MailMessage cmdlet
Specify recipient, subject, body and attachment parameters
Example: Send-MailMessage -To 'example@email.com' -Subject 'Test Email' -Body 'This is a test email' -Attachments 'C:\test.txt'
Q12. how you can identify which process cause your server got slow
To identify the process causing server slowness, use monitoring tools and analyze system logs.
Use monitoring tools like Nagios, Zabbix, or Prometheus to track system performance metrics.
Analyze system logs to identify any errors or warnings related to specific processes.
Check CPU and memory usage of running processes using tools like top or htop.
Use profiling tools like strace or perf to identify resource-intensive processes.
Consider network traffic and disk I/O as potential ...read more
Q13. How would you optimise a given sql query ?
Optimise SQL query by identifying bottlenecks and improving indexing and query structure.
Identify slow performing queries using profiling tools
Improve indexing by adding or removing indexes
Rewrite query structure to reduce complexity and improve performance
Use query optimisation techniques like subqueries and joins
Consider caching frequently accessed data
Q14. how do you configure ssl certification with tomcat
SSL certification can be configured with Tomcat by generating a keystore file and configuring the server.xml file.
Generate a keystore file using keytool command
Configure the server.xml file to include the keystore file and password
Update the connector element in server.xml to include the SSL protocol and port number
Restart Tomcat to apply the changes
Q15. Ruby program to find out if a directory exists and you write permissions to it ?
Ruby program to check directory existence and write permissions.
Use File.exist? method to check if directory exists.
Use File.writable? method to check if directory has write permissions.
Combine both methods to get the desired result.
Q16. What is a container and why is the use?
A container is a lightweight, standalone executable package that contains everything needed to run an application.
Containers provide a consistent and reproducible environment for applications to run in.
They are isolated from the host system and other containers, providing security and portability.
Containers can be easily deployed and scaled, making them ideal for modern application development and deployment.
Examples of container technologies include Docker, Kubernetes, and O...read more
Q17. Write a docker file to setup Nginx and expose it with port 8080
Dockerfile to setup Nginx and expose it with port 8080
Use the official Nginx image as the base image
Copy the custom Nginx configuration file to the container
Expose port 8080 in the Dockerfile
Start Nginx in the foreground using the CMD instruction
Q18. What is Kubernettes ?
Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications.
Kubernetes is used to manage and automate the deployment of containerized applications.
It provides features like automatic scaling, load balancing, and self-healing.
Kubernetes allows for easy management of containers across multiple hosts and clusters.
It provides declarative configuration and efficient resource utilization.
Kubernet...read more
Q19. How to install IIS using powershell ?
To install IIS using PowerShell, use the Install-WindowsFeature cmdlet.
Open PowerShell as an administrator
Run the command: Install-WindowsFeature -name Web-Server -IncludeManagementTools
Press 'Y' to confirm installation
Wait for the installation to complete
Q20. What is namespace in Docker ?
Namespace in Docker is a way to isolate resources and avoid naming conflicts.
Namespaces provide a layer of isolation for containers
Each namespace has its own set of resources
Namespaces can be used for network, process, and mount isolation
Example: docker run --name mycontainer --net=container:othercontainer myimage
Q21. how to integrate Maven with jenkins
Integrating Maven with Jenkins
Install Maven plugin in Jenkins
Configure Maven installation in Jenkins global tool configuration
Create a new Jenkins job and select Maven project
Specify the path to the pom.xml file in the project configuration
Configure build triggers and other settings as required
Q22. How does a linux boot ?
Linux boot process involves several stages including BIOS, bootloader, kernel initialization, and user space initialization.
BIOS performs a power-on self-test and loads the bootloader from the boot device.
Bootloader loads the kernel into memory and initializes it.
Kernel initializes hardware, mounts the root file system, and starts the init process.
Init process starts user space processes and services.
Linux boot process can be customized by modifying bootloader configuration a...read more
Q23. What is a process in linux ?
A process in Linux is a running instance of a program or command.
A process is identified by a unique process ID (PID)
Processes can be started, stopped, and managed using commands like ps, kill, and top
Processes can run in the foreground or background
Processes can communicate with each other through inter-process communication (IPC)
Examples of processes include web servers, database servers, and user applications
Q24. What is the difference between azure and AWS?
Azure and AWS are cloud computing platforms with similar services, but differ in pricing, scalability, and integration.
Azure is more tightly integrated with Microsoft products, while AWS has a wider range of third-party integrations.
AWS has a larger market share and more mature services, while Azure is catching up quickly.
Azure offers more flexible pricing options, while AWS has a more complex pricing structure.
Azure has better support for hybrid cloud environments, while AWS...read more
Q25. What is Docker and its advantages . Which is the most secure docker image
Docker is a containerization platform that allows developers to package and deploy applications in a portable manner.
Advantages include: faster deployment, improved scalability, reduced infrastructure costs, and increased consistency across environments.
The most secure Docker image is one that is regularly updated with security patches and has minimal dependencies.
Examples of secure Docker images include those from official repositories like Ubuntu, Alpine, and CentOS.
Additio...read more
Q26. What is the default monitoring time in aws cloud watch
The default monitoring time in AWS CloudWatch is 5 minutes.
Default monitoring time in AWS CloudWatch is 5 minutes
Can be changed to 1 minute for detailed monitoring
Monitoring intervals can be adjusted based on requirements
Q27. How would you lead a DevOps team ?
To lead a DevOps team, I would focus on communication, collaboration, and continuous improvement.
Establish clear goals and expectations for the team
Encourage open communication and collaboration between team members
Implement agile methodologies and continuous improvement processes
Provide opportunities for professional development and training
Ensure that the team has the necessary tools and resources to succeed
Lead by example and foster a culture of innovation and experimentat...read more
Q28. how DevOps helps in day to day activities of developers
DevOps helps developers by streamlining processes, improving collaboration, and automating tasks.
DevOps promotes collaboration between development and operations teams, leading to faster feedback and problem resolution.
Automation tools in DevOps help developers streamline repetitive tasks like testing, deployment, and monitoring.
Continuous integration and continuous delivery (CI/CD) practices in DevOps help developers deliver code more frequently and reliably.
DevOps practices...read more
Q29. how will you create a jenkins pipeline for k8s application
To create a Jenkins pipeline for a Kubernetes application, you need to define stages for building, testing, and deploying the application.
Define stages in the Jenkinsfile for building the Docker image, running tests, and deploying to Kubernetes.
Use Jenkins plugins like Kubernetes Continuous Deploy Plugin to interact with the Kubernetes cluster.
Set up credentials in Jenkins for accessing the Kubernetes cluster.
Use declarative syntax in the Jenkinsfile to define the pipeline st...read more
Q30. What is the uses of aws and azure?
AWS and Azure are cloud computing platforms used for hosting, managing and deploying applications and services.
AWS provides a wide range of services including compute, storage, database, analytics, machine learning, and more.
Azure offers similar services as AWS but also has a strong focus on integration with Microsoft technologies.
Both platforms offer scalability, flexibility, and cost-effectiveness for businesses of all sizes.
Examples of companies using AWS include Netflix, ...read more
Q31. what are the git commands
Git commands are used to manage version control of code repositories.
git init - initialize a new repository
git add - add changes to the staging area
git commit - commit changes to the repository
git push - push changes to a remote repository
git pull - pull changes from a remote repository
git clone - clone a remote repository
git branch - create, list, or delete branches
git merge - merge changes from one branch to another
git checkout - switch between branches or restore files
git ...read more
Q32. How to use deployment strategies in Kubernetes?
Deployment strategies in Kubernetes help manage the rollout of new versions of applications.
Use Rolling Update strategy to gradually replace old Pods with new ones
Use Blue-Green Deployment strategy to switch traffic between two identical environments
Use Canary Deployment strategy to release new versions to a subset of users for testing
Use A/B Testing strategy to release multiple versions simultaneously and compare performance
Q33. explain dynamic inventory in ansible
Dynamic inventory is a feature in Ansible that allows for automatic inventory updates based on external data sources.
Dynamic inventory can be configured to pull inventory information from sources such as cloud providers, configuration management databases, or custom scripts.
This allows for more flexible and scalable inventory management, as hosts can be added or removed automatically based on changes in the external data source.
Dynamic inventory can be configured using plugin...read more
Q34. difference between git merge and git rebase
Git merge combines changes from different branches, while git rebase rewrites commit history by moving the current branch to the tip of another branch.
Git merge creates a new commit with the combined changes of the branches being merged.
Git rebase moves the current branch to the tip of another branch, replaying the commits on top of it.
Merge preserves the commit history of both branches, while rebase creates a linear history.
Rebase is useful for keeping a clean and linear com...read more
Q35. Right lambda function for RDS launch
Lambda function to launch RDS
Use AWS Lambda to launch RDS instances
Create a Lambda function with appropriate permissions
Use AWS SDK to interact with RDS APIs
Configure the Lambda function to trigger on specific events
Q36. what is ci cd in jenking?
CI/CD in Jenkins refers to continuous integration and continuous delivery/continuous deployment processes implemented using Jenkins automation server.
CI/CD stands for Continuous Integration/Continuous Delivery or Continuous Deployment.
In Jenkins, CI/CD involves automating the build, test, and deployment processes to deliver software more frequently and reliably.
Continuous Integration involves automatically building and testing code changes as they are committed to the reposit...read more
Q37. What do you know about viasat
Viasat is a global communications company that provides satellite internet services and secure networking solutions.
Provides satellite internet services
Offers secure networking solutions
Operates globally
Q38. explain Jenkis pipeline job
Jenkins pipeline job is a way to define a series of steps to be executed in a specific order.
Pipeline job is defined using a Jenkinsfile or a script in the Jenkins UI.
It consists of stages, which are a collection of steps.
Each step can be a shell command, a script, or a plugin.
Pipeline job can be triggered manually or automatically based on events.
It provides visibility into the entire build process and enables continuous delivery.
Example: Build -> Test -> Deploy -> Notify
Q39. how to solve merge conflicts
Merge conflicts can be solved by resolving the conflicting changes, committing the resolved changes, and then pushing the changes to the repository.
Pull the latest changes from the remote repository
Locate the conflicting files and resolve the conflicts manually
Add the resolved files to the staging area
Commit the changes with a message explaining how the conflicts were resolved
Push the changes to the remote repository
Q40. Best practices for Docker file
Best practices for Dockerfile include keeping it simple, using official images, and minimizing layers.
Use official images as base
Minimize layers to reduce image size
Avoid installing unnecessary packages
Use .dockerignore to exclude unnecessary files
Specify version numbers for packages
Use multi-stage builds for complex builds
Run only one process per container
Use environment variables for configuration
Keep the Dockerfile simple and readable
Q41. what is tf state files
Tf state files are files generated by Terraform to store the state of your infrastructure.
Tf state files store information about the resources managed by Terraform
They help Terraform track the current state of your infrastructure
Tf state files should be stored securely to prevent unauthorized access
Q42. explain the architecture of kubernetes
Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications.
Kubernetes follows a master-slave architecture with a master node and multiple worker nodes.
The master node controls the cluster and schedules workloads, while the worker nodes run the actual containers.
Each worker node has a kubelet agent that communicates with the master node.
Kubernetes uses etcd as a distributed key-value store ...read more
Q43. What is kubernetes?
Kubernetes is an open-source container orchestration platform for automating deployment, scaling, and management of containerized applications.
Kubernetes allows for automated deployment, scaling, and management of containerized applications.
It provides features like service discovery, load balancing, storage orchestration, and automated rollouts and rollbacks.
Kubernetes helps in ensuring high availability, fault tolerance, and efficient resource utilization.
It supports variou...read more
Q44. what is devops?
DevOps is a software development methodology that combines software development (Dev) with IT operations (Ops) to improve collaboration and efficiency.
DevOps focuses on automating and streamlining the software development process.
It emphasizes communication and collaboration between development and operations teams.
DevOps aims to shorten the development lifecycle and provide continuous delivery of high-quality software.
Tools commonly used in DevOps include Jenkins, Docker, An...read more
Q45. what is terraform
Terraform is an open-source infrastructure as code software tool created by HashiCorp.
Terraform allows users to define and provision infrastructure using a declarative configuration language.
It supports multiple cloud providers such as AWS, Azure, and Google Cloud Platform.
Terraform manages infrastructure resources as code, enabling automation and version control.
It helps in creating, updating, and deleting infrastructure resources efficiently.
Terraform uses a state file to k...read more
Q46. Difference between s3 and ebs
S3 is object storage while EBS is block storage in AWS.
S3 is suitable for storing large amounts of unstructured data like images, videos, and backups.
EBS is used for storing data that requires frequent updates and access, like databases.
S3 is scalable and durable, while EBS is persistent and can be attached to a single EC2 instance.
S3 is accessed over HTTP/HTTPS, while EBS is accessed as a block device within an EC2 instance.
Q47. Hobbies as per interest
My hobbies include hiking, cooking, and playing guitar.
Hiking in the mountains
Trying out new recipes
Learning new songs on guitar
Top Interview Questions for Devops Related Skills
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month