Skip to content

Instantly share code, notes, and snippets.

@ramlaxman
Last active February 3, 2023 08:08
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save ramlaxman/9fbb9b460f914e95487fb1f0aa0af17c to your computer and use it in GitHub Desktop.
Save ramlaxman/9fbb9b460f914e95487fb1f0aa0af17c to your computer and use it in GitHub Desktop.
General Questions:
What function does DNS play on a network?
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.
Further Reading: https://en.wikipedia.org/wiki/Dns
What is HTTP?
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).
Further Reading: https://en.wikipedia.org/wiki/Http
What is an HTTP proxy and how does it work?
There are two types of proxies that are likely to be considered an HTTP Proxy - forward proxy and reverse proxy.
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.
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.
Further Reading: https://en.wikipedia.org/wiki/Proxy_server
What is SMTP? Give the basic scenario of how a mail message is delivered via SMTP!
What is RAID? What is RAID0, RAID1, RAID5, RAID10?
What is a level 0 backup? What is an incremental backup?
Describe the general file system hierarchy of a Linux system.
####[⬆] Simple Linux Questions:
#####What is the name and the UID of the administrator user?
The administrator on Linux systems is called "root". Root's UID is 0.
#####How to list all files, including hidden one, in a directory?
The ls command lists files. To list all files, including hidden one ("dotfiles" - or those that start with a "."), you use the -a flag:
ls -a <directory>
#####What is the Unix/Linux command to remove a directory and its contents?
The rmdir command removes EMPTY directories:
rmdir <directory>
The rm command can be used with the -r flag to remove a directory AND it's contents:
`rm -r <directory>`
#####Which command will show you free/used memory? Does free memory exist on Linux?
The free command will show you the free/used memory on a system, with output like:
total used free shared buffers cached
Mem: 8128884 7171252 957632 14096 108 4010944
-/+ buffers/cache: 3160200 4968684
Swap: 3906556 51644 3854912
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.
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.
Further Reading: http://www.linuxatemyram.com/
How to search for the string "my konfi is the best" in files of a directory recursively?
How to connect to a remote server or what is SSH?
How to get all environment variables and how can you use them?
I get "command not found" for ifconfig -a. What can be wrong?
What happens if I type TAB-TAB?
What command will show the available disk space on the Unix/Linux system?
What command is used to lookup DNS records?
What Unix/Linux commands will alter a files ownership, files permissions?
What does chmod +x FILENAMEdo?
What does the permission 0750 on a file mean?
What does the permission 0750 on a directory mean?
How to add a new system user without login permissions?
How to add/remove a group from a user?
What is a bash alias?
How do you set the mail address of the root/a user?
What does CTRL-c do?
What is in /etc/services?
How to redirect STDOUT and STDERR in bash? (> /dev/null 2>&1)
What is the difference between UNIX and Linux
What is the difference between Telnet and SSH?
####[⬆] Medium Linux Questions:
What do the following commands do?
tee
awk
tr
cut
tac
curl
wget
watch
tail
What does a & after a command do?
What does & disown after a command do?
What is a packet filter and how does it work?
What is swap and what is it used for?
What is an A record, an NS record, a PTR record, a CNAME record, an MX record?
Are there any other RRs and what are they used for?
What is the sticky bit?
What is the difference between hardlinks and symlinks? What happens when you remove the source to a symlink/hardlink?
What is an inode and what fields are stored in an inode?
Howto force/trigger a file system check on next reboot?
What is SNMP and what is it used for?
What is a runlevel and how to get the current runlevel?
What is SSH port forwarding?
What is the difference between local and remote port forwarding?
What steps to add a user to a system without using useradd/adduser?
What is MAJOR and MINOR numbers of special files?
Describe a scenario when you get a "filesystem is full" error, but 'df' shows there is free space.
Describe a scenario when deleting a file, but 'df' not showing the space being freed.
Describe how 'ps' works.
What happens to a child process that dies and has no parent process to wait for it and what’s bad about this?
How to know which process listens on a specific port?
####[⬆] Hard Linux Questions:
What is the difference between processes and threads?
What is a tunnel and how you can bypass a http proxy?
What is the difference between IDS and IPS?
What shortcuts do you use on a regular basis?
What is the Linux Standard Base?
What is an atomic operation?
Your freshly configured http server is not running after a restart, what can you do?
What kind of keys are in ~/.ssh/authorized_keys and what it is this file used for?
I've added my public ssh key into authorized_keys but I'm still getting a password prompt, what can be wrong?
Did you ever create RPM's, DEB's or solaris pkg's?
What does :(){ :|:& };: do on your system and why you would care about that?
How trace system call and signal?
What's happening when the Linux kernel is starting the OOM killer, how does it choose which process to kill first.
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.
What's a chroot jail?
When trying to umount a directory it says it's busy, how to find out which PID holds the directory?
####[⬆] Expert Linux Questions:
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?
####[⬆] Networking Questions:
What is localhost and why would ping localhost fail?
What command is used to show all open ports and/or socket connections on a machine?
Is 300.168.0.123 a valid IPv4 address?
Which IP ranges/subnets are "private" or "non-routable" (RFC 1918)?
What is a VLAN?
What is ARP and what is it used for?
What is the difference between TCP and UDP?
What is the purpose of a default gateway?
What command is used to show the route table for a machine?
A TCP connection on a network can be uniquely defined by 4 things. What are those things?
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?
How do you add an IPv6 address to a specific interface?
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?
####[⬆] DevOp Questions:
Can you describe your workflow when you create a script?
What is GIT?
What is a dynamically/statically linked file?
What does "configure && make && make install"?
What is puppet/chef/ansible used for?
How do you create a new mysql user?
How do you create a new postgres user?
What is a virtual IP address? What is a cluster?
How print the strings of printable characters in files?
How look shared library dependencies?
What is Automake and Autoconf?
./configure shows an error that libfoobar is missing on your system, how could you fix this, what could be wrong?
Advantages/disadvantages of script vs compiled program.
What is the difference between fork and thread? And parent and child process in fork system call?
####[⬆] Fun Questions:
A careless sysadmin executes the following command: chmod 444 /bin/chmod - what do you do to fix this?
I've lost my root password, what can I do?
I've rebooted a remote server but after 10 minutes I'm still not able to ssh into it, what can be wrong?
If you were stuck on a desert island with only 5 command-line utilities, which would you choose?
####[⬆] Demo Time:
Unpack test.tar.gz without man pages or google.
Remove all "*.pyc" files from testdir recursively?
Search for "my konfu is the best" in all *.py files.
Replace the occurrence of "my konfu is the best" with "I'm a linux jedi master" in all *.txt files.
interrobang more on files ... cut, tr, awk ...
Test if port 443 on a machine with IP address X.X.X.X is reachable.
Get http://myinternal.webserver.local/test.html via telnet.
How to send an email without a mail client, just on the command line?
Write a get_prim method in python/perl/bash/pseudo.
Find all files which have been accessed within the last 30 days.
Explain the following command (date ; ps -ef | awk ‘{print $1}’ | sort | uniq | wc -l ) >> Activity.log
Write a script to list all the differences between two directories.
Write a program in any language you choose, to reverse a file.
General Questions:
• What did you learn yesterday/this week?
• Talk about your preferred development/administration environment. (OS, Editor, Browsers, Tools etc.)
• Tell me about the last major Linux project you finished.
• 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?
• Why we must choose you?
• What function does DNS play on a network?
• What is HTTP?
• What is an HTTP proxy and how does it work?
• Describe briefly how HTTPS works.
• What is SMTP? Give the basic scenario of how a mail message is delivered via SMTP.
• What is RAID? What is RAID0, RAID1, RAID5, RAID10?
• What is a level 0 backup? What is an incremental backup?
• Describe the general file system hierarchy of a Linux system.
[⬆] Simple Linux Questions:
• What is the name and the UID of the administrator user?
• How to list all files, including hidden ones, in a directory?
• What is the Unix/Linux command to remove a directory and its contents?
• Which command will show you free/used memory? Does free memory exist on Linux?
• How to search for the string "my konfi is the best" in files of a directory recursively?
• How to connect to a remote server or what is SSH?
• How to get all environment variables and how can you use them?
• I get "command not found" when I run ifconfig -a. What can be wrong?
• What happens if I type TAB-TAB?
• What command will show the available disk space on the Unix/Linux system?
• What commands do you know that can be used to check DNS records?
• What Unix/Linux commands will alter a files ownership, files permissions?
• What does chmod +x FILENAME do?
• What does the permission 0750 on a file mean?
• What does the permission 0750 on a directory mean?
• How to add a new system user without login permissions?
• How to add/remove a group from a user?
• What is a bash alias?
• How do you set the mail address of the root/a user?
• What does CTRL-c do?
• What is in /etc/services?
• How to redirect STDOUT and STDERR in bash? (> /dev/null 2>&1)
• What is the difference between UNIX and Linux.
• What is the difference between Telnet and SSH?
• Explain the three load averages and what do they indicate. What command can be used to view the load averages?
• Can you name a lower-case letter that is not a valid option for GNU ls?
• What is a Linux kernel module?
• Walk me through the steps in booting into single user mode to troubleshoot a problem.
• Walk me through the steps you'd take to troubleshoot a 404 error on a web application you administer.
[⬆] Medium Linux Questions:
• What do the following commands do and how would you use them?
• tee
• awk
• tr
• cut
• tac
• curl
• wget
• watch
• head
• tail
• What does an & after a command do?
• What does & disown after a command do?
• What is a packet filter and how does it work?
• What is Virtual Memory?
• What is swap and what is it used for?
• What is an A record, an NS record, a PTR record, a CNAME record, an MX record?
• Are there any other RRs and what are they used for?
• What is a Split-Horizon DNS?
• What is the sticky bit?
• What does the immutable bit do to a file?
• What is the difference between hardlinks and symlinks? What happens when you remove the source to a symlink/hardlink?
• What is an inode and what fields are stored in an inode?
• How to force/trigger a file system check on next reboot?
• What is SNMP and what is it used for?
• What is a runlevel and how to get the current runlevel?
• What is SSH port forwarding?
• What is the difference between local and remote port forwarding?
• What are the steps to add a user to a system without using useradd/adduser?
• What is MAJOR and MINOR numbers of special files?
• Describe the mknod command and when you'd use it.
• Describe a scenario when you get a "filesystem is full" error, but 'df' shows there is free space.
• Describe a scenario when deleting a file, but 'df' not showing the space being freed.
• Describe how 'ps' works.
• What happens to a child process that dies and has no parent process to wait for it and what’s bad about this?
• Explain briefly each one of the process states.
• How to know which process listens on a specific port?
• What is a zombie process and what could be the cause of it?
• 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?
• Explain what echo "1" > /proc/sys/net/ipv4/ip_forward does.
• Describe briefly the steps you need to take in order to create and install a valid certificate for the site https://foo.example.com.
• Can you have several HTTPS virtual hosts sharing the same IP?
• What is a wildcard certificate?
• Which Linux file types do you know?
• What is the difference between a process and a thread? And parent and child processes after a fork system call?
• What is the difference between exec and fork?
• What is "nohup" used for?
• What is the difference between these two commands?
• myvar=hello
• export myvar=hello
• How many NTP servers would you configure in your local ntp.conf?
• What does the column 'reach' mean in ntpq -p output?
• You need to upgrade kernel at 100-1000 servers, how you would do this?
• How can you get Host, Channel, ID, LUN of SCSI disk?
• How can you limit process memory usage?
• What is bash quick substitution/caret replace(^x^y)?
• Do you know of any alternative shells? If so, have you used any?
• What is a tarpipe (or, how would you go about copying everything, including hardlinks and special files, from one server to another)?
• How can you tell if the httpd package was already installed?
• How can you list the contents of a package?
• 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 ?
• Can you explain to me the difference between block based, and object based storage?
[⬆] Hard Linux Questions:
• What is a tunnel and how you can bypass a http proxy?
• What is the difference between IDS and IPS?
• What shortcuts do you use on a regular basis?
• What is the Linux Standard Base?
• What is an atomic operation?
• Your freshly configured http server is not running after a restart, what can you do?
• What kind of keys are in ~/.ssh/authorized_keys and what it is this file used for?
• I've added my public ssh key into authorized_keys but I'm still getting a password prompt, what can be wrong?
• Did you ever create RPM's, DEB's or solaris pkg's?
• What does :(){ :|:& };: do on your system?
• How do you catch a Linux signal on a script?
• Can you catch a SIGKILL?
• What's happening when the Linux kernel is starting the OOM killer and how does it choose which process to kill first?
• 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.
• What's a chroot jail?
• When trying to umount a directory it says it's busy, how to find out which PID holds the directory?
• What's LD_PRELOAD and when it's used?
• You ran a binary and nothing happened. How would you debug this?
• What are cgroups? Can you specify a scenario where you could use them?
• How can you remove/delete a file with file-name consisting of only non-printable/non-type-able characters?
• How can you increase or decrease the priority of a process in Linux?
• What are run-levels in Linux?
[⬆] Expert Linux Questions:
• 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?
[⬆] Networking Questions:
Using the OSI model, which layer has the responsibility of making sure that the packet gets where it is supposed to go?
What is the subnet mask, network address and broadcast address for the following address: 123.65.47.62/22?
What command is used to show all open ports and/or socket connections on a machine?
What is NAT? What is it used for?
Which IP ranges/subnets are "private" or "non-routable" (RFC 1918)?
What is a packet filter and how does it work?
What is a proxy and how does it work?
What is ARP and what is it used for?
What is the difference between TCP and UDP?
What command is used to show the route table for a machine?
Explain asynchronous routing?
What is the purpose of a default gateway?
A TCP connection on a network can be uniquely defined by 4 things. What are those things?
When a client running a web browser connects to a web server, what is the source port of the connection?
What is the destination port of the connection?
What is SMTP?
What is an SMTP relay?
Give the basic scenario of how a mail message is delivered via SMTP
What function does DNS play on a network?
What is an A record?
What is an NS record?
What is an MX record?
What is a PTR record?
What is a DNS forwarder?
What command is used to lookup DNS records?
What is meant by "Reverse Lookup"?
What is LDAP and what is it used for?
What is a DN in LDAP?
What is SSH?
What is SSL?
What is IDS?
What is IPS?
What is the difference between IDS and IPS?
What is meant by the term "DOS Attack"?
What is RAID?
What is swap and what is it used for?
What command will show the available disk space on the Unix/Linux system?
How do you determine the public and prive IP addresses, if applicable, of a Unix/Linux system from the command line?
What Unix/Linux command will alter a file's ownership?
What Unix/Linux command will alter a file's permissions?
What Unix/Linux command will show all processes running on a system?
What Unix/Linux command will show the details of a file(permissions, size, timestamp)?
What Unix/Linux command would you use to list all currently loaded kernel modules?
What command would you use to telnet to port 7777 on a machine with IP address 10.10.10.128?
What Unix/Linux command(s) will show a system's current resource allocations?
What is the Unix/Linux command to remove a directory and its contents?
What is the name and location of the system log on a Unix or Linux system?
What would you do to recover a lost the root password to a Unix/Linux system?
What is the difference between hardlink and symlink?
What happens when you remove the source to a symlink?
What are some of the security risks of symlinks?
Explain a hardlink
Where is a filename stored?
What happens when a hardlink is removed
how do you know when a file is removed
Write a locking function in bash
What is a pre-emptive kernel, what does that mean to you?
What is an atomic operation?
How does a switch get a mac address?
What type of packet to discover a router?
How does traceroute work?
A careless sysadmin executes the following command: chmod 444 chmod - what do you do to fix this?
• What is localhost and why would ping localhost fail?
• What is the similarity between "ping" & "traceroute" ? How is traceroute able to find the hops.
• What is the command used to show all open ports and/or socket connections on a machine?
• Is 300.168.0.123 a valid IPv4 address?
• Which IP ranges/subnets are "private" or "non-routable" (RFC 1918)?
• What is a VLAN?
• What is ARP and what is it used for?
• What is the difference between TCP and UDP?
• What is the purpose of a default gateway?
• What is command used to show the routing table on a Linux box?
• A TCP connection on a network can be uniquely defined by 4 things. What are those things?
• 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?
• How do you add an IPv6 address to a specific interface?
• 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?
• What is SNAT and when should it be used?
• Explain how could you ssh login into a Linux system that DROPs all new incoming packets using a SSH tunnel.
• How do you stop a DDoS attack?
• How can you see content of an ip packet?
• What is IPoAC (RFC 1149)?
[⬆] MySQL questions:
• How do you create a user?
• How do you provide privileges to a user?
• What is the difference between a "left" and a "right" join?
• Explain briefly the differences between InnoDB and MyISAM.
• Describe briefly the steps you need to follow in order to create a simple master/slave cluster.
• Why should you run "mysql_secure_installation" after installing MySQL?
• How do you check which jobs are running?
• How would you take a backup of a MySQL database?
[⬆] DevOps Questions:
• Can you describe your workflow when you create a script?
• What is GIT?
• What is a dynamically/statically linked file?
• What does "./configure && make && make install" do?
• What is puppet/chef/ansible used for?
• What is Nagios/Zenoss/NewRelic used for?
• What is Jenkins/TeamCity/GoCI used for?
• What is the difference between Containers and VMs?
• How do you create a new postgres user?
• What is a virtual IP address? What is a cluster?
• How do you print all strings of printable characters present in a file?
• How do you find shared library dependencies?
• What is Automake and Autoconf?
• ./configure shows an error that libfoobar is missing on your system, how could you fix this, what could be wrong?
• What are the advantages/disadvantages of script vs compiled program?
• What's the relationship between continuous delivery and DevOps?
• What are the important aspects of a system of continuous integration and deployment?
• How would you enable network file sharing within AWS that would allow EC2 instances in multiple availability zones to share data?
[⬆] Fun Questions:
• A careless sysadmin executes the following command: chmod 444 /bin/chmod - what do you do to fix this?
• I've lost my root password, what can I do?
• I've rebooted a remote server but after 10 minutes I'm still not able to ssh into it, what can be wrong?
• If you were stuck on a desert island with only 5 command-line utilities, which would you choose?
• You come across a random computer and it appears to be a command console for the universe. What is the first thing you type?
• Tell me about a creative way that you've used SSH?
• You have deleted by error a running script, what could you do to restore it?
• What will happen on 19 January 2038?
• How to reboot server when reboot command is not responding?
Demo Time:
• Unpack test.tar.gz without man pages or google.
• Remove all "*.pyc" files from testdir recursively?
• Search for "my konfu is the best" in all *.py files.
• Replace the occurrence of "my konfu is the best" with "I'm a linux jedi master" in all *.txt files.
• Test if port 443 on a machine with IP address X.X.X.X is reachable.
• Get http://myinternal.webserver.local/test.html via telnet.
• How to send an email without a mail client, just on the command line?
• Write a get_prim method in python/perl/bash/pseudo.
• Find all files which have been accessed within the last 30 days.
• Explain the following command (date ; ps -ef | awk '{print $1}' | sort | uniq | wc -l ) >> Activity.log
• Write a script to list all the differences between two directories.
• In a log file with contents as <TIME> : [MESSAGE] : [ERROR_NO] - Human readable text display summary/count of specific error numbers that occurred every hour or a specific hour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment