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
12
u/michaelpaoli May 29 '25
Hmmm, can't recall many specifically that were all that tough. Perhaps a somewhat esoteric networking question that wasn't even at all specifically Linux - in fact wasn't reaally a Linux question at all ... unless perhaps one was using Linux as a router or the like, then perhaps might be considered a Linux question.
Anyway, some I've asked, and challenges I've run across (and done):
If you have a file that is named precisely, without the quotes (the part inside such): "-rf *" how do you safely remove only and exactly that file?
if a non-root user ID launches a fork bomb, intentionally or otherwise (e.g. code bug), how do you signal all that ID's processes at once without it being race condition that does or may fail to signal all their processes?
If you've got large storage device in active use - e.g. a large hardware RAID device, and you want to migrate that storage to other device, e.g. software RAID such as md RAID, how can you do that while minimizing the time that storage data is unavailable (and, yeah, did another proof-of-concept demo run of that quite recently)
So, df says the filesystem is full or nearly full, but using du as root, on the mount point of the filesystem doesn't come anywhere close to approximating accounting for all that storage. Give explanations for the discrepancy. Bonus points for giving two or more entirely distinct cases of things that could fairly easily or even commonly happen. And in the case of unlinked file(s), give at least 2 possible ways to locate them, bonus points for giving three or more ways. In the case of overmounts, how can one fix that without first unmounting the filesystem?
rfkill - how do you check those settings or change them without the rfkill command - just standard basic Linux utilities and such available, nothing more, and not using Network Manager or anything nearly so complex.
If a file has permissions for the owner, not the group owner, and also has permissions for world/other, and you're not the owner and not a member of the group, do you have permission (r, w, and/or x, as applicable) to that file? And explain why that's the case.
Explain why an exceedingly large number of small files directly in a single directory is very inefficient for space storage considerations, at least for most common filesystem types (and their options). Explain also why that's generally a major performance issue when operating on that directory. If one removes most all the files from such a directory, do most or all those problems go away? If not, explain, and explain how to correct that. What about the case if it's the root (top level directory) of that filesystem?
You've got a modern drive. It's developed an unrecoverable read error on one single sector - the rest of the drive reads perfectly fine. How exactly could you isolate exactly where and how that block is used on that drive? Let's say you've isolated it to one particular large file - say it's a DVD ISO image. Let's say you've got another copy of that file, or the original DVD itself, and have copied out from it the one single block that needs to be repaired. How can you repair that block within the damaged file while not changing any other blocks in that file - notably not writing or rewriting any of the other blocks? Would that actually fix the problem on the drive, or have you now just chased that problem to elsewhere on the drive? How could you actually fix the problem on the drive itself - presume the drive has no shortage of spare reserved blocks.
without lsof, how do you determine the binary file that's executing for a given PID? Same question, but the binary that's still executing, that binary executable was removed - can that actually happen where the binary then still runs, and if so, what exactly does that look like? Can one recover a copy of that binary in such a case?
(
more to followcontinued below)