├── 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/DevOp Interview Questions 2 | ==================================================== 3 | 4 | A list of Linux Sysadmin/DevOPs questions and answers based on the Interview Questions compiled by [https://github.com/chassing/linux-sysadmin-interview-questions](https://github.com/chassing/linux-sysadmin-interview-questions), intended to assist current and future Sysadmins/DevOPs in learning the craft. 5 | 6 | Feel free to contribute via pull requests, issues or email messages. 7 | 8 | ## Table of Contents 9 | 10 | 1. [Contributors](#contributors) 11 | 1. [General Questions](#general) 12 | 1. [Simple Linux Questions](#simple) 13 | 1. [Medium Linux Questions](#medium) 14 | 1. [Hard Linux Questions](#hard) 15 | 1. [Expert Linux Questions](#expert) 16 | 1. [Networking Questions](#network) 17 | 1. [DevOp 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 | * [chassing](https://github.com/chassing) - Original Author 26 | * [moregeek](https://github.com/moregeek) 27 | * [typhonius](https://github.com/typhonius) 28 | * martin 29 | * [negesti](https://github.com/negesti) 30 | * peter 31 | * [andreashappe](https://github.com/andreashappe) 32 | * [quatrix](https://github.com/quatrix) 33 | 34 | The majority of the questions were collected from: 35 | 36 | * https://github.com/gurmeet1109/docgurmeet/tree/master/InterviewQuestionsSamples 37 | * https://github.com/kylejohnson/linux-sysadmin-interview-questions/blob/master/test.md 38 | 39 | 40 | ####[[⬆]](#toc) General Questions: 41 | 42 | ##### What function does DNS play on a network? 43 | 44 | DNS, or Domain Name System, associates domain names to entities in the system. The widest used example is translating domain names to IP addresses, in order to locate devices. For example, when asked what www.exmaple.org is, DNS will respond with 93.184.216.119, the IP of that domain. 45 | 46 | Further Reading: [https://en.wikipedia.org/wiki/Dns](https://en.wikipedia.org/wiki/Dns) 47 | 48 | ##### What is HTTP? 49 | 50 | HTTP, or Hypertext Transfer Protocol, is "an application protocol for distributed, collaborative, hypermedia information systems (Wikipedia)", and is the foundation of the World Wide Web (distinct from the Internet as a whole). In the context of System Administration, HTTP is related to the applications or services that handle that protocol, most notably web servers like Apache or Nginx (among others). 51 | 52 | Further Reading: [https://en.wikipedia.org/wiki/Http](https://en.wikipedia.org/wiki/Http) 53 | 54 | ##### What is an HTTP proxy and how does it work? 55 | 56 | There are two types of proxies that are likely to be considered an HTTP Proxy - forward proxy and reverse proxy. 57 | 58 | A forward proxy takes HTTP requests (web traffic) from a host on an internal network, and forwards them out to the internet. This can be done for various reasons, such as providing web access to hosts that don't have a direct route out, or for monitoring the traffic of the users on the network, or more. 59 | 60 | A reverse proxy takes HTTP requests coming in from the internet and delivers them to a web server inside the network. Some reasons for using a reverse proxy are to protect the webserver from the internet in general, to allow multiple webservers to serve content for one domain, to cache static content or compress the content being served by the webserver, etc. 61 | 62 | Further Reading: [https://en.wikipedia.org/wiki/Proxy_server](https://en.wikipedia.org/wiki/Proxy_server) 63 | 64 | ##### What is SMTP? Give the basic scenario of how a mail message is delivered via SMTP! 65 | ##### What is RAID? What is RAID0, RAID1, RAID5, RAID10? 66 | ##### What is a level 0 backup? What is an incremental backup? 67 | ##### Describe the general file system hierarchy of a Linux system. 68 | 69 | 70 | ####[[⬆]](#toc) Simple Linux Questions: 71 | 72 | #####What is the name and the UID of the administrator user? 73 | 74 | The administrator on Linux systems is called "root". Root's UID is 0. 75 | 76 | #####How to list all files, including hidden one, in a directory? 77 | 78 | The `ls` command lists files. To list all files, including hidden one ("dotfiles" - or those that start with a "."), you use the `-a` flag: 79 | 80 | `ls -a ` 81 | 82 | #####What is the Unix/Linux command to remove a directory and its contents? 83 | 84 | The `rmdir` command removes EMPTY directories: 85 | 86 | `rmdir ` 87 | 88 | The `rm` command can be used with the `-r` flag to remove a directory AND it's contents: 89 | 90 | `rm -r ` 91 | 92 | #####Which command will show you free/used memory? Does free memory exist on Linux? 93 | 94 | The `free` command will show you the free/used memory on a system, with output like: 95 | 96 | total used free shared buffers cached 97 | Mem: 8128884 7171252 957632 14096 108 4010944 98 | -/+ buffers/cache: 3160200 4968684 99 | Swap: 3906556 51644 3854912 100 | 101 | The second line (Mem:) lists the memory usage. "total" refers to the whole amount of RAM installed in the system. "free" is the amount of RAM not being used for anything. 102 | 103 | Linux can borrow a large amount of free memory to use for buffering and disk caching. This is done to speed up the system in general, but does NOT mean the system is low on free memory. If more memory is needed for the processes on the system, they just use the memory allocated to disk cache. 104 | 105 | Further Reading: [http://www.linuxatemyram.com/](http://www.linuxatemyram.com/) 106 | 107 | ##### How to search for the string "my konfi is the best" in files of a directory recursively? 108 | ##### How to connect to a remote server or what is SSH? 109 | ##### How to get all environment variables and how can you use them? 110 | ##### I get "command not found" for ```ifconfig -a```. What can be wrong? 111 | ##### What happens if I type TAB-TAB? 112 | ##### What command will show the available disk space on the Unix/Linux system? 113 | ##### What command is used to lookup DNS records? 114 | ##### What Unix/Linux commands will alter a files ownership, files permissions? 115 | ##### What does ```chmod +x FILENAME```do? 116 | ##### What does the permission 0750 on a file mean? 117 | ##### What does the permission 0750 on a directory mean? 118 | ##### How to add a new system user without login permissions? 119 | ##### How to add/remove a group from a user? 120 | ##### What is a bash alias? 121 | ##### How do you set the mail address of the root/a user? 122 | ##### What does CTRL-c do? 123 | ##### What is in /etc/services? 124 | ##### How to redirect STDOUT and STDERR in bash? (> /dev/null 2>&1) 125 | ##### What is the difference between UNIX and Linux 126 | ##### What is the difference between Telnet and SSH? 127 | 128 | 129 | ####[[⬆]](#toc) Medium Linux Questions: 130 | 131 | ##### What do the following commands do? 132 | * ```tee``` 133 | * ```awk``` 134 | * ```tr``` 135 | * ```cut``` 136 | * ```tac``` 137 | * ```curl``` 138 | * ```wget``` 139 | * ```watch``` 140 | * ```tail``` 141 | ##### What does a ```&``` after a command do? 142 | ##### What does ```& disown``` after a command do? 143 | ##### What is a packet filter and how does it work? 144 | ##### What is swap and what is it used for? 145 | ##### What is an A record, an NS record, a PTR record, a CNAME record, an MX record? 146 | * Are there any other RRs and what are they used for? 147 | ##### What is the sticky bit? 148 | ##### What is the difference between hardlinks and symlinks? What happens when you remove the source to a symlink/hardlink? 149 | ##### What is an inode and what fields are stored in an inode? 150 | ##### Howto force/trigger a file system check on next reboot? 151 | ##### What is SNMP and what is it used for? 152 | ##### What is a runlevel and how to get the current runlevel? 153 | ##### What is SSH port forwarding? 154 | ##### What is the difference between local and remote port forwarding? 155 | ##### What steps to add a user to a system without using useradd/adduser? 156 | ##### What is MAJOR and MINOR numbers of special files? 157 | ##### Describe a scenario when you get a "filesystem is full" error, but 'df' shows there is free space. 158 | ##### Describe a scenario when deleting a file, but 'df' not showing the space being freed. 159 | ##### Describe how 'ps' works. 160 | ##### What happens to a child process that dies and has no parent process to wait for it and what’s bad about this? 161 | ##### How to know which process listens on a specific port? 162 | 163 | 164 | ####[[⬆]](#toc) Hard Linux Questions: 165 | 166 | ##### What is the difference between processes and threads? 167 | ##### What is a tunnel and how you can bypass a http proxy? 168 | ##### What is the difference between IDS and IPS? 169 | ##### What shortcuts do you use on a regular basis? 170 | ##### What is the Linux Standard Base? 171 | ##### What is an atomic operation? 172 | ##### Your freshly configured http server is not running after a restart, what can you do? 173 | ##### What kind of keys are in ~/.ssh/authorized_keys and what it is this file used for? 174 | ##### I've added my public ssh key into authorized_keys but I'm still getting a password prompt, what can be wrong? 175 | ##### Did you ever create RPM's, DEB's or solaris pkg's? 176 | ##### What does ```:(){ :|:& };:``` do on your system and why you would care about that? 177 | ##### How trace system call and signal? 178 | ##### What's happening when the Linux kernel is starting the OOM killer, how does it choose which process to kill first. 179 | ##### 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. 180 | ##### What's a chroot jail? 181 | ##### When trying to umount a directory it says it's busy, how to find out which PID holds the directory? 182 | 183 | 184 | ####[[⬆]](#toc) Expert Linux Questions: 185 | 186 | ##### A running process gets ```EAGAIN: Resource temporarily unavailable``` on reading a socket. How you can close this bad socket/file descriptor without killing the process? 187 | 188 | 189 | ####[[⬆]](#toc) Networking Questions: 190 | 191 | ##### What is localhost and why would ```ping localhost``` fail? 192 | ##### What command is used to show all open ports and/or socket connections on a machine? 193 | ##### Is 300.168.0.123 a valid IPv4 address? 194 | ##### Which IP ranges/subnets are "private" or "non-routable" (RFC 1918)? 195 | ##### What is a VLAN? 196 | ##### What is ARP and what is it used for? 197 | ##### What is the difference between TCP and UDP? 198 | ##### What is the purpose of a default gateway? 199 | ##### What command is used to show the route table for a machine? 200 | ##### A TCP connection on a network can be uniquely defined by 4 things. What are those things? 201 | ##### 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? 202 | ##### How do you add an IPv6 address to a specific interface? 203 | ##### 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? 204 | 205 | 206 | ####[[⬆]](#toc) DevOp Questions: 207 | 208 | ##### Can you describe your workflow when you create a script? 209 | ##### What is GIT? 210 | ##### What is a dynamically/statically linked file? 211 | ##### What does "configure && make && make install"? 212 | ##### What is puppet/chef/ansible used for? 213 | ##### How do you create a new mysql user? 214 | ##### How do you create a new postgres user? 215 | ##### What is a virtual IP address? What is a cluster? 216 | ##### How print the strings of printable characters in files? 217 | ##### How look shared library dependencies? 218 | ##### What is Automake and Autoconf? 219 | ##### ./configure shows an error that libfoobar is missing on your system, how could you fix this, what could be wrong? 220 | ##### Advantages/disadvantages of script vs compiled program. 221 | ##### What is the difference between fork and thread? And parent and child process in fork system call? 222 | 223 | 224 | ####[[⬆]](#toc) Fun Questions: 225 | 226 | ##### A careless sysadmin executes the following command: ```chmod 444 /bin/chmod ``` - what do you do to fix this? 227 | ##### I've lost my root password, what can I do? 228 | ##### I've rebooted a remote server but after 10 minutes I'm still not able to ssh into it, what can be wrong? 229 | ##### If you were stuck on a desert island with only 5 command-line utilities, which would you choose? 230 | 231 | 232 | ####[[⬆]](#toc) Demo Time: 233 | 234 | ##### Unpack test.tar.gz without man pages or google. 235 | ##### Remove all "*.pyc" files from testdir recursively? 236 | ##### Search for "my konfu is the best" in all *.py files. 237 | ##### Replace the occurrence of "my konfu is the best" with "I'm a linux jedi master" in all *.txt files. 238 | ##### :interrobang: more on files ... cut, tr, awk ... 239 | ##### Test if port 443 on a machine with IP address X.X.X.X is reachable. 240 | ##### Get http://myinternal.webserver.local/test.html via telnet. 241 | ##### How to send an email without a mail client, just on the command line? 242 | ##### Write a ```get_prim``` method in python/perl/bash/pseudo. 243 | ##### Find all files which have been accessed within the last 30 days. 244 | ##### Explain the following command ```(date ; ps -ef | awk ‘{print $1}’ | sort | uniq | wc -l ) >> Activity.log``` 245 | ##### Write a script to list all the differences between two directories. 246 | ##### Write a program in any language you choose, to reverse a file. 247 | 248 | 249 | ####[[⬆]](#toc) Other Great References: 250 | 251 | Some questions are 'borrowed' from other great references like: 252 | 253 | * https://github.com/darcyclarke/Front-end-Developer-Interview-Questions 254 | * https://github.com/kylejohnson/linux-sysadmin-interview-questions/blob/master/test.md 255 | * https://github.com/gurmeet1109/docgurmeet/tree/master/InterviewQuestionsSamples 256 | * http://slideshare.net/kavyasri790693/linux-admin-interview-questions 257 | --------------------------------------------------------------------------------