├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Linux System Administrator/DevOps Interview Questions 2 | ==================================================== 3 | 4 | A collection of linux sysadmin/devops interview questions. Feel free to contribute via pull requests, issues or email messages. 5 | 6 | 7 | ## Table of Contents 8 | 9 | 1. [Contributors](#contributors) 10 | 1. [General Questions](#general) 11 | 1. [Simple Linux Questions](#simple) 12 | 1. [Medium Linux Questions](#medium) 13 | 1. [Hard Linux Questions](#hard) 14 | 1. [Expert Linux Questions](#expert) 15 | 1. [Networking Questions](#network) 16 | 1. [MySQL Questions](#mysql) 17 | 1. [DevOps Questions](#devop) 18 | 1. [Fun Questions](#fun) 19 | 1. [Demo Time](#demo) 20 | 1. [Other Great References](#references) 21 | 22 | 23 | ####[[⬆]](#toc) Contributors: 24 | 25 | * [moregeek](https://github.com/moregeek) 26 | * [typhonius](https://github.com/typhonius) 27 | * martin 28 | * [negesti](https://github.com/negesti) 29 | * peter 30 | * [andreashappe](https://github.com/andreashappe) 31 | * [quatrix](https://github.com/quatrix) 32 | * [biyanisuraj](https://github.com/biyanisuraj) 33 | * [pedroguima](https://github.com/pedroguima) 34 | * Ben 35 | 36 | 37 | ####[[⬆]](#toc) General Questions: 38 | 39 | * What did you learn yesterday/this week? 40 | * Talk about your preferred development/administration environment. (OS, Editor, Browsers, Tools etc.) 41 | * Tell me about the last major Linux project you finished. 42 | * Tell me about the biggest mistake you've made in [some recent time period] and how you would do it differently today. What did you learn from this experience? 43 | * Why we must choose you? 44 | * What function does DNS play on a network? 45 | * What is HTTP? 46 | * What is an HTTP proxy and how does it work? 47 | * Describe briefly how HTTPS works. 48 | * What is SMTP? Give the basic scenario of how a mail message is delivered via SMTP. 49 | * What is RAID? What is RAID0, RAID1, RAID5, RAID10? 50 | * What is a level 0 backup? What is an incremental backup? 51 | * Describe the general file system hierarchy of a Linux system. 52 | 53 | 54 | ####[[⬆]](#toc) Simple Linux Questions: 55 | 56 | * What is the name and the UID of the administrator user? 57 | * How to list all files, including hidden one, in a directory? 58 | * What is the Unix/Linux command to remove a directory and its contents? 59 | * Which command will show you free/used memory? Does free memory exist on Linux? 60 | * How to search for the string "my konfi is the best" in files of a directory recursively? 61 | * How to connect to a remote server or what is SSH? 62 | * How to get all environment variables and how can you use them? 63 | * I get "command not found" when I run ```ifconfig -a```. What can be wrong? 64 | * What happens if I type TAB-TAB? 65 | * What command will show the available disk space on the Unix/Linux system? 66 | * What commands do you know that can be used to check DNS records? 67 | * What Unix/Linux commands will alter a files ownership, files permissions? 68 | * What does ```chmod +x FILENAME```do? 69 | * What does the permission 0750 on a file mean? 70 | * What does the permission 0750 on a directory mean? 71 | * How to add a new system user without login permissions? 72 | * How to add/remove a group from a user? 73 | * What is a bash alias? 74 | * How do you set the mail address of the root/a user? 75 | * What does CTRL-c do? 76 | * What is in /etc/services? 77 | * How to redirect STDOUT and STDERR in bash? (> /dev/null 2>&1) 78 | * What is the difference between UNIX and Linux. 79 | * What is the difference between Telnet and SSH? 80 | * Explain the three load averages and what do they indicate. 81 | 82 | 83 | 84 | ####[[⬆]](#toc) Medium Linux Questions: 85 | 86 | * What do the following commands do? 87 | * ```tee``` 88 | * ```awk``` 89 | * ```tr``` 90 | * ```cut``` 91 | * ```tac``` 92 | * ```curl``` 93 | * ```wget``` 94 | * ```watch``` 95 | * ```tail``` 96 | * What does a ```&``` after a command do? 97 | * What does ```& disown``` after a command do? 98 | * What is a packet filter and how does it work? 99 | * What is Virtual Memory? 100 | * What is swap and what is it used for? 101 | * What is an A record, an NS record, a PTR record, a CNAME record, an MX record? 102 | * Are there any other RRs and what are they used for? 103 | * What is a Split-Horizon DNS? 104 | * What is the sticky bit? 105 | * What does the immutable bit to a file? 106 | * What is the difference between hardlinks and symlinks? What happens when you remove the source to a symlink/hardlink? 107 | * What is an inode and what fields are stored in an inode? 108 | * Howto force/trigger a file system check on next reboot? 109 | * What is SNMP and what is it used for? 110 | * What is a runlevel and how to get the current runlevel? 111 | * What is SSH port forwarding? 112 | * What is the difference between local and remote port forwarding? 113 | * What are the steps to add a user to a system without using useradd/adduser? 114 | * What is MAJOR and MINOR numbers of special files? 115 | * Describe a scenario when you get a "filesystem is full" error, but 'df' shows there is free space. 116 | * Describe a scenario when deleting a file, but 'df' not showing the space being freed. 117 | * Describe how 'ps' works. 118 | * What happens to a child process that dies and has no parent process to wait for it and what’s bad about this? 119 | * Explain briefly each one of the process states. 120 | * How to know which process listens on a specific port? 121 | * You run a bash script and you want to see its output on your terminal and save it to a file at the same time. How could you do it? 122 | * Explain what echo "1" > /proc/sys/net/ipv4/ip_forward does. 123 | * Describe briefly the steps you need to take in order to create and install a valid certificate for the site https://foo.example.com. 124 | * Can you have several HTTPS virtual hosts sharing the same IP? 125 | * What is a wildcard certificate? 126 | * Which Linux file types to you know? 127 | * What is the difference between a process and a thread? And parent and child processes after a fork system call? 128 | * What is the difference between exec and fork? 129 | * What is "nohup" used for? 130 | * What is the difference between these two commands? 131 | * ```myvar=hello``` 132 | * ```export myvar=hello``` 133 | * How many NTP servers would you configure in your local ntp.conf? 134 | * What does the column 'reach' mean in ```ntpq -p``` output? 135 | * You need to upgrade kernel at 100-1000 servers, how you would do this? 136 | * How can you get Host, Channel, ID, LUN of SCSI disk? 137 | * How can you limit process memory usage? 138 | 139 | ####[[⬆]](#toc) Hard Linux Questions: 140 | 141 | * What is a tunnel and how you can bypass a http proxy? 142 | * What is the difference between IDS and IPS? 143 | * What shortcuts do you use on a regular basis? 144 | * What is the Linux Standard Base? 145 | * What is an atomic operation? 146 | * Your freshly configured http server is not running after a restart, what can you do? 147 | * What kind of keys are in ~/.ssh/authorized_keys and what it is this file used for? 148 | * I've added my public ssh key into authorized_keys but I'm still getting a password prompt, what can be wrong? 149 | * Did you ever create RPM's, DEB's or solaris pkg's? 150 | * What does ```:(){ :|:& };:``` do on your system? 151 | * How do you catch a Linux signal on a script? 152 | * Can you catch a SIGKILL? 153 | * What's happening when the Linux kernel is starting the OOM killer and how does it choose which process to kill first? 154 | * Describe the linux boot process with as much detail as possible, starting from when the system is powered on and ending when you get a prompt. 155 | * What's a chroot jail? 156 | * When trying to umount a directory it says it's busy, how to find out which PID holds the directory? 157 | * What's LD_PRELOAD and when it's used? 158 | * You ran a binary and nothing happened. How would you debug this? 159 | * What are cgroups? Can you specify a scenario where you could use them? 160 | 161 | 162 | ####[[⬆]](#toc) Expert Linux Questions: 163 | 164 | * A running process gets ```EAGAIN: Resource temporarily unavailable``` on reading a socket. How can you close this bad socket/file descriptor without killing the process? 165 | 166 | 167 | ####[[⬆]](#toc) Networking Questions: 168 | 169 | * What is localhost and why would ```ping localhost``` fail? 170 | * What is the similarity between "ping" & "traceroute" ? How is traceroute able to find the hops. 171 | * What is the command used to show all open ports and/or socket connections on a machine? 172 | * Is 300.168.0.123 a valid IPv4 address? 173 | * Which IP ranges/subnets are "private" or "non-routable" (RFC 1918)? 174 | * What is a VLAN? 175 | * What is ARP and what is it used for? 176 | * What is the difference between TCP and UDP? 177 | * What is the purpose of a default gateway? 178 | * What is command used to show the routing table on a Linux box? 179 | * A TCP connection on a network can be uniquely defined by 4 things. What are those things? 180 | * When a client running a web browser connects to a web server, what is the source port and what is the destination port of the connection? 181 | * How do you add an IPv6 address to a specific interface? 182 | * You have added an IPv4 and IPv6 address to interface eth0. A ping to the v4 address is working but a ping to the v6 address gives yout the response ```sendmsg: operation not permitted```. What could be wrong? 183 | * What is SNAT and when should be used? 184 | * Explain how could you ssh login into a Linux system that DROPs all new incomming packets using a SSH tunnel. 185 | * How do you stop a DDoS? 186 | * How can you see content of ip packet? 187 | 188 | 189 | ####[[⬆]](#toc) MySQL questions: 190 | 191 | * How do you create a user? 192 | * How do you provide privileges to a user? 193 | * What is the difference between a "left" and a "right" join? 194 | * Explain briefly the differences between InnoDB and MyISAM. 195 | * Describe briefly the steps you need to follow in order to create a simple master/slave cluster. 196 | * Why should you run "mysql_secure_installation" after installing MySQL? 197 | * How do you check which jobs are running? 198 | 199 | 200 | ####[[⬆]](#toc) DevOps Questions: 201 | 202 | * Can you describe your workflow when you create a script? 203 | * What is GIT? 204 | * What is a dynamically/statically linked file? 205 | * What does "configure && make && make install"? 206 | * What is puppet/chef/ansible used for? 207 | * How do you create a new postgres user? 208 | * What is a virtual IP address? What is a cluster? 209 | * How print the strings of printable characters in files? 210 | * How look shared library dependencies? 211 | * What is Automake and Autoconf? 212 | * ./configure shows an error that libfoobar is missing on your system, how could you fix this, what could be wrong? 213 | * Advantages/disadvantages of script vs compiled program. 214 | * What's the relationship between continuous delivery and DevOps? 215 | * What are the important aspects of a system of continous integration and deployment? 216 | 217 | 218 | ####[[⬆]](#toc) Fun Questions: 219 | 220 | * A careless sysadmin executes the following command: ```chmod 444 /bin/chmod ``` - what do you do to fix this? 221 | * I've lost my root password, what can I do? 222 | * I've rebooted a remote server but after 10 minutes I'm still not able to ssh into it, what can be wrong? 223 | * If you were stuck on a desert island with only 5 command-line utilities, which would you choose? 224 | * You come across a random computer and it appears to be a command console for the universe. What is the first thing you type? 225 | * Tell me about a creative way that you've used SSH? 226 | * You have deleted by error a running script, what could you do to restore it? 227 | 228 | 229 | ####[[⬆]](#toc) Demo Time: 230 | 231 | * Unpack test.tar.gz without man pages or google. 232 | * Remove all "*.pyc" files from testdir recursively? 233 | * Search for "my konfu is the best" in all *.py files. 234 | * Replace the occurrence of "my konfu is the best" with "I'm a linux jedi master" in all *.txt files. 235 | * Test if port 443 on a machine with IP address X.X.X.X is reachable. 236 | * Get http://myinternal.webserver.local/test.html via telnet. 237 | * How to send an email without a mail client, just on the command line? 238 | * Write a ```get_prim``` method in python/perl/bash/pseudo. 239 | * Find all files which have been accessed within the last 30 days. 240 | * Explain the following command ```(date ; ps -ef | awk ‘{print $1}’ | sort | uniq | wc -l ) >> Activity.log``` 241 | * Write a script to list all the differences between two directories. 242 | * In a log file with contents as ```