├── 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 collection of linux sysadmin/devop 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. [DevOp Questions](#devop) 17 | 1. [Fun Questions](#fun) 18 | 1. [Demo Time](#demo) 19 | 1. [Other Great References](#references) 20 | 21 | 22 | ####[[⬆]](#toc) Contributors: 23 | 24 | * [moregeek](https://github.com/moregeek) 25 | * [typhonius](https://github.com/typhonius) 26 | * martin 27 | * [negesti](https://github.com/negesti) 28 | * peter 29 | * [andreashappe](https://github.com/andreashappe) 30 | * [quatrix](https://github.com/quatrix) 31 | * [biyanisuraj](https://github.com/biyanisuraj) 32 | 33 | The majority of the questions were collected from: 34 | 35 | * https://github.com/gurmeet1109/docgurmeet/tree/master/InterviewQuestionsSamples 36 | * https://github.com/kylejohnson/linux-sysadmin-interview-questions/blob/master/test.md 37 | 38 | 39 | ####[[⬆]](#toc) General Questions: 40 | 41 | * What did you learn yesterday/this week? 42 | * Talk about your preferred development/administration environment. (OS, Editor, Browsers, Tools etc.) 43 | * Tell me about the last major Linux project you finished. 44 | * 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? 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 | * 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" for ```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 command is used to lookup 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 | ####[[⬆]](#toc) Medium Linux Questions: 84 | 85 | * What do the following commands do? 86 | * ```tee``` 87 | * ```awk``` 88 | * ```tr``` 89 | * ```cut``` 90 | * ```tac``` 91 | * ```curl``` 92 | * ```wget``` 93 | * ```watch``` 94 | * ```tail``` 95 | * What does a ```&``` after a command do? 96 | * What does ```& disown``` after a command do? 97 | * What is a packet filter and how does it work? 98 | * What is swap and what is it used for? 99 | * What is an A record, an NS record, a PTR record, a CNAME record, an MX record? 100 | * Are there any other RRs and what are they used for? 101 | * What is the sticky bit? 102 | * What is the difference between hardlinks and symlinks? What happens when you remove the source to a symlink/hardlink? 103 | * What is an inode and what fields are stored in an inode? 104 | * Howto force/trigger a file system check on next reboot? 105 | * What is SNMP and what is it used for? 106 | * What is a runlevel and how to get the current runlevel? 107 | * What is SSH port forwarding? 108 | * What is the difference between local and remote port forwarding? 109 | * What steps to add a user to a system without using useradd/adduser? 110 | * What is MAJOR and MINOR numbers of special files? 111 | * Describe a scenario when you get a "filesystem is full" error, but 'df' shows there is free space. 112 | * Describe a scenario when deleting a file, but 'df' not showing the space being freed. 113 | * Describe how 'ps' works. 114 | * What happens to a child process that dies and has no parent process to wait for it and what’s bad about this? 115 | * How to know which process listens on a specific port? 116 | 117 | 118 | ####[[⬆]](#toc) Hard Linux Questions: 119 | 120 | * What is the difference between processes and threads? 121 | * What is a tunnel and how you can bypass a http proxy? 122 | * What is the difference between IDS and IPS? 123 | * What shortcuts do you use on a regular basis? 124 | * What is the Linux Standard Base? 125 | * What is an atomic operation? 126 | * Your freshly configured http server is not running after a restart, what can you do? 127 | * What kind of keys are in ~/.ssh/authorized_keys and what it is this file used for? 128 | * I've added my public ssh key into authorized_keys but I'm still getting a password prompt, what can be wrong? 129 | * Did you ever create RPM's, DEB's or solaris pkg's? 130 | * What does ```:(){ :|:& };:``` do on your system and why you would care about that? 131 | * How trace system call and signal? 132 | * What's happening when the Linux kernel is starting the OOM killer, how does it choose which process to kill first. 133 | * 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. 134 | * What's a chroot jail? 135 | * When trying to umount a directory it says it's busy, how to find out which PID holds the directory? 136 | * What's LD_PRELOAD and when it's used? 137 | * You run a binary and nothing happens, how do you debug what's doing? 138 | 139 | 140 | ####[[⬆]](#toc) Expert Linux Questions: 141 | 142 | * 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? 143 | 144 | 145 | ####[[⬆]](#toc) Networking Questions: 146 | 147 | * What is localhost and why would ```ping localhost``` fail? 148 | * What is the similarity between "ping" & "traceroute" ? How is traceroute able to find the hops. 149 | * What command is used to show all open ports and/or socket connections on a machine? 150 | * Is 300.168.0.123 a valid IPv4 address? 151 | * Which IP ranges/subnets are "private" or "non-routable" (RFC 1918)? 152 | * What is a VLAN? 153 | * What is ARP and what is it used for? 154 | * What is the difference between TCP and UDP? 155 | * What is the purpose of a default gateway? 156 | * What command is used to show the route table for a machine? 157 | * A TCP connection on a network can be uniquely defined by 4 things. What are those things? 158 | * 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? 159 | * How do you add an IPv6 address to a specific interface? 160 | * 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? 161 | 162 | 163 | ####[[⬆]](#toc) DevOp Questions: 164 | 165 | * Can you describe your workflow when you create a script? 166 | * What is GIT? 167 | * What is a dynamically/statically linked file? 168 | * What does "configure && make && make install"? 169 | * What is puppet/chef/ansible used for? 170 | * How do you create a new mysql user? 171 | * How do you create a new postgres user? 172 | * What is a virtual IP address? What is a cluster? 173 | * How print the strings of printable characters in files? 174 | * How look shared library dependencies? 175 | * What is Automake and Autoconf? 176 | * ./configure shows an error that libfoobar is missing on your system, how could you fix this, what could be wrong? 177 | * Advantages/disadvantages of script vs compiled program. 178 | * What is the difference between fork and thread? And parent and child process in fork system call? 179 | * What's the relationship between continuous delivery and DevOps? 180 | * What are the important aspects of a system of continous integration and deployment? 181 | 182 | 183 | ####[[⬆]](#toc) Fun Questions: 184 | 185 | * A careless sysadmin executes the following command: ```chmod 444 /bin/chmod ``` - what do you do to fix this? 186 | * I've lost my root password, what can I do? 187 | * I've rebooted a remote server but after 10 minutes I'm still not able to ssh into it, what can be wrong? 188 | * If you were stuck on a desert island with only 5 command-line utilities, which would you choose? 189 | * You come across a random computer and it appears to be a command console for the universe. What is the first thing you type? 190 | * Tell me about a creative way that you've used SSH? 191 | 192 | 193 | ####[[⬆]](#toc) Demo Time: 194 | 195 | * Unpack test.tar.gz without man pages or google. 196 | * Remove all "*.pyc" files from testdir recursively? 197 | * Search for "my konfu is the best" in all *.py files. 198 | * Replace the occurrence of "my konfu is the best" with "I'm a linux jedi master" in all *.txt files. 199 | * :interrobang: more on files ... cut, tr, awk ... 200 | * Test if port 443 on a machine with IP address X.X.X.X is reachable. 201 | * Get http://myinternal.webserver.local/test.html via telnet. 202 | * How to send an email without a mail client, just on the command line? 203 | * Write a ```get_prim``` method in python/perl/bash/pseudo. 204 | * Find all files which have been accessed within the last 30 days. 205 | * Explain the following command ```(date ; ps -ef | awk ‘{print $1}’ | sort | uniq | wc -l ) >> Activity.log``` 206 | * Write a script to list all the differences between two directories. 207 | * Write a program in any language you choose, to reverse a file. 208 | * In a log file with contents as ```