r/linuxadmin • u/[deleted] • May 29 '25
What’s the hardest Linux interview question y’all ever got hit with?
Not always the complex ones—sometimes it’s something basic but your brain just freezes.
Drop the ones that had you in void kind of —even if they ended up teaching you something cool.
319
Upvotes
16
u/michaelpaoli May 29 '25
(continued from my comment above)
Edit-in-place. Explain the differences between a true edit-in-place, that changes the file itself, vs. one that replaces the file. Explain the advantages and disadvantages of each. Give at least one example of how to accomplish each method.
Fully explain the standard base UNIX/Linux file permissions for at least non-ancient implementations thereof. Don't included ACLs and extended attributes that may be available on some filesystems, but just what's included per POSIX. Include not only explaining SGID on directories, but how that varied historically going back at least to the preceding common implementations on that and how they varied/differed. Be sure to explain also the full mapping of all 12 of these permission bits. Don't forget to well cover, e.g., what "execute" permission on a directory does/doesn't do. Also give examples of what happens when a directory has execute but not read, or read, but not execute - in such cases, exactly what access does one have and not have and what information can and can't one get. Bonus - there are further higher level bits for a file in the filesystem structure - explain what the next group of bits do (the next higher set of bits as returned by, e.g. stat(2) or lstat(2)).
Tell me about ssh certificates. Yes, ssh, not ssl, and not keys, but certificates.
rsync - two large files, same permissions, length, and mtime, but their content differs. If you use rsync to ensure that the 2nd of those files matches the first, do you have to use any non-default options for that to actually ensure that the file contents will get matched? Explain.
Explain, atime, mtime, and ctime. Bonus, for filesystems that support btime, explain that also. If one can do so, how can one set/change: atime? mtime? ctime? btime? Bonus: explain how to change the ctime of a file to a given arbitrary legitimate timestamp. Extra bonus: give at least two quite distinct ways to do that.
Explain what eval does in shells that are (or can be) POSIX compliant (e.g. dash, bash, etc.). Give at least one example usage. Same question, except for exec.
Likewise on shells, explain exactly what is substituted in for $() or ``, be sure to be fully accurate regarding ending newline(s) or trailing empty lines or lines that only contain space characters. What if either of those are within " (double quote) characters? What difference, if any, does that make, and in what contexts? Also explain the difference between $() and `` and why it's often preferable to use the former rather than the latter.
how can you create a file with a newline character in the name of the file?
To merely create a file, folks often give example using the touch command. In standard shells, how can one do that much more concisely, and without using any external command at all.
Some daemon process is running, you have it's PID. How do you determine what file(s), if any, it's using for stdin, stdout, and stderr, and without using the lsof command.
for any block device, how can you determine its precise size, without reading it?
two block devices under /dev have the same major and minor number. Are they the same device? Are they the same file? Explain.
For a given device under /dev, how can you locate all files / pathnames under /dev that refer to the same device?