Devops
70+ Devops Interview Questions and Answers

Asked in Housing.com

Q. How would you kill all Java processes using a single 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

Asked in Genpact

Q. How would you set up a simple testing environment and deployment pipeline for a microservice architecture application 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
Devops Interview Questions and Answers for Freshers

Asked in Genpact

Q. How can you execute CMD commands using Python in a 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

Asked in Genpact

Q. Have you tackled a day-to-day problem using automation? If yes, then tell me about the problem and solution.
Automated server monitoring reduced downtime and improved response time for critical issues in our infrastructure.
Identified frequent server downtime as a major issue affecting productivity.
Implemented a monitoring tool (e.g., Prometheus) to track server health metrics.
Set up automated alerts to notify the team of any anomalies or performance degradation.
Created scripts to automatically restart services that went down, minimizing manual intervention.
Regularly reviewed logs an...read more

Asked in Capgemini

Q. How do you delete the last 30 days of logs in Tomcat using a 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

Asked in Housing.com

Q. Given a file with random content, how would you find 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
Devops Jobs

Asked in Genpact

Q. What is the difference between deep and shallow copy in Python?
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

Asked in Capgemini

Q. What stages do you regularly include in a Jenkins pipeline job?
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
Share interview questions and help millions of jobseekers 🌟

Asked in Immply

Q. When running a DB instance as a Multi-AZ deployment, can I use the standby for read or write operations?
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.

Asked in Nvidia

Q. Write a basic Ansible playbook to copy files based on the Operating System using the 'when' module.
Ansible playbook to copy files based on the operating system using conditional statements.
Use the 'copy' module to transfer files.
Utilize 'when' statements to check the OS type.
Example: - name: Copy file for Ubuntu copy: src: /path/to/source dest: /path/to/destination when: ansible_os_family == 'Debian'
Example: - name: Copy file for CentOS copy: src: /path/to/source dest: /path/to/destination when: ansible_os_family == 'RedHat'
Gather facts using 'gather_facts: yes' to determi...read more

Asked in Housing.com

Q. How would you monitor file changes 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

Asked in Housing.com

Q. What is a use case 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

Asked in Genpact

Q. How can you send an email with an 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'

Asked in Capgemini

Q. How can you identify which process is causing your server to slow down?
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

Asked in Housing.com

Q. How would you optimize 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

Asked in Capgemini

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

Asked in Housing.com

Q. Write a Ruby program to determine if a directory exists and if you have 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.

Asked in LTIMindtree

Q. What is a container and why is it used?
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

Asked in Nvidia

Q. Write a Dockerfile to set up Nginx and expose it on 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

Asked in Capgemini

Q. What is Kubernetes?
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

Asked in Genpact

Q. How do you 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

Asked in Immply

Q. Read Replicas require a transactional storage engine and are only supported for which storage engine?
Read Replicas require a transactional storage engine and are only supported for the InnoDB storage engine.
InnoDB is the default storage engine for MySQL, providing ACID compliance.
Read Replicas allow for horizontal scaling of read operations, improving performance.
InnoDB supports transactions, foreign keys, and row-level locking, essential for data integrity.
Other storage engines like MyISAM do not support transactions, making them unsuitable for Read Replicas.

Asked in Genpact

Q. What is a 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

Asked in Capgemini

Q. How do you 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

Asked in Housing.com

Q. How does a Linux system 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

Asked in Housing.com

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

Asked in Apple

Q. Suppose a server is experiencing high CPU usage. How would you troubleshoot this issue?
To troubleshoot high CPU usage, analyze processes, check logs, and optimize configurations.
Use 'top' or 'htop' command to identify processes consuming high CPU.
Check system logs for errors or warnings using 'tail -f /var/log/syslog'.
Analyze application performance metrics with tools like Prometheus or Grafana.
Review recent changes or deployments that may have impacted performance.
Consider scaling resources or optimizing code if specific applications are consistently high.

Asked in Hitech Digital Solutions

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

Asked in Chetu

Q. What is the difference between TFS and SCM and what is the key benefits of using it?
TFS is a comprehensive tool for project management and version control, while SCM focuses on source code management.
TFS (Team Foundation Server) integrates version control, project management, and build automation.
SCM (Source Control Management) primarily focuses on tracking changes in source code.
TFS supports Agile methodologies, allowing teams to plan, track, and discuss work.
Examples of SCM tools include Git, Subversion, and Mercurial, which are primarily for code versioni...read more
Asked in KodesTree Technologies

Q. How does Prometheus handle high availability and scalability?
Prometheus achieves high availability and scalability through federation, sharding, and horizontal scaling.
Prometheus uses federation to collect data from multiple Prometheus servers and aggregate it into a single view.
Sharding allows Prometheus to distribute the workload across multiple instances, improving performance and reliability.
Horizontal scaling involves adding more Prometheus servers to handle increased data volume and traffic.
Prometheus also supports clustering for...read more
Interview Experiences of Popular Companies
Top Interview Questions for Devops 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