Devops Engineer

1000+ Devops Engineer Interview Questions and Answers

Updated 3 Jul 2025
search-icon

Asked in Siemens

3d ago

Q. How can you run a Docker command remotely on a Linux server without establishing a separate SSH session?

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

Asked in Lentra AI

6d ago

Q. If you want to connect multiple VPCs, and you have two or three VPCs, do you have to connect EC2 to each VPC? How can you 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
5d ago

Q. Reverse the String Problem Statement

You are given a string STR which contains alphabets, numbers, and special characters. Your task is to reverse the string.

Example:

Input:
STR = "abcde"
Output:
"edcba"

Input...read more

Ans.

Reverse a given string containing alphabets, numbers, and special characters.

  • Create a function that takes a string as input

  • Iterate through the string in reverse order and append each character to a new string

  • Return the reversed string

Asked in Nagarro

4d ago

Q. Guess The Hidden Number Problem Statement

You are given an integer N and there is a hidden number within the range [0, N] that you must guess. You have access to a function higherLower(k) which helps in guessin...read more

Ans.

The task is to guess a hidden number within a given range using a function that provides hints about the number's relation to a given input.

  • Use the higherLower(k) function to determine if the hidden number is smaller, equal to, or greater than the input k.

  • Implement a binary search algorithm to efficiently guess the hidden number within the given range.

  • Iteratively narrow down the range based on the hints provided by the higherLower(k) function.

  • Return the guessed hidden number ...read more

Are these interview questions helpful?
2d ago

Q. What Docker command can you use to transfer an image from one machine to another without using a 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

Asked in Amazon

6d ago

Q. 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

Devops Engineer Jobs

SAP India Pvt.Ltd logo
Senior Linux & Cloud Platform DevOps Engineer 8-12 years
SAP India Pvt.Ltd
4.2
Bangalore / Bengaluru
Muthoot Fincorp Ltd logo
Devops Engineer - 1 1-3 years
Muthoot Fincorp Ltd
4.5
Bangalore / Bengaluru
Schneider Electric India  Pvt. Ltd. logo
DevOps Engineer 3-4 years
Schneider Electric India Pvt. Ltd.
4.1
₹ 5 L/yr - ₹ 9 L/yr
(AmbitionBox estimate)
Bangalore / Bengaluru

Asked in LTIMindtree

1d ago

Q. If you change the infrastructure in the AWS Management Console, will it change the state file?

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.

Asked in Accenture

4d ago

Q. If you want to restrict communication between Kubernetes pods, how would you do it?

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'

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Asked in Lentra AI

4d ago

Q. Your container running service is up, but you are facing an issue. How do you troubleshoot it?

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

Asked in Accenture

5d ago

Q. 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

Asked in Siemens

5d ago
Q. What is the command used to delete a branch in Git?
Ans.

The command used to delete a branch in Git is 'git branch -d <branch_name>'.

  • Use 'git branch -d <branch_name>' to delete a branch in Git.

  • Make sure to switch to a different branch before deleting the branch.

  • If the branch has not been merged, use 'git branch -D <branch_name>' to force delete.

Asked in Einfochips

6d ago

Q. How do you copy a commit from one branch to another?

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

1d ago
Q. How do you block specific IPs on your EC2 instance in AWS?
Ans.

You can block specific IPs on an EC2 instance in AWS by using security groups or network access control lists (NACLs).

  • Use security groups to block specific IPs by creating a new inbound rule with the IP address you want to block and setting the action to 'deny'.

  • Alternatively, you can use network access control lists (NACLs) to block specific IPs by adding a rule to deny traffic from the IP address you want to block.

  • Remember to prioritize the rules in the security group or NAC...read more

Q. A colleague updated code in the remote repository and wants to test it without overwriting their local changes. How would you suggest they do that?

Ans.

Use a temporary branch or a Docker container to test remote code without affecting local environment.

  • Create a new branch from the remote branch: `git checkout -b test-branch origin/remote-branch`

  • Use a Docker container to pull the latest code: `docker run -v $(pwd):/app your-image`

  • Clone the repository in a separate directory: `git clone <repo-url> test-repo`

  • Use Git's worktree feature: `git worktree add ../test-worktree origin/remote-branch`

Asked in Einfochips

6d ago

Q. How can we create an EC2 instance using Terraform?

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

Asked in TCS

6d ago

Q. How do you debug errors, and what methods do you use?

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

Asked in CometChat

3d ago

