Devops Engineer
1000+ Devops Engineer Interview Questions and Answers

Asked in Siemens

Q. How can you run a Docker command remotely on a Linux server without establishing a separate SSH session?
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

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?
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

Asked in VMware Software

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

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

Asked in VMware Software

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

Q. Which programming languages do you use regularly in your work?
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




Asked in LTIMindtree

Q. If you change the infrastructure in the AWS Management Console, will it change the state file?
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

Q. If you want to restrict communication between Kubernetes pods, how would you do it?
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 🌟

Asked in Lentra AI

Q. Your container running service is up, but you are facing an issue. How do you troubleshoot it?
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

Q. What are the various branching strategies used in the version control system?
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

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

Q. How do you copy a commit from one branch to another?
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

Asked in VMware Software

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

Asked in Larsen & Toubro Limited

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?
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

Q. How can we create an EC2 instance using Terraform?
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

Q. How do you debug errors, and what methods do you use?
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

Q. If Kubectl is not working, what could be the problem and how would you solve it?
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

Q. How do you execute a command to check if the httpd service is running?
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

Q. How do you check logs for pods and containers in Kubernetes?
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

Asked in Sourcefuse Technologies

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

Q. explain pipeline whatever you can write in code how will you deploy the code ? tell me just steps?
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

Q. how to work DNS in Linux ? what is the record of DNS?
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

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

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

Q. If a node is tainted, how will you schedule the node?
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.

Asked in VMware Software

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

Asked in VMware Software

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

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 moreKey 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

Q. How does communication happen between two pods in different namespaces?
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

Asked in VMware Software

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
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Devops Engineer Related Skills

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

