SRE/DevOps Interview Questions — Tooling
Originally published on an external platform.
SRE/DevOps Interview Questions — Tooling — Part 1
In continuation of my previous blog [SRE/DevOps Interview Questions — Linux Troubleshooting], this blog I will try to focus on the Tooling (at least a few of them) and provide handy details about frequent questions and resources.
Tools and Tooling
For any DevOps or SRE Team, Tools and Tooling are very important. Though it is not a deal-breaker if you haven’t worked with some specific tools, there are some universal ones which pretty much everybody expects you to be familiar with.
Source Control (Git)
Git has dominated source control management in the industry and is used almost everywhere. Here are some of the questions I have been asked or I have asked:
- Difference between
git fetchandgit pull? (Explanation) - Fork or Branch? Which? and Why? (Explanation)
- What is
git reflogused for? (Explanation) - Explain
git squashand why would one use it? (Explanation) - How do you perform Garbage Collection in
git? (Explanation) - How to perform cherry-pick with
git? (Explanation) - How to use
git bisect? (Explanation) - Find the list of files changed in a particular
git commit? (Explanation) - What are
git submodulesand how to keep them in sync? (Explanation) - Explain
git lfs? (Explanation) - What are Git Hooks? Pre-commit and Post-commit hooks? (Good Read)
Containers (Docker)
Docker has dominated the container world as we speak, though there are other alternatives like Podman and Containerd. However, mostly people use docker, so I am going to share some commonly and frequently asked questions.
- What is Docker BuildKit? (Explanation)
- What is Docker multi-stage build and why bother? (Explanation)
- Explain what is
/var/run/docker.sock? (Explanation) - How to run a container without using the
dockercommand? (Explanation) - How to change Docker API Version forcefully? (Explanation)
- How to get low-level information of a Docker object? (Explanation)
- Have you used the
escapedirective in Dockerfile? (Explanation) - Explain
CMDvsENTRYPOINT? (Explanation) - How will you run something only at the building stage? (Explanation)
- How to audit your docker image for vulnerabilities locally? (Explanation)
- How to make changes in
dockerddaemon? (Explanation)
How do you Increase your Docker IP space?
Add the following to /etc/docker/daemon.json:
{
"default-address-pools": [
{ "base": "172.20.0.0/16", "size": 24 },
{ "base": "172.21.0.0/16", "size": 24 }
]
}
How to change default ulimits for docker daemon?
Add the following in /etc/docker/daemon.json:
{
"default-ulimits": {
"nofile": {
"Hard": 1024000,
"Name": "nofile",
"Soft": 1024000
}
}
}
Note:
Kubernetesis a very vast topic and questions are also very frequent. I will have a separate blog for the same in future.
Infrastructure as Code (Terraform)
By now you all already know that I love terraform. Here are some of the questions I have been asked in interviews or I have asked:
Explain Terraform request flow in detail? (Explanation)
- How does terraform communicate with Providers? (Explanation)
- How to enable Providers or specific Provider logs? (Explanation)
- Advantages of using
-replaceinstead oftaint? (Explanation) - How do you change provider in state file? (Explanation)
- How to get provider schema without looking at the code? (Explanation)
- Does terraform support parallelism? (Explanation)
- Explain
.terraform.lock.hcland its use? (Explanation) - Explain
.terraformrcfile and how does it help? (Explanation) - How do you tell
terraformto ignore certain changes? (Explanation) - What is the default way to provide overrides to
terraform? (Explanation) - Can
sourceparameter in module be templatized? (Explanation)
This value must be a literal string with no template sequences; arbitrary expressions are not allowed.
- When should we use
countvsfor_each? (Explanation) - Can module with provider block use
count? (Explanation) - What happens if you try to read resource with
datablock before it has been created? (Explanation) - Can you define a
variablewhich could benullin value? (Explanation)
Configuration Management (Chef)
Chef has been the de-facto for configuration management at-least for me in my career. So let me put some frequents for chef here.
- Explain Chef Attribute’s precedence hierarchy? (Explanation)
- Can certain attributes be denied for persistence? (Explanation)
- What are types of attributes? (Explanation)
- What is
ohaiand what information it collects, if any? (Explanation) - What is
Policyfile& how it is different fromBerksfile? (Explanation) - Why one should be caution of
geminmetadata.rb? (Explanation)
Do not install native gems with the
gemsetting in metadata.rb. Thegemsetting is not a general purpose replacement for the chef_gem resource, and does not internally re-use thechef_gemresource.
- How to fetch specific version of cookbook as dependency from GitHub or Internal Source control? (Explanation)
cookbook 'chef-ingredient', git: 'https://github.com/chef-cookbooks/chef-ingredient.git', tag: 'v0.12.0'
- How to install package based on platform? (Explanation)
package_name = value_for_platform(
['centos', 'redhat', 'suse', 'fedora' ] => {
'default' => 'httpd'
},
['ubuntu', 'debian'] => {
'default' => 'apache2'
}
)
- How to check what Cloud your node is running? (Explanation)
- How do you send an email or alert if converge fails? (Explanation)
Trick Question: How do you provide Chef Credentials to Terraform
chefprovider? Export using following Env VariablesCHEF_CLIENT_NAMEandCHEF_KEY_MATERIAL.
Ok I think I will continue this on subsequent blog, as this one is getting little lengthy… Stay Tuned!!