Giter Club home page Giter Club logo

linux-sysadmin-interview-questions's Introduction

Linux System Administrator/DevOps Interview Questions

A collection of linux sysadmin/devops interview questions. Feel free to contribute via pull requests, issues or email messages.

  1. Contributors
  2. General Questions
  3. Simple Linux Questions
  4. Medium Linux Questions
  5. Hard Linux Questions
  6. Expert Linux Questions
  7. Networking Questions
  8. MySQL Questions
  9. DevOps Questions
  10. Fun Questions
  11. Demo Time
  12. Other Great References
  • 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.
  • Which difference have between public and private SSH key?
  • 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 konfu 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 does CTRL-d do?
  • What does CTRL-z 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.
  • What is ICMP protocol? Why do you need to use?
  • What do the following commands do and how would you use them?
  • tee
  • awk
  • tr
  • cut
  • tac
  • curl
  • wget
  • watch
  • head
  • tail
  • less
  • cat
  • touch
  • sar
  • netstat
  • tcpdump
  • lsof
  • 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?
  • 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?
  • 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?
  • What do you control with swapiness?
  • How do you change TCP stack buffers? How do you calculate it?
  • What is Huge Tables? Why isn't it enabled by default? Why and when use it?
  • What is LUKS? How to use it?
  • 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)?
  • What will happen when you bind port 0?
  • 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?
  • 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?
  • 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?
  • 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 |tail -n +2 | 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.

Some questions are 'borrowed' from other great references like:

linux-sysadmin-interview-questions's People

Contributors

alekseyspiridonov avatar alfonso-cabrera avatar aplufr avatar bharatnc avatar biyanisuraj avatar bmaca avatar borgified avatar chassing avatar cure avatar dmitriylyalyuev avatar draskolnikova avatar gfrntz avatar gmandrade avatar grundic avatar hroncok avatar ioloev avatar jivoi avatar knetic avatar pedroguima avatar quatrix avatar rabdill avatar radarhere avatar schumar avatar serverhorror avatar spacial avatar syndbg avatar torchhound avatar typhonius avatar wincus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linux-sysadmin-interview-questions's Issues

Add another network question debugging an issue

You have just provisioned a brand new server and you would like to login to it, via SSH or RDP.
Both are currently failing with a timeout. How do you go about figuring out what is wrong and how would you go about fixing it?

Issue running code on linux server remotely

I am doing ssh to my university sever in order to run my code which makes use of large dataset, however when i run my code i am getting bellow error after feature extraction in the code, Can someone please help as i am doing my final year project and should rectify this within 2 days

2021-07-10 09:35:48.234847: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublasLt.so.11
2021-07-10 09:35:48.238831: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.8
2021-07-10 09:35:49.584522: W tensorflow/core/framework/op_kernel.cc:1763] OP_REQUIRES failed at conv_ops_fused_impl.h:697 : Not found: No algorithm worked!
Traceback (most recent call last):
File "copy_of_copy_of_copy_of_untitled9.py", line 157, in
train_validate_features = extract_features(image_dataset_path, train_validate_images)
File "copy_of_copy_of_copy_of_untitled9.py", line 143, in extract_features
feature = model.predict(image, verbose=0)
File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/keras/engine/training.py", line 1629, in predict
tmp_batch_outputs = self.predict_function(iterator)
File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/def_function.py", line 828, in call
result = self._call(*args, **kwds)
File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/def_function.py", line 894, in _call
return self._concrete_stateful_fn._call_flat(
File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/function.py", line 1918, in _call_flat
return self._build_call_outputs(self._inference_function.call(
File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/function.py", line 555, in call
outputs = execute.execute(
File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/execute.py", line 59, in quick_execute
tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.NotFoundError: No algorithm worked!
[[node model/block1_conv1/Relu (defined at copy_of_copy_of_copy_of_untitled9.py:143) ]] [Op:__inference_predict_function_610]

Function call stack:
predict_function

New Questions

First off, thank you for putting this together! I've had a couple interviews recently and used this to prep for it. In going through the interview process as well as a certification course I've been taking I came up with some additional questions I thought you may like to add.

  • Can you explain to me the difference between block based, and object based storage?
  • 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
  • How would you enable network file sharing within AWS that would allow EC2 instances in multiple availability zones to share data?
  • How would you take a backup of a MySQL database?

Thanks again!

How about a networking question with tcpdump output ...

Here's one:

Can you describe what has most likely happened in the
following (abbreviated) network conversation? Is this behaviour likely to be caused
by the server configuration, or a network firewall? Why?

14:54:52.437735 IP client.42458 > server.21: Flags [S], seq 1684654810, win 14600, options [mss 1460,sackOK,TS val 145488717 ecr 0,nop,wscale 7], length 0
14:54:52.437768 IP server.21 > client.42458: Flags [S.], seq 4232260733, ack 1684654811, win 14480, options [mss 1460,sackOK,TS val 280783227 ecr 145488717,nop,wscale 7], length 0
14:54:52.438533 IP client.42458 > server.21: Flags [.], ack 1, win 115, options [nop,nop,TS val 145488717 ecr 280783227], length 0
14:54:57.440473 IP server.21 > client.42458: Flags [F.], seq 1, ack 1, win 114, options [nop,nop,TS val 280784478 ecr 145488717], length 0
14:54:57.441246 IP client.42458 > server.21: Flags [F.], seq 1, ack 2, win 115, options [nop,nop,TS val 145489968 ecr 280784478], length 0
14:54:57.441264 IP server.21 > client.42458: Flags [.], ack 2, win 114, options [nop,nop,TS val 280784478 ecr 145489968], length 0

answer: it's highly unlikely a network firewall did this, as it contains a FIN/ACK close sequence and the typical behaviour is to simply drop the packet. It is most likely this is caused by tcpwrappers on the target host (/etc/hosts.allow /etc/hosts.deny)

Tarpipe

Something that comes up for us occasionally: what is a tarpipe (or, how would you go about copying everything, including hardlinks and special files, from one server to another)?

Maybe under "medium" Linux questions if you decide to include it. It doesn't seem to be common knowledge among a lot of sysadmins (but arguably should be).

another networking question

All of a sudden your ssh sessions to a super important server you work
on are getting blown away, forcing you to login again several times an
hour. The network people say there's nothing wrong on their side!
Using tcpdump to view your session, you see the following output
(trimmed) from the client side of the connection. On the server side,
you see only up to the second to last packet. Do you notice anything
strange? What do you think might have caused this and why?

10:33:13.059502 server.22 > client.1284: P 2395903577:2395903653(76) ack 8368201 win 16080 (DF) [tos 0x10]  (ttl 46, id 18387)
10:33:13.061540 client.1284 > server.22: P 8368201:8368245(44) ack 2395903653 win 8332 [tos 0x15]  (ttl 128, id 62508)
10:33:13.202638 server.22 > client.1284: . 2395903653:2395903653(0) ack 8368245 win 16080 (DF) [tos 0x10]  (ttl 46, id 18388)
10:33:19.846570 client.1284 > server.22: P 8368245:8368289(44) ack 2395903653 win 8332 [tos 0x15] (ttl 128, id 63020)
10:33:19.873279 server.22 > client.1284: R 2395903653:2395903697(44) ack 8368245 win 8332 [tos 0x15]  (ttl 120, id 63020)

answer: the last packet is clearly forged, and not very well. It is
some network device which is flagging the second to last packet with a
reset and sending it back to you. Notice the packet id and ttl of the
two last packets sent by the server - it is the same packet as the one the client sent in the line above it. The ttl's of the "real" server are also completely different. (I actually have seen this.) BONUS: how many hops away from the client is this mysterious network device?

Duplicate questions

Medium Linux Questions:

  • What is the difference between a process and a thread?

Hard Linux Questions:

  • What is the difference between processes and threads?

MySQL questions:

  • How do you create a user?

DevOps Questions:

  • How do you create a new mysql user?

answer key

This is a good list of questions. Are there plans to add an answer key (and if so are you accepting pull requests for the same), or is the idea to fork this and provide your own answers?

Suggestions for questions

  • Name as many ways as you can to count the number of instances of a word in a file (grep -c, wc -l, etc)
  • In what circumstance can df and du disagree on available disk space? How do you solve it? (locked files)
  • What is the difference between hashing and encrypting?
  • In as much detail as you can, explain a 3 way handshake (how deep can they go?)
  • When would you want to use UDP over TCP?
  • What is LVM?
  • What is /proc/mdstat?

Typo or more esoteric comp sci question?

"Write a get_prim method in python/perl/bash/pseudo."

Is this asking for a method to find a minimum spanning tree in a weighted undirected graph (an implementation of Prim's Algorithm), or was there a typo and what you really meant to ask for was an algorithm for finding prime numbers ('get_primes' perhaps)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.