Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views5 pages

Devops Interview Questions

The document contains a comprehensive list of interview questions related to Terraform and DevOps practices, focusing on various aspects such as Terraform file structure, state management, modules, and best practices. It also includes questions about Azure services, CI/CD tools, and comparisons with other infrastructure management tools like Ansible and CloudFormation. Additionally, it covers practical scenarios and challenges faced while using Terraform in real-world applications.

Uploaded by

GANESH KULKARNI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

Devops Interview Questions

The document contains a comprehensive list of interview questions related to Terraform and DevOps practices, focusing on various aspects such as Terraform file structure, state management, modules, and best practices. It also includes questions about Azure services, CI/CD tools, and comparisons with other infrastructure management tools like Ansible and CloudFormation. Additionally, it covers practical scenarios and challenges faced while using Terraform in real-world applications.

Uploaded by

GANESH KULKARNI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

DevOps Interview Questions

https://github.com/shubham1507/DevOps-Interviews/blob/master/ITC

• Tell about your Terraform files you create


Ans:
Interviewer: Can you tell me about the Terraform files you've created and how you
use them for Azure?
Interviewee (me): Certainly! I have worked extensively with Terraform to manage
Azure infrastructure. Here's how I typically structure and use Terraform files for
Azure:
1. Providers Configuration: I define the Azure provider and authenticate using a
Service Principal. For example:
provider "azurerm" {
features {}
}
I ensure secure authentication through environment variables for the Service
Principal credentials (e.g., ARM_CLIENT_ID, ARM_CLIENT_SECRET).
2. Resources Definition: In main.tf, I create resources like virtual networks,
virtual machines, or storage accounts. For example:
resource "azurerm_virtual_machine" "vm_example" { name = "example-vm" location =
azurerm_resource_group.rg.location resource_group_name =
azurerm_resource_group.rg.name network_interface_ids =
[azurerm_network_interface.nic.id] vm_size = "Standard_DS1_v2"
storage_image_reference { publisher = "Canonical" offer = "UbuntuServer" sku =
"18.04-LTS" version = "latest" } os_disk { name = "example-os-disk" caching =
"ReadWrite" create_option = "FromImage" managed_disk_type = "Standard_LRS" } }

3. Variables and Outputs: I use variables.tf for reusability and outputs.tf to
retrieve critical information, like the IP address of a VM. For example:
o Variable:
variable "location" { default = "East US" }
o Output:
output "vm_ip_address" { value = azurerm_public_ip.vm_public_ip.ip_address }
4. Modules: To improve reusability, I create modules for common components like
VPCs, security groups, or virtual machines. For example:
module "network" { source = "./modules/network" resource_group_name =
azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location }
5. State Management: I configure remote state storage using Azure Blob Storage
with state locking enabled via Azure's built-in mechanisms. This ensures team
collaboration without conflicts.
6. Best Practices: I follow these guidelines:
o Use version control for .tf files to track changes and maintain history.
o Secure sensitive information (e.g., Service Principal credentials) using
environment variables or Azure Key Vault.
o Implement Terraform workspaces to manage multiple environments (e.g., dev,
staging, prod).
These practices have allowed me to manage Azure resources efficiently, ensuring
scalability, security, and consistency across projects. Would you like me to
elaborate on any specific aspect of my experience with Azure and Terraform

• What happens for abc.tfvars


• Where you maintain.tfstate file / what is best practice
• What is null resource in Terraform
• What is Terraform provisions er
------------------------------------------------------------
• What is azure pull
• Availability set vs availability zone
• What is blue, green in azure devops
• Load balancer vs application gateway
• Any DR strategy in azure you worked

Terraform interview questions

From where we call a module, what is that module called?


Have you ever heard about remote backends in
Terraform? Do you have any ideas or experience with them?
How can you provide variable values at runtime in Terraform?
In an organization, how do you manage multiple environments in Terraform?
Why do we call Terraform "Infrastructure as Code" (laC)? Is there a particular
reason for this?
Can you explain some drawbacks or challenges you have faced in your career?
Which version of Terraform are you using?

If you had to choose between Ansible and Terraform, which one would you prefer and
why?
In your current organization, which tool are you using: Ansible, Terraform, or
Pulumi?
Can you talk about any features of Pulumi that you find particularly useful or
impressive?
Have you ever heard about Bicep or ARM templates? In a scenario where you have 20
resources running on a public cloud (AWS or Azure) and you want to destroy just one
resource, how would you go about doing that?
Have you ever preserved a key that you created using Terraform?
What happens if you delete the Terraform state file
and then run the terraform apply or terraform plan command?
Have you ever worked with modules in Terraform?
What are the different types of modules in Terraform? The module that gets called
is what: a parent module or a child module?

When you created the environment using Terraform, what components did you set up
using Terraform? How do you make changes to the configuration of already created
resources using Terraform?
When the Terraform state file is created, what do you do with that state file and
where do you store and find it?
How do you resolve the issue if you lose the Terraform state file?
What are the major features you have found in Terraform that you can talk about?
What are the major features you have found in
Terraform that you can talk about?
What is the terraform validate command used for,
and can you provide an example?
Have you ever heard about the lifecycle in Terraform?
Can you talk more about it?
Have you worked with tools like CloudFormation, Ansible, or anything similar?

---+------
https://cloudchamp.notion.site/Terraform-Scenario-based-Interview-Questions-
bce29cb359b243b4a1ab3191418bfaab
-----++---

Question 1: What are workspaces in Terraform, and how do they help manage
infrastructure?
🔹 Question 2: Explain how to handle secrets or sensitive data in Terraform
configurations.
🔹 Question 3: What is the difference between Terraform's count and for_each meta-
arguments?
🔹 Question 4: How do you handle dependencies between resources in Terraform?
🔹 Question 5: Explain how Terraform handles state management and why it's
important.
🔹 Question 6: What are Terraform providers, and how do they facilitate
infrastructure management?
🔹 Question 7: How can you enable parallelism and improve performance in Terraform
operations?
🔹 Question 8: What are remote backends in Terraform, and why would you use them?
🔹 Question 9: Explain how you can manage Terraform modules effectively in a large-
scale infrastructure project.
🔹 Question 10: How do you handle Terraform state locking to prevent concurrent
modifications?
🔹 Question 11: What are the differences between Terraform's local-exec and remote-
exec provisioners?
🔹 Question 12: How can you manage Terraform state across multiple environments or
teams securely?
🔹 Question 13: Explain the difference between Terraform's taint and import
commands.

Question 14: How do you handle drift detection and remediation in Terraform?
🔹 Question 15: What are some best practices for structuring Terraform
configurations in a modular and reusable way?
-------------+-------

https://grok.com/share/bGVnYWN5_df1cef7b-efc8-4e6a-a8eb-d5bcbbee1d41

---------+-----

Here is the extracted text from the images, organized by each slide:

1. *First Image:*
- "1. Daily activities that you do in Terraform?"

2. *Second Image:*
- "2. What are services that you have worked with and wrote terraform files?"

3. *Third Image:*
- "3. Tell me a scenario where you come across provisioners?"

4. *Fourth Image:*
- "4. What are plugins and providers in terraform?"

5. *Fifth Image:*
- "5. How do you deploy the terraform code, manually or with some automation?
Have configured locks on the backend statefile?"

6. *Sixth Image:*
- "6. When you want to deploy the same terraform code on different env then what
is the best strategy?"

Here is the extracted text from the provided images:

1. *Image 1:*
- "8. How do you call output of one module in another module?"

2. *Image 2:*
- "10. Can we merge 2 different state files?"
3. *Image 3:*
- "7. How do you standardize terraform code so that can be shared across
multiple teams in an organization?"

4. *Image 4:*
- "13. Lets assume 2 resources you are creating using terraform, but we need
make sure once 1st resource created successfully then only need to start creating
2nd resource. Is this possible?"

5. *Image 5:*
- "12. Best way to authenticate cloud providers through Terraform?"

6. *Image 6:*
- "9. Lets say you have created lot of resources using terraform out of is there
way to delete one the resource through terraform?"

Here is the extracted text from the provided images:

1. *Image 1:*
- 20. What is Dynamic Block in terraform?

2. *Image 2:*
- 16. Can terraform used for automating on prem infra?

3. *Image 3:*
- 17. What if we encounter a serious error and want to rollback?

4. *Image 4:*
- 15. What happens if statefile is missed or delete?

5. *Image 5:*
- 19. If we give count zero in resources level what will happen?

6. *Image 6:*
- 18. How to call existing resources from Aws or azure to terraform without
hardcoding the values or terraform import?

Here is the extracted text from the images:

*First Image:*
21. Best Practices in Terraform?

*Second Image:*
22. What CI/CD tool you have used to deploy terraform code and what version of
terraform you have used?

++------------+

Terraform Interview Questions


1. What is difference between terraform and CloudFormation?
2. What is difference between ansible and terraform?
3. What are the terraform commands are you used?
4. What is difference between terraform plan and terraform apply?
5. What are all the terraform function have you used?
6. What is element function?
7. What is lookup function?8. What is terraform import?
9. What is terraform taint?
10. How to convert existing AWS resource to terraform code?
11. Write a terraform import command for ec2 instance?
12. What is splat expression?
13. What is Terraform modules?
14. What is resource type and data source type?
15. Where is yours terraform state file you are storing?
16. How many backend type for to store terraform state file?
17. What is terraform cloud?
18. What is terraform console command?
19. What will happen when we do terraform destroy
----+++++

00:00 - Introduction
01:08 - What is Terraform?
02:35 - How do you deploy infrastructure using Terraform?
03:43 - Terraform object types
05:34 - Optional resources in Terraform?
06:45 - Multiple Environments with Terraform
08:48 - Collab

orating with Terraform


10:10 - What is Terraform not good for?
12:37 - Conclusion
----+++

1. How securely one will set up 3 tier application on azure


2. Difference between public IP/private
3. How 2 services will communicate with each other (db and middleware)
4. How to reduce the size of docker image
5. Have you used python in azure function
6. How to make sure date persist even after container deleted
7. Explain the process of creating an image of an application and tagged it with v1
by setting it with jenkins pipeline
8. What things you will monitor while an application running (let say 3 tier
application)
9. How you have integrated Jfrog and jenkins
10. What sort of services you used in azure
11. How to create n users in m number of linux machine

You might also like