├── LICENSE ├── README.md └── README.ru_RU.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 | * [schumar](https://github.com/schumar) 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 | * [bharatnc](https://github.com/bharatnc) 36 | 37 | 38 | #### [[⬆]](#toc) General Questions: 39 | 40 | * What did you learn yesterday/this week? 41 | * Talk about your preferred development/administration environment. (OS, Editor, Browsers, Tools etc.) 42 | * Tell me about the last major Linux project you finished. 43 | * 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? 44 | * Why we must choose you? 45 | * What function does DNS play on a network? 46 | * What is HTTP? 47 | * What is an HTTP proxy and how does it work? 48 | * Describe briefly how HTTPS works. 49 | * What is SMTP? Give the basic scenario of how a mail message is delivered via SMTP. 50 | * What is RAID? What is RAID0, RAID1, RAID5, RAID10? 51 | * What is a level 0 backup? What is an incremental backup? 52 | * Describe the general file system hierarchy of a Linux system. 53 | * Which difference have between public and private SSH key? 54 | 55 | 56 | #### [[⬆]](#toc) Simple Linux Questions: 57 | 58 | * What is the name and the UID of the administrator user? 59 | * How to list all files, including hidden ones, in a directory? 60 | * What is the Unix/Linux command to remove a directory and its contents? 61 | * Which command will show you free/used memory? Does free memory exist on Linux? 62 | * How to search for the string "my konfu is the best" in files of a directory recursively? 63 | * How to connect to a remote server or what is SSH? 64 | * How to get all environment variables and how can you use them? 65 | * I get "command not found" when I run ```ifconfig -a```. What can be wrong? 66 | * What happens if I type TAB-TAB? 67 | * What command will show the available disk space on the Unix/Linux system? 68 | * What commands do you know that can be used to check DNS records? 69 | * What Unix/Linux commands will alter a files ownership, files permissions? 70 | * What does ```chmod +x FILENAME``` do? 71 | * What does the permission 0750 on a file mean? 72 | * What does the permission 0750 on a directory mean? 73 | * How to add a new system user without login permissions? 74 | * How to add/remove a group from a user? 75 | * What is a bash alias? 76 | * How do you set the mail address of the root/a user? 77 | * What does CTRL-c do? 78 | * What does CTRL-d do? 79 | * What does CTRL-z do? 80 | * What is in /etc/services? 81 | * How to redirect STDOUT and STDERR in bash? (> /dev/null 2>&1) 82 | * What is the difference between UNIX and Linux. 83 | * What is the difference between Telnet and SSH? 84 | * Explain the three load averages and what do they indicate. What command can be used to view the load averages? 85 | * Can you name a lower-case letter that is not a valid option for GNU ```ls```? 86 | * What is a Linux kernel module? 87 | * Walk me through the steps in booting into single user mode to troubleshoot a problem. 88 | * Walk me through the steps you'd take to troubleshoot a 404 error on a web application you administer. 89 | * What is ICMP protocol? Why do you need to use? 90 | 91 | #### [[⬆]](#toc) Medium Linux Questions: 92 | 93 | * What do the following commands do and how would you use them? 94 | * ```tee``` 95 | * ```awk``` 96 | * ```tr``` 97 | * ```cut``` 98 | * ```tac``` 99 | * ```curl``` 100 | * ```wget``` 101 | * ```watch``` 102 | * ```head``` 103 | * ```tail``` 104 | * ```less``` 105 | * ```cat``` 106 | * ```touch``` 107 | * ```sar``` 108 | * ```netstat``` 109 | * ```tcpdump``` 110 | * ```lsof``` 111 | * What does an ```&``` after a command do? 112 | * What does ```& disown``` after a command do? 113 | * What is a packet filter and how does it work? 114 | * What is Virtual Memory? 115 | * What is swap and what is it used for? 116 | * What is an A record, an NS record, a PTR record, a CNAME record, an MX record? 117 | * Are there any other RRs and what are they used for? 118 | * What is a Split-Horizon DNS? 119 | * What is the sticky bit? 120 | * What does the immutable bit do to a file? 121 | * What is the difference between hardlinks and symlinks? What happens when you remove the source to a symlink/hardlink? 122 | * What is an inode and what fields are stored in an inode? 123 | * How to force/trigger a file system check on next reboot? 124 | * What is SNMP and what is it used for? 125 | * What is a runlevel and how to get the current runlevel? 126 | * What is SSH port forwarding? 127 | * What is the difference between local and remote port forwarding? 128 | * What are the steps to add a user to a system without using useradd/adduser? 129 | * What is MAJOR and MINOR numbers of special files? 130 | * Describe the mknod command and when you'd use it. 131 | * Describe a scenario when you get a "filesystem is full" error, but 'df' shows there is free space. 132 | * Describe a scenario when deleting a file, but 'df' not showing the space being freed. 133 | * Describe how 'ps' works. 134 | * What happens to a child process that dies and has no parent process to wait for it and what’s bad about this? 135 | * Explain briefly each one of the process states. 136 | * How to know which process listens on a specific port? 137 | * What is a zombie process and what could be the cause of it? 138 | * 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? 139 | * Explain what echo "1" > /proc/sys/net/ipv4/ip_forward does. 140 | * Describe briefly the steps you need to take in order to create and install a valid certificate for the site https://foo.example.com. 141 | * Can you have several HTTPS virtual hosts sharing the same IP? 142 | * What is a wildcard certificate? 143 | * Which Linux file types do you know? 144 | * What is the difference between a process and a thread? And parent and child processes after a fork system call? 145 | * What is the difference between exec and fork? 146 | * What is "nohup" used for? 147 | * What is the difference between these two commands? 148 | * ```myvar=hello``` 149 | * ```export myvar=hello``` 150 | * How many NTP servers would you configure in your local ntp.conf? 151 | * What does the column 'reach' mean in ```ntpq -p``` output? 152 | * You need to upgrade kernel at 100-1000 servers, how you would do this? 153 | * How can you get Host, Channel, ID, LUN of SCSI disk? 154 | * How can you limit process memory usage? 155 | * What is bash quick substitution/caret replace(^x^y)? 156 | * Do you know of any alternative shells? If so, have you used any? 157 | * What is a tarpipe (or, how would you go about copying everything, including hardlinks and special files, from one server to another)? 158 | * How can you tell if the httpd package was already installed? 159 | * How can you list the contents of a package? 160 | * How can you determine which package is better: openssh-server-5.3p1-118.1.el6_8.x86_64 or openssh-server-6.6p1-1.el6.x86_64 ? 161 | * Can you explain to me the difference between block based, and object based storage? 162 | 163 | #### [[⬆]](#toc) Hard Linux Questions: 164 | 165 | * What is a tunnel and how you can bypass a http proxy? 166 | * What is the difference between IDS and IPS? 167 | * What shortcuts do you use on a regular basis? 168 | * What is the Linux Standard Base? 169 | * What is an atomic operation? 170 | * Your freshly configured http server is not running after a restart, what can you do? 171 | * What kind of keys are in ~/.ssh/authorized_keys and what it is this file used for? 172 | * I've added my public ssh key into authorized_keys but I'm still getting a password prompt, what can be wrong? 173 | * Did you ever create RPM's, DEB's or solaris pkg's? 174 | * What does ```:(){ :|:& };:``` do on your system? 175 | * How do you catch a Linux signal on a script? 176 | * Can you catch a SIGKILL? 177 | * What's happening when the Linux kernel is starting the OOM killer and how does it choose which process to kill first? 178 | * 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. 179 | * What's a chroot jail? 180 | * When trying to umount a directory it says it's busy, how to find out which PID holds the directory? 181 | * What's LD_PRELOAD and when it's used? 182 | * You ran a binary and nothing happened. How would you debug this? 183 | * What are cgroups? Can you specify a scenario where you could use them? 184 | * How can you remove/delete a file with file-name consisting of only non-printable/non-type-able characters? 185 | * How can you increase or decrease the priority of a process in Linux? 186 | 187 | 188 | #### [[⬆]](#toc) Expert Linux Questions: 189 | 190 | * 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? 191 | * What do you control with swapiness? 192 | * How do you change TCP stack buffers? How do you calculate it? 193 | * What is Huge Tables? Why isn't it enabled by default? Why and when use it? 194 | * What is LUKS? How to use it? 195 | 196 | 197 | #### [[⬆]](#toc) Networking Questions: 198 | 199 | * What is localhost and why would ```ping localhost``` fail? 200 | * What is the similarity between "ping" & "traceroute" ? How is traceroute able to find the hops. 201 | * What is the command used to show all open ports and/or socket connections on a machine? 202 | * Is 300.168.0.123 a valid IPv4 address? 203 | * Which IP ranges/subnets are "private" or "non-routable" (RFC 1918)? 204 | * What is a VLAN? 205 | * What is ARP and what is it used for? 206 | * What is the difference between TCP and UDP? 207 | * What is the purpose of a default gateway? 208 | * What is command used to show the routing table on a Linux box? 209 | * A TCP connection on a network can be uniquely defined by 4 things. What are those things? 210 | * 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? 211 | * How do you add an IPv6 address to a specific interface? 212 | * 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 you the response ```sendmsg: operation not permitted```. What could be wrong? 213 | * What is SNAT and when should it be used? 214 | * Explain how could you ssh login into a Linux system that DROPs all new incoming packets using a SSH tunnel. 215 | * How do you stop a DDoS attack? 216 | * How can you see content of an ip packet? 217 | * What is IPoAC (RFC 1149)? 218 | * What will happen when you bind port 0? 219 | 220 | 221 | 222 | #### [[⬆]](#toc) MySQL questions: 223 | 224 | * How do you create a user? 225 | * How do you provide privileges to a user? 226 | * What is the difference between a "left" and a "right" join? 227 | * Explain briefly the differences between InnoDB and MyISAM. 228 | * Describe briefly the steps you need to follow in order to create a simple master/slave cluster. 229 | * Why should you run "mysql_secure_installation" after installing MySQL? 230 | * How do you check which jobs are running? 231 | * How would you take a backup of a MySQL database? 232 | 233 | #### [[⬆]](#toc) DevOps Questions: 234 | 235 | * Can you describe your workflow when you create a script? 236 | * What is GIT? 237 | * What is a dynamically/statically linked file? 238 | * What does "./configure && make && make install" do? 239 | * What is puppet/chef/ansible used for? 240 | * What is Nagios/Zenoss/NewRelic used for? 241 | * What is Jenkins/TeamCity/GoCI used for? 242 | * What is the difference between Containers and VMs? 243 | * How do you create a new postgres user? 244 | * What is a virtual IP address? What is a cluster? 245 | * How do you print all strings of printable characters present in a file? 246 | * How do you find shared library dependencies? 247 | * What is Automake and Autoconf? 248 | * ./configure shows an error that libfoobar is missing on your system, how could you fix this, what could be wrong? 249 | * What are the advantages/disadvantages of script vs compiled program? 250 | * What's the relationship between continuous delivery and DevOps? 251 | * What are the important aspects of a system of continuous integration and deployment? 252 | * How would you enable network file sharing within AWS that would allow EC2 instances in multiple availability zones to share data? 253 | 254 | #### [[⬆]](#toc) Fun Questions: 255 | 256 | * A careless sysadmin executes the following command: ```chmod 444 /bin/chmod ``` - what do you do to fix this? 257 | * I've lost my root password, what can I do? 258 | * I've rebooted a remote server but after 10 minutes I'm still not able to ssh into it, what can be wrong? 259 | * If you were stuck on a desert island with only 5 command-line utilities, which would you choose? 260 | * You come across a random computer and it appears to be a command console for the universe. What is the first thing you type? 261 | * Tell me about a creative way that you've used SSH? 262 | * You have deleted by error a running script, what could you do to restore it? 263 | * What will happen on 19 January 2038? 264 | * How to reboot server when reboot command is not responding? 265 | 266 | 267 | #### [[⬆]](#toc) Demo Time: 268 | 269 | * Unpack test.tar.gz without man pages or google. 270 | * Remove all "*.pyc" files from testdir recursively? 271 | * Search for "my konfu is the best" in all *.py files. 272 | * Replace the occurrence of "my konfu is the best" with "I'm a linux jedi master" in all *.txt files. 273 | * Test if port 443 on a machine with IP address X.X.X.X is reachable. 274 | * Get http://myinternal.webserver.local/test.html via telnet. 275 | * How to send an email without a mail client, just on the command line? 276 | * Write a ```get_prim``` method in python/perl/bash/pseudo. 277 | * Find all files which have been accessed within the last 30 days. 278 | * Explain the following command ```(date ; ps -ef |tail -n +2 | awk '{print $1}' | sort | uniq | wc -l ) >> Activity.log``` 279 | * Write a script to list all the differences between two directories. 280 | * In a log file with contents as ```