Q. If Kubectl is not working, what could be the problem and how would you solve it?

Ans.

Kubectl issues can arise from configuration, connectivity, or permissions. Troubleshoot systematically to resolve.

  • Check if kubectl is installed: Run 'kubectl version' to verify installation.

  • Verify kubeconfig file: Ensure the correct context is set using 'kubectl config current-context'.

  • Check cluster connectivity: Use 'kubectl cluster-info' to see if the cluster is reachable.

  • Inspect permissions: Ensure your user has the necessary RBAC permissions to access resources.

  • Look for n...read more

Asked in EPAM Systems

1d ago

Q. How do you execute a command to check if the httpd service is running?

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)'

Asked in HCLTech

4d ago

Q. How do you check logs for pods and containers in Kubernetes?

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

Q. How does Jenkins know when to execute a scheduled job or pipeline, and how is it triggered?
Ans.

Jenkins triggers scheduled jobs or pipelines based on configured cron expressions or triggers from external events.

  • Jenkins uses cron expressions to schedule jobs at specific times or intervals.

  • Jobs can also be triggered manually or by external events like code commits to a repository.

  • Pipeline jobs can be triggered by changes in a Git repository, webhook notifications, or other external triggers.

Asked in Lentra AI

4d ago

Q. 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

Asked in Lentra AI

3d ago

Q. 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

Asked in Siemens

5d ago
Q. Can you explain the difference between CMD and ENTRYPOINT in Docker?
Ans.

CMD specifies the default command to run in the container, while ENTRYPOINT specifies the executable to run when the container starts.

  • CMD is often used to provide default arguments for the ENTRYPOINT command

  • ENTRYPOINT is used to specify the executable that will run when the container starts

  • CMD can be overridden at runtime by passing arguments to docker run command

  • ENTRYPOINT cannot be overridden at runtime, but can be combined with CMD to provide default arguments

Asked in Lentra AI

4d ago

Q. Where can you download third-party libraries that 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.

Asked in Einfochips

6d ago

Q. If a node is tainted, how will you schedule the node?

Ans.

Scheduling a tendered node involves assessing its state and redistributing workloads effectively.

  • Check the node's health status using monitoring tools like Prometheus or Grafana.

  • Use orchestration tools like Kubernetes to manage node scheduling.

  • Implement node affinity and anti-affinity rules to optimize workload distribution.

  • Consider using a load balancer to redirect traffic from the tendered node.

  • Example: In Kubernetes, use 'kubectl cordon' to mark the node as unschedulable.

2d ago
Q. How can you copy Docker images from one host to another without using a repository?
Ans.

Docker images can be copied from one host to another using 'docker save' and 'docker load' commands.

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

  • Transfer the tar file to the destination host using SCP or any other file transfer method

  • Use 'docker load' command on the destination host to load the image from the tar file

2d ago

Q. What is a use case that would require setting up 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

Asked in Baker Hughes

1d ago

Q. 1. SSL termination 2. Making S3 immutable so objects cannot be modified 3. How to protect public facing application 4. Difference between security groups and NACL 5. Difference between network and application l...

read more
Ans.

Key concepts in DevOps include SSL termination, S3 immutability, application protection, and Kubernetes workload management.

  • SSL Termination: Offloading SSL decryption from servers to a load balancer to reduce server load and improve performance.

  • S3 Immutability: Use S3 Object Lock to prevent objects from being deleted or overwritten, ensuring data integrity.

  • Protecting Public Applications: Implement WAF (Web Application Firewall), DDoS protection, and secure coding practices to...read more

Asked in TCS

4d ago

Q. How does communication happen 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

1d ago
Q. How do you debug a website template that is very slow?
Ans.

To debug a slow website template, analyze performance metrics, check for inefficient code, optimize images and assets, and consider server-side improvements.

  • Analyze performance metrics using tools like Chrome DevTools or Lighthouse to identify bottlenecks.

  • Check for inefficient code such as unnecessary loops, redundant CSS rules, or large JavaScript files.

  • Optimize images and assets by compressing files, using lazy loading, or implementing a content delivery network (CDN).

  • Consi...read more

1
2
3
4
5
6
7
Next

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Accenture Logo
3.8
 • 8.6k Interviews
Infosys Logo
3.6
 • 7.9k Interviews
Wipro Logo
3.7
 • 6.1k Interviews
Cognizant Logo
3.7
 • 5.9k Interviews
View all
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

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
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits