mikonoid / devops-SRE-sysadmin-interview-questions

devops/SRE interview questions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:
What is Virtual memory?
Explanation:
What is a swap space?

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

What is zombie process?
Explanation:
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:
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:
What is kernel panic?
Explanation:
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:
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:
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:

Databases

What is SQL?
Explanation: * http://www.sqlcourse.com/intro.html
SQL vs NoSQL. Explain benefits of both
Explanation:
What are tables and field?
Explanation:
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:
What is DynamoDB?
Explanation:

Version Control System (GIT)

What is GIT?
Explanation:

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:

What is the difference between `git reset` and `git revert` ?
Explanation:

What is `git rebase` ?
Explanation:

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:

Containers

What is LXC?
Explanation:

What is Docker?
Explanation:

What are the advantages of using Docker container?
Explanation:

Docker RUN vs CMD vs ENTRYPOINT
Explanation:

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:

What is docker namespaces?
Explanation:

Docker and OCI
Explanation:

What is docker multistage build? Create one example
Explanation:

Kubernetes

Why we need container orchestration?
Explanation:
What is kubernetes?
Explanation: TODO
What are the features of Kubernetes?
Explanation:
What is POD?
Explanation:
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:
What is CNI?
Explanation:
What is headless service?
Explanation:
What are the units of CPU and memory in POD definition?
Explanation:
How to deploy stateful application in Kubernetes?
Explanation:
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:
Salt tutorials
Explanation:
Puppet tutorials
Explanation:

CI/CD

What is continuous integration?
Explanation:
What is continuous delivery?
Explanation:
What is continuous deployment?
Explanation:
What are the benefits of CI/CD?
Explanation:
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:

K8S native CI/CD
Explanation:

Infrastructure as code

Terraform questions

Terraform tutorials
Explanation:

What is terraform modules?
Explanation:

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:

What is terraform lock file?

Explanation:

AWS Cloudformation

AWS CloudFormation

Explanation:

Clouds

What is PaaS, SaaS, IaaS?
Explanation:
What is private cloud?
Explanation:
What is public cloud?
Explanation:
What is cloud service?
Explanation:
What is serverless service?
Explanation:
AWS tutorials
Explanation:
Google Cloud tutorials
Explanation:
Openstack tutorials
Explanation:

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

Books and courses

About

devops/SRE interview questions

License:MIT License