devops-SRE-sysadmin-interview-questions icon indicating copy to clipboard operation
devops-SRE-sysadmin-interview-questions copied to clipboard

devops/SRE interview questions

Devops/SRE interview preparation questions

This repo is agregated guide for preparation to Devops/SRE engineer interview

If you want to thank the author https://www.buymeacoffee.com/mikonoid

Linux

What is Linux Standart Base?
Explanation: https://en.wikipedia.org/wiki/Linux_Standard_Base
Popular Linux Distributions
The most popular linux distrs:
  • Ubuntu
  • Centos
  • Fedora
  • Debian
  • OpenSuse
  • ArchLinux
  • Slackware

Comparison: https://www.howtogeek.com/191207/10-of-the-most-popular-linux-distributions-compared/

Linux boot process: from power up to login promt
Explanation:
  • BIOS
  • MBR
  • GRUB
  • Kernel
  • Init
  • Runlevel

https://www.thegeekstuff.com/2011/02/linux-boot-process/

What is inode?
Explanation: https://linoxide.com/linux-command/linux-inode/
Memory types in Linux

Explanation: https://linux-audit.com/understanding-memory-information-on-linux-systems/

What is sticky bit?
Explanation:
  • https://en.wikipedia.org/wiki/Sticky_bit
  • https://www.geeksforgeeks.org/setuid-setgid-and-sticky-bits-in-linux-file-permissions/
What is Virtual memory?
Explanation:
  • https://serverfault.com/questions/138427/what-does-virtual-memory-size-in-top-mean
  • https://elinux.org/images/4/4c/Ott.pdf
What is a swap space?

Explanation: https://itsfoss.com/create-swap-file-linux/

What is zombie process?
Explanation:
  • https://en.wikipedia.org/wiki/Zombie_process
  • https://www.geeksforgeeks.org/zombie-processes-prevention/
  • https://stackoverflow.com/questions/16944886/how-to-kill-zombie-process
File types in Linux
Explanation: https://www.linux.com/tutorials/file-types-linuxunix-explained-detail/
What is proc filesystem?
Explanation:

http://man7.org/linux/man-pages/man5/proc.5.html

Linux Process Monitor(TOP). Explain all information from top
Explanation:

https://www.maketecheasier.com/linux-top-explained/

What is the difference between hardlinks and symlinks?
Explanation:

https://medium.com/@307/hard-links-and-symbolic-links-a-comparison-7f2b56864cdd

What happens if you delete the root user?
Explanation:
  • In most cases you will get unbootable system
  • https://askubuntu.com/questions/962660/what-happens-if-you-delete-the-root-user
What is a chroot?
Explanation:

https://www.howtogeek.com/441534/how-to-use-the-chroot-command-on-linux/

What is OOM and OOMkiller? How it OOM killer is working
Explanation:
  • https://dev.to/rrampage/surviving-the-linux-oom-killer-2ki9
  • https://www.percona.com/blog/2019/08/02/out-of-memory-killer-or-savior/
What is kernel panic?
Explanation:
  • https://www.linuxjournal.com/content/oops-debugging-kernel-panics-0
  • http://www.linuxandubuntu.com/home/things-to-know-about-linux-kernel-panic
What is 'nohup' used for?
Explanation:

https://www.computerhope.com/unix/unohup.htm

What can you do to restore deleted bash script(script is running but deleted by error)?
Explanation:

See filesystem /proc and find ID proccess in that directory should be script

What is RAID?
Explanation:

https://en.wikipedia.org/wiki/Standard_RAID_levels

What happens when a hardlink is removed?
Explanation:

The file will be deleted if you delete only the last hardlink to this file.

Imagine you executed command `chmod -x /bin/chmod`. How to fix this?
Explanation:

Solution1:

cp /bin/cp /tmp/chmod
cp /bin/chmod /tmp/chmod
./tmp/chmod 755 /bin/chmod

Solution2:

perl -e 'chmod(0755, "chmod")`

Solution3:

/lib/ld-linux.so.2 /bin/chmod 755 /bin/chmod

What is Load Average?
Explanation:

http://www.brendangregg.com/blog/2017-08-08/linux-load-averages.html

What are cgroups?
Explanation:

https://www.linuxjournal.com/content/everything-you-need-know-about-linux-containers-part-i-linux-control-groups-and-process

Networking and Security

What is NAT?
Explanation:
  • https://www.geeksforgeeks.org/network-address-translation-nat/
  • https://www.comptia.org/content/guides/what-is-network-address-translation
What is VLAN?
Explanation:

https://study-ccna.com/what-is-a-vlan/

What is ARP?
Explanation:

Address Resolution Protocol. https://en.wikipedia.org/wiki/Address_Resolution_Protocol

How many layers are there under TCP/IP? Compare OSI and TCP/IP
Explanation:

https://techdifferences.com/difference-between-tcp-ip-and-osi-model.html

EXplain TCP 3-way handshake proccess
Explanation:

https://www.geeksforgeeks.org/tcp-3-way-handshake-process/

What is SSH and how does it work?
Explanation:

https://www.ssh.com/ssh/command

Explain DNS records: SOA, PTR, A, MX, and CNAME
Explanation:

https://www.presslabs.com/how-to/dns-records/

How to check route table in Linux?
Explanation:

netstat -rn

route -n

ip route list

Server1 can't reach to Server2. Describe possible reasons
Explanation:
  • Application layer: Check if servers are correctly configured and services up and running
  • Transport layer: Check ports, check ping from server to server
  • Network layer: Check firewall and networking setting. Also check routes, dns and ARP tables.
How to check all of open ports on server?
Explanation:
  • nmap - if you need check all ports for remote server
  • netstat - for localhost

Programming

BASH

How to check if the last command was run successfully?
Explanation:

echo $? if returns 0 that last command executed successfully

What is function? How to write a function?
Explanation:

https://linuxize.com/post/bash-functions/

Loops in BASH
Explanation:

https://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-7.html

How would you compare two strings in a bash script?
Explanation: Case1:
#!/bin/bash

VAR1="string1"
VAR2="string333"

if [ "$VAR1" = "$VAR2" ]; then
  echo "Strings are equal."
else
  echo "Strings are not equal."
fi

Case2:

[[ "string1" == "string2" ]] && echo "Equal" || echo "Not equal"

How to print all array elements and their indexes?
Explanation:
#!/bin/bash
array=("A" "B" "C" "X" )
echo ${array[0]}

Print number from 1 to 10 using for loop
Explanation:
#!/bin/bash
for i in {1..10}; do
    echo $i
done

How to debug a shell script ?
Explanation:

Option -x or -nv

Python

Python for sysadmins
Explanation:
  • https://realpython.com/
  • https://python-for-system-administrators.readthedocs.io/en/latest/
How to compile python application?
Explanation:

There are two ways could go about to solve that problem:

  • Use a static builder, like freeze, or pyinstaller, or py2exe
  • Compile using cython
What is PEP 8 and why is it important?
Explanation:
  • https://realpython.com/python-pep8/

Databases

What is SQL?
Explanation: * http://www.sqlcourse.com/intro.html
SQL vs NoSQL. Explain benefits of both
Explanation:
  • https://www.youtube.com/watch?v=ZS_kXvOeQ5Y
  • https://www.geeksforgeeks.org/difference-between-sql-and-nosql/
What are tables and field?
Explanation:
  • https://intellipaat.com/blog/tutorial/sql-tutorial/tables-in-sql/
What is an index?
Explanation: * https://www.tutorialspoint.com/sql/sql-indexes.htm
What is primary key?
Explanation: * https://www.w3schools.com/sql/sql_primarykey.ASP
What is database recplication?
Explanation:
  • https://www.geeksforgeeks.org/data-replication-in-dbms/
What is DynamoDB?
Explanation:
  • https://www.dynamodbguide.com/what-is-dynamo-db/

Version Control System (GIT)

What is GIT?
Explanation:
  • https://git-scm.com/book/en/v2/Getting-Started-What-is-Git
  • https://git-scm.com/book/en/v2/Getting-Started-What-is-Git

What are the benefits of using GIT?
Explanation:
  • Documentation
  • Markdown
  • Fully Distributed
  • Simplicity
  • Branching model
  • open source

What is the difference between `git pull` and `git fetch` ?
Explanation:
  • https://guide.freecodecamp.org/miscellaneous/git-pull-vs-git-fetch/

What is the difference between `git reset` and `git revert` ?
Explanation:
  • https://stackoverflow.com/questions/8358035/whats-the-difference-between-git-revert-checkout-and-reset

What is `git rebase` ?
Explanation:
  • https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase

How to reset last commit?
Explanation:
  • git reset --hard HEAD~1 - not a true way cuz you will lost all changes
  • git revert <commit-id> - good way

for more https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-local-commits-in-git

Describe a dev/test/production workflow using GIT
Explanation:
  • https://medium.com/@patrickporto/4-branching-workflows-for-git-30d0aaee7bf
  • https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow

Containers

What is LXC?
Explanation:
  • https://linuxcontainers.org/lxc/introduction/

What is Docker?
Explanation:
  • https://opensource.com/resources/what-docker

What are the advantages of using Docker container?
Explanation:
  • https://dzone.com/articles/top-10-benefits-of-using-docker

Docker RUN vs CMD vs ENTRYPOINT
Explanation:
  • https://goinbigdata.com/docker-run-vs-cmd-vs-entrypoint/

What is the difference between ADD and COPY in Dockerfile?
Explanation: * https://dev.to/lasatadevi/docker-cmd-vs-entrypoint-34e0
What is Docker registry?
Explanation:

Storage for docker images https://docs.docker.com/registry/

What is Docker volume?
Explanation:
  • https://docs.docker.com/storage/volumes/

What is docker namespaces?
Explanation:
  • https://success.docker.com/article/introduction-to-user-namespaces-in-docker-engine

Docker and OCI
Explanation:
  • https://www.padok.fr/en/blog/container-docker-oci

What is docker multistage build? Create one example
Explanation:
  • https://dev.to/brpaz/using-docker-multi-stage-builds-during-development-35bc

Kubernetes

Why we need container orchestration?
Explanation:
  • https://opensource.com/life/16/9/containing-container-chaos-kubernetes
What is kubernetes?
Explanation: TODO
What are the features of Kubernetes?
Explanation:
  • https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/
  • Kubernetes in 5 minutes https://www.youtube.com/watch?v=PH-2FfFD2PU
What is POD?
Explanation:
  • https://kubernetes.io/docs/concepts/workloads/pods/pod/
What is kubelet?
Explanation: * Kubelet - agent on a kubernetes cluster’s node that takes care of all activity on that node * https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/
What is kubectl?
Explanation:
  • https://kubernetes.io/docs/reference/kubectl/overview/
What is CNI?
Explanation:
  • https://www.dasblinkenlichten.com/understanding-cni-container-networking-interface/
What is headless service?
Explanation:
  • https://dev.to/kaoskater08/building-a-headless-service-in-kubernetes-3bk8
What are the units of CPU and memory in POD definition?
Explanation:
  • CPU is in milicores and memory in bytes
  • https://www.noqcks.io/notes/2018/02/03/understanding-kubernetes-resources/
How to deploy stateful application in Kubernetes?
Explanation:
  • https://cloud.google.com/kubernetes-engine/docs/how-to/stateful-apps
  • https://kubernetes.io/docs/tasks/run-application/run-replicated-stateful-application/
How to expose Kubernetes service?
Explanation: * https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/
Kubernetes deployments strategies: blue-green, canary, rolling
Explanation: * https://traefik.io/glossary/kubernetes-deployment-strategies-blue-green-canary/

DEVOPS

Config management

Ansible tutorials
Explanation:
  • Ansible for Devops https://leanpub.com/ansible-for-devops
  • https://serversforhackers.com/c/an-ansible-tutorial
  • https://medium.com/quick-code/top-tutorials-to-learn-ansible-33afd23ea160
Salt tutorials
Explanation:
  • https://docs.saltstack.com/en/master/topics/tutorials/walkthrough.html
  • https://www.digitalocean.com/community/tutorials/an-introduction-to-saltstack-terminology-and-concepts
Puppet tutorials
Explanation:
  • https://www.guru99.com/puppet-tutorial.html

CI/CD

What is continuous integration?
Explanation:
  • https://www.youtube.com/watch?v=_zCyLT33moA
  • https://www.atlassian.com/continuous-delivery/continuous-integration
What is continuous delivery?
Explanation:
  • https://www.atlassian.com/continuous-delivery/principles/continuous-integration-vs-delivery-vs-deployment
  • https://aws.amazon.com/devops/continuous-delivery/
What is continuous deployment?
Explanation:
  • https://www.atlassian.com/continuous-delivery/continuous-deployment
What are the benefits of CI/CD?
Explanation:
  • https://www.katalon.com/resources-center/blog/benefits-continuous-integration-delivery/
Describe a simple CI/CD Pipeline
Explanation:

https://semaphoreci.com/cicd https://www.redhat.com/en/topics/devops/what-is-ci-cd

Describe deployment strategies
Explanation:

https://thenewstack.io/deployment-strategies

Jenkins tutorials
Explanation:
  • https://www.udemy.com/share/101WuI/
  • https://www.youtube.com/playlist?list=PL9ooVrP1hQOGM6eCsjnfAousUSvpqD8dW&ref=hackr.io
  • https://jenkins.io/doc/book/

K8S native CI/CD
Explanation:
  • Tekton https://github.com/tektoncd
  • ArgoCD https://argoproj.github.io/argo-cd/
  • JenkinsX https://jenkins-x.io/

Infrastructure as code

Terraform questions

Terraform tutorials
Explanation:
  • https://www.youtube.com/watch?v=TFLQcgZr0no
  • https://www.udemy.com/share/101ZdI/
  • https://itnext.io/terraform-tutorial-part-1-intro-and-basic-concepts-7a27ae7722b6

What is terraform modules?
Explanation:
  • https://www.freecodecamp.org/news/terraform-modules-explained/

What is ".terraform" directory?
Explanation:

The ".terraform" directory is a local cache where Terraform retains some files required for subsequent operations against this configuration. Its contents are not intended to be included in version control.

What is the usage of Terraform init?
Explanation:

* Terraform init command is used to initialize the working directory containing Terraform configuration files.
* It is used for Plugin Installation.
* It is also used for Child Module Installation.
* It is used for Backend Initialization.
* You can safely run this command multiple times.

What do you understand by Terraform Backends? What are the most recommended Backends we should use?
Explanation:

Terraform backends are used to define where and how operations are performed, where state snapshots are stored, etc. Each Terraform configuration can specify a backend.

Reference:

  • https://developer.hashicorp.com/terraform/language/settings/backends/configuration

What is terraform lock file?

Explanation:

  • https://developer.hashicorp.com/terraform/language/files/dependency-lock

AWS Cloudformation

AWS CloudFormation

Explanation:

  • https://www.youtube.com/watch?v=0Sh9OySCyb4
  • https://www.simplilearn.com/tutorials/aws-tutorial/aws-cloudformation

Clouds

What is PaaS, SaaS, IaaS?
Explanation:
  • https://www.ibm.com/cloud/learn/iaas-paas-saas
What is private cloud?
Explanation:
  • https://azure.microsoft.com/en-us/overview/what-are-private-public-hybrid-clouds/
What is public cloud?
Explanation:
  • https://azure.microsoft.com/en-us/overview/what-is-a-public-cloud/
  • examples: AWS, GCP, DegitalOcean, Azure
What is cloud service?
Explanation:
  • https://searchitchannel.techtarget.com/definition/cloud-services
What is serverless service?
Explanation:
  • https://en.wikipedia.org/wiki/Serverless_computing
AWS tutorials
Explanation:
  • https://medium.com/javarevisited/5-best-aws-courses-for-beginners-and-experienced-developers-to-learn-in-2021-563212409fbd
  • https://docs.aws.amazon.com/
Google Cloud tutorials
Explanation:
  • https://www.udemy.com/topic/google-cloud/
  • https://linuxacademy.com/course/google-cloud-data-engineer/
Openstack tutorials
Explanation:

The best resource with Openstack cources is LinuxAcademy https://linuxacademy.com/library/search/openstack/

Books and courses

  • Brendan Gregg http://www.brendangregg.com/blog/index.html
  • Systems Performance http://www.brendangregg.com/sysperfbook.html
  • The Phoenix project https://www.amazon.com/Phoenix-Project-DevOps-Helping-Business/dp/1942788290/
  • SRE https://landing.google.com/sre/books/
  • Linux System Administration Handbook 5th by Evi Nemeth
  • The DevOps Handbook: How to Create World-Class Agility, Reliability, and Security in Technology Organizations