Devops Engineer

800+ Devops Engineer Interview Questions and Answers

Updated 12 Dec 2024

Popular Companies

search-icon
Q1. Reverse the String

You are given a string 'STR'. The string contains [a-z] [A-Z] [0-9] [special characters]. You have to find the reverse of the string.

For example:

 If the given string is: STR = "abcde". You h...read more

Q2. if you want to connect multiple vpc ,we have 2 or 3 vpc, you have to connect ec2 to each vpc? so how you can achieve that?

Ans.

To connect multiple VPCs, we can use VPC peering or VPN connections.

  • Create a VPC peering connection between the VPCs

  • Configure route tables to allow traffic between the VPCs

  • Alternatively, create VPN connections between the VPCs

  • Attach EC2 instances to the appropriate VPCs

Devops Engineer Interview Questions and Answers for Freshers

illustration image

Q3. How to run a docker command remotely. i.e. Docker is installed on both your laptop and a remote linux server. You need to run docker command on the linux server but without taking a separate ssh session to the ...

read more
Ans.

You can use the Docker API to remotely run Docker commands on a Linux server without taking a separate SSH session.

  • Use the Docker API to interact with the Docker daemon on the remote Linux server.

  • Make sure Docker is installed and running on both your laptop and the remote server.

  • Authenticate with the remote server using appropriate credentials.

  • Establish a connection to the Docker daemon on the remote server using the Docker API.

  • Send the desired Docker command to the remote se...read more

Q4. Guess The Number

You are given an integer ‘N’ and there is a hidden number in the range [0, N] which you have to guess. You are also given a function higherLower(k) to help you in guessing the number. The ‘highe...read more

Are these interview questions helpful?

Q5. Docker command to transfer an image from one machine to another without using docker registry

Ans.

Docker save and Docker load commands can be used to transfer an image from one machine to another without using a Docker registry.

  • Use the 'docker save' command to save the image as a tar file on the source machine

  • Transfer the tar file to the destination machine using any file transfer method (e.g., scp)

  • On the destination machine, use the 'docker load' command to load the image from the tar file

Q6. Which programming languages do you use regularly in your work?

Ans.

I use multiple programming languages depending on the task at hand.

  • Python for automation and scripting

  • Java for building applications

  • Bash for shell scripting

  • SQL for database management

  • JavaScript for web development

  • Go for microservices

  • Perl for text processing

  • C/C++ for system-level programming

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
Q7. Jenkins Question

How Jenkins knows when to execute a Scheduled job/pipeline and how it is triggered?

Q8. How to copy a commit one branch to another branch?

Ans.

To copy a commit from one branch to another, use the git cherry-pick command.

  • Checkout the branch where you want to copy the commit

  • Find the commit hash of the commit you want to copy

  • Run 'git cherry-pick ' to apply the commit to the current branch

Devops Engineer Jobs

Infrastructure and DevOps Engineer 2-7 years
Intel Technology India Pvt Ltd
4.2
Bangalore / Bengaluru
Devops Engineer 2-6 years
IBM India Pvt. Limited
4.1
Pune
DevOps Engineer 2-4 years
Accenture Solutions Pvt Ltd
3.9
Kolkata

Q9. How we can create EC2 instance by using terraform ? (write)

Ans.

To create an EC2 instance using Terraform, define the necessary resources in a Terraform configuration file and run 'terraform apply'.

  • Write a Terraform configuration file with the necessary resources, such as 'aws_instance' for EC2 instance.

  • Specify the required parameters like 'ami', 'instance_type', 'subnet_id', etc.

  • Run 'terraform init' to initialize the working directory.

  • Run 'terraform plan' to see the execution plan.

  • Run 'terraform apply' to create the EC2 instance.

  • Verify t...read more

Q10. Technical Question

How to copy Docker images from one host to another without using a repository?

Q11. your container running service is up but you are facing any issue , how to troubleshoot them?

Ans.

To troubleshoot issues with a running container service, follow these steps:

  • Check the logs of the container to identify any errors or warnings

  • Verify that the container is running on the correct port and IP address

  • Check the network connectivity between the container and other services

  • Verify that the container has access to the required resources and dependencies

  • Restart the container or redeploy the service if necessary

Q12. who do you debug the error and which method do you choose

Ans.

Debugging errors involves identifying the root cause and using appropriate methods to resolve it.

  • Start by reproducing the error and gathering relevant information

  • Use debugging tools like logs, stack traces, and breakpoints to identify the root cause

  • Once the root cause is identified, use appropriate methods like code changes or configuration updates to resolve the error

  • Test the solution thoroughly to ensure it does not cause any new errors

Q13. if you change the infrasrtuctur in aws management console will it change statefile

Ans.

Yes, changing infrastructure in AWS management console will change statefile.

  • Any changes made in the AWS management console will be reflected in the statefile.

  • The statefile is a record of the current state of the infrastructure.

  • For example, if you add a new EC2 instance in the management console, it will be reflected in the statefile.

Q14. DevOps Question

What is Continuous Testing (CT)?

Q15. Execute a command to show whether httpd service is running or not

Ans.

Command to check httpd service status

  • Use the command 'systemctl status httpd' to check the status of httpd service

  • If httpd service is running, the output will show 'active (running)'

  • If httpd service is not running, the output will show 'inactive (dead)'

Q16. Technical Question

How do you block specific IPs on your EC2 instance (AWS)?

Q17. explain pipeline whatever you can write in code how will you deploy the code ? tell me just steps?

Ans.

Pipeline is a set of automated processes that build, test, and deploy code changes.

  • Create a code repository

  • Write code and commit changes to the repository

  • Trigger a build process to compile and package the code

  • Run automated tests to ensure code quality

  • Deploy the code to a staging environment for further testing

  • If tests pass, deploy the code to production environment

  • Monitor the application for issues and repeat the process for new changes

Q18. Linux Question

What is load average in Linux?

Q19. Linux Question

What is LVM and why is it required?

Q20. How to check logs for pods and containers in kubernets ?

Ans.

To check logs for pods and containers in Kubernetes, you can use the kubectl command-line tool.

  • Use the 'kubectl logs' command to view logs for a specific pod or container.

  • Specify the pod or container name along with the appropriate flags.

  • You can also use selectors to filter logs based on labels or namespaces.

  • To follow logs in real-time, use the '-f' flag.

  • To limit the number of lines displayed, use the '--tail' flag.

  • To view logs from multiple containers in a pod, use the '--co...read more

Q21. DevOps Question

How does AWS contribute to DevOps?

Q22. Docker Question

How many Docker components are there?

Q23. Docker Question

What is docker image registry?

Q24. Git Question

What is the command used to delete a branch?

Q25. Kubernetes Question

How to monitor the Kubernetes cluster?

Q26. What is the usecase which would require setup of distributed jenkins nodes

Ans.

Distributed Jenkins nodes are used to handle large-scale builds and improve performance.

  • Large-scale builds: When there are a large number of builds to be executed simultaneously, distributed Jenkins nodes can handle the load by distributing the builds across multiple nodes.

  • Improved performance: By distributing the workload, the overall build time can be reduced, resulting in improved performance.

  • Resource utilization: Distributed nodes allow for better utilization of resources...read more

Q27. from where you can download 3rd party libraries which you created during deployment?

Ans.

Third-party libraries can be downloaded from package managers or repositories.

  • Package managers like npm, pip, and Maven can be used to download third-party libraries.

  • Repositories like GitHub, GitLab, and Bitbucket can also be used to download libraries.

  • Some cloud providers like AWS and Azure have their own repositories for third-party libraries.

  • Libraries can also be downloaded from the official website of the library or the developer.

Q28. Technical Question

How to debug a website template which is very slow?

Q29. Technical Question

What does the load balancer do when an instance in AWS is deregistered?

Q30. Technical Question

What is the usecase which would require setup of distributed jenkins nodes?

Q31. If you want to restrict the communication between the kubernetes pod, how would you restrict that one?

Ans.

Restricting communication between Kubernetes pods can be achieved using network policies.

  • Use Network Policies in Kubernetes to define rules for pod-to-pod communication

  • Specify which pods are allowed to communicate with each other based on labels

  • Deny all traffic by default and only allow specific traffic as needed

  • Example: Define a network policy to allow communication only between pods with label 'app=frontend' and 'app=backend'

Q32. Technical Question

How would you debug apache nginx issues ?

Q33. Technical Question

How would you prevent a DDOS attack ?

Q34. Technical Question

What are terraform modules ?

Q35. how to work DNS in Linux ? what is the record of DNS?

Ans.

DNS in Linux is managed through configuration files and commands. DNS records contain information about domain names and IP addresses.

  • DNS in Linux is managed through the /etc/resolv.conf file which contains the IP addresses of DNS servers.

  • The 'nslookup' command can be used to query DNS records for a specific domain name.

  • DNS records include A records (IP address), MX records (mail server), CNAME records (alias), and more.

  • DNS caching can improve performance by storing frequentl...read more

Q36. Docker Question

Can you tell the difference between CMD and ENTRYPOINT?

Q37. Git Question

What do you know about git reflog?

Q38. how communication happens between two pods in different namespaces?

Ans.

Communication between pods in different namespaces is possible through services or network policies.

  • Use services to allow communication between pods in different namespaces

  • Create network policies to control traffic flow between pods in different namespaces

  • Ensure proper DNS resolution for pods in different namespaces

Q39. Docker Question

What are the use cases of running Docker inside Docker?

Q40. If pipeline breaks in production environment, how do you handle it?

Ans.

I would follow the incident management process to identify the root cause and resolve the issue as quickly as possible.

  • Notify the relevant stakeholders and initiate the incident management process

  • Identify the root cause of the issue and take corrective actions

  • Rollback to the previous stable version if necessary

  • Communicate the status and progress of the incident to stakeholders

  • Conduct a post-incident review to identify areas of improvement

Q41. what is meaning of transite gateway? why we can use transite gateway?

Ans.

Transit Gateway is a network transit hub that enables interconnectivity between virtual private clouds (VPCs) and on-premises networks.

  • Transit Gateway simplifies network architecture by allowing multiple VPCs and VPN connections to connect to a single gateway.

  • It provides a hub-and-spoke model for connecting VPCs and on-premises networks.

  • Transit Gateway also supports routing between VPCs and on-premises networks, and can be used to consolidate VPC peering connections.

  • It can al...read more

Q42. Kubernetes Question

What is Kubernetes Load Balancing?

Q43. what is testing ? Ans: As a part of testing excruciation after complete the Release mode we can get in to the against to the daily integration test .system integration test .user accepting test .production as l...

read more
Ans.

Testing is the process of evaluating a system or its component(s) with the intent to find whether it satisfies the specified requirements or not.

  • Testing is done to ensure that the software meets the requirements and works as expected.

  • It involves executing a system or its component(s) with the intent of finding errors or defects.

  • Testing can be done at various stages of the software development life cycle such as unit testing, integration testing, system testing, and acceptance...read more

Q44. Docker Question

Describe the lifecycle of Docker Container

Q45. Shell Scripting Question

How will you kill all java process in one command ?

Q46. Technical Question

What is load average in Linux?

Q47. for tomcat security and harden, what precaution you can taken?

Ans.

To secure and harden Tomcat, several precautions can be taken.

  • Disable unused connectors and ports

  • Use SSL/TLS encryption for secure communication

  • Implement access control and authentication mechanisms

  • Regularly update Tomcat and its dependencies

  • Configure logging and monitoring for security events

Q48. What are key elements which are there in continuous testing tools?

Ans.

Key elements in continuous testing tools include automation, integration with CI/CD pipelines, reporting and analytics, scalability, and support for various testing types.

  • Automation of test cases to ensure quick feedback on code changes

  • Integration with CI/CD pipelines for seamless testing in the software delivery process

  • Reporting and analytics capabilities to track test results and identify issues

  • Scalability to handle testing across different environments and configurations

  • Su...read more

Q49. What are the various branching strategies used in the version control system?

Ans.

Various branching strategies in version control systems help manage code changes effectively.

  • Mainline/Branch by Release: Each release has its own branch for bug fixes and maintenance.

  • Feature Branching: Each new feature is developed in a separate branch and merged back to main branch after completion.

  • Gitflow Workflow: Uses main, develop, feature, release, and hotfix branches for a structured workflow.

  • Trunk-Based Development: All developers work on a single branch, promoting co...read more

Q50. how to troubleshoot when ec2 has not access to me?

Ans.

To troubleshoot EC2 not having access to me, check security groups, network ACLs, and routing tables.

  • Check if the EC2 instance is in the correct security group

  • Verify that the security group allows inbound traffic from your IP address or CIDR block

  • Check if there are any network ACLs that may be blocking traffic

  • Verify that the routing table is correctly configured

  • Check if there are any firewall rules on your local machine that may be blocking traffic

  • Use tools like ping, tracero...read more

1
2
3
4
5
6
7
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview experiences of popular companies

3.7
 • 10k Interviews
3.9
 • 7.8k Interviews
3.7
 • 7.3k Interviews
3.8
 • 5.4k Interviews
3.7
 • 5.2k Interviews
3.8
 • 4.6k Interviews
3.6
 • 2.3k Interviews
4.1
 • 2.3k Interviews
3.3
 • 737 Interviews
3.8
 • 492 Interviews
View all

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

Devops Engineer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter