Using CheatSheets To Apply Best Practices

Cheatsheet: Linux Internals

Cheatsheet: Linux Internals

1.2 Top 25 Linux Basic Questions

Num Name Summary
1 Thead VS Process Github Link
2 Explain virtual memory Github Link
3 Explain paging and paging fault Github Link
4 Explain inode Github Link
5 epoll VS poll VS select Github Link
6 Explain how OS schedules processes Github Link
7 Explain spinlock Github Link
8 Explain linux virtual filesystem Github Link
9 Explain linux signal Github Link
10 Explain RAID Github Link
11 Explain linux fork  
12 What is /proc directory?  
13 Forget root password. How to reset it? Reset from GRUB or liveCD
14 How to solve ssh “Connection refused” errors?  
15 How to daemonize a process?  
16 What are common scenarios of linux kernel panics?  
17 What are coredump and kdump?  
18 Program startup process in userspace Link: Program startup process in userspace
19 What’s your favorite shell and why? Link: Bash vs Zsh
20 Figure out who has logged to server now and previously? w, last, lastb; lastlog; /var/run/*tmp
21 What is init program?  
22 How does sudo work? Given sudo, why people may need su?  
23 How to close stdin/stdout/stderr of one command some_command </dev/null >/dev/null 2>&1

1.3 Explain Top Linux Tooling

Num Name Summary
1 Explain the output of vmstat command Github Link
2 Explain the output of netstat command Github Link
3 Explain the output of free command Github Link
4 Explain the output of top command Github Link
5 Explain the output of sar command system staticstics with sysstat cronjob

1.4 Top 15 Linux Workflow

Num Name Summary
1 What happens, when opening Github Link
2 What happens, when “ls -l *” Github Link. shell, expansion, fork
3 What happens, when “Ctrl + c” in a terminal Github Link. i/o interrupt, SIGINT, sig handler
4 What happens, when “touch a.txt” Github Link
5 What happens, when you press power on button in a server? Github Link. bios, mbr, grub, init, runlevel
6 What happens, when “cat /etc/hosts” Github Link
7 Explain how system call works Github Link
8 Explain hostname to ip address mapping workflow Github Link
9 Explain init.d workflow Github Link
10 Explain how to build a linux release Github Link
11 Explain how kernel schedules process Github Link
12 Explain how kernel read data from disk Github Link
13 Explain how systemtap works Github Link
14 Explain how I/O interrupt works Github Link. Top half, bottom half, interrupt handler
15 Speed up I/O Linux sendfile with zero-copy, mmap: map file to ram

1.5 Top 20 Linux Advanced Questions

Num Name Summary
1 Explain Linux security model nothing-or-all model, capability, extended attributes, selinux, etc
2 Whether it’s possible to sniff HTTPS traffic? And why?  
3 Figure out what critical commands ssh users have issued?  
4 Why is I/O uninterruptible?  
5 Explain shell features shell pipes, filename wildcards, env var expansion, alias, etc
6 What is the difference between UNIX and Linux  
7 High memory vs Low memory Wikipedia: High memory
8 What is localhost and why would ping localhost fail?  
9 How does the Linux kernel handle a system call Link: System calls in the Linux kernel
10 Difference between ext3 and ext4  
11 How do you feel about systemd? Init processes start serially, long booting time
12 ssh port forwarding VS ssh reverse port forwarding  
13 How to quickly crash an linux machine?  
14 How to deprovision a user completely?  
15 How reliable history command is? And how to alleviate the problem? ~/.bash_history, $HISTTIMEFORMAT env
16 how to generate a zombie process  
17 With bg in one terminal, jobs doesn’t show in another terminal  
18 How to setup http proxy with SLA for different traffic?  
19 What’s your wishlist for linux?  
20 What’s your ideal monitoring system in your imagination?  

1.6 Top 10 SRE Questions

Num Name Summary
1 [Logging]  
2 [Monitoring]  
3 [Migration] Regional failure  
4 [Deployment] How to do a online rolling upgrade for a given system? Single node, or multiple node?
5 [HA] DB  
6 [Automation]  
7 [Migration] How you migrate legacy on-prem app to cloud-native in public cloud?  
8 Incident Response and Management  
9 [Auto Scaling] Link: Auto scaling Pinterest

1.7 Good Mindsets

Num Name Summary
1 First thing: Stop The Bleed  
2 Pets VS Cattles  
3 Fix a process VS Fix a problem  
4 Evaluate Business Impact First  
5 Prevention VS Treatment  
6 Postmortem Culture  
7 Understand Workflow & Use Cases Super important for trouble shooting
8 Automation VS Convention  
9 Principle Of Least Privilege  
10 Design Tools VS Use Tools Operational knowledge is not good enough

1.8 Top 20 Container Questions

Num Name Summary
1 Compare to Linux process, what things containers can’t support?  
2 How to sniff container’s traffic?  
3 Explain the workflow of “docker stop $containerid  

1.9 More Resources

Leave a Reply

Your email address will not be published. Required fields are marked *