Hudson River Trading · CS Fundamentals
Linux Host and Filesystem Fundamentals
TrueInterview
October 7, 2026 · 3 min read
Clarifying Questions to Ask
- Which Linux distribution and shell are we assuming?
- May privileged commands be used, or should the answer work for an unprivileged user?
- Is the environment a local machine, a container, or managed by an orchestration platform?
Part 1: Inspecting Memory and Explaining Swap
How would you check memory usage on a Linux host? Describe what swap is, why it is used, and why a small amount of “free” memory or any swap activity is not by itself proof of trouble. Candidate hint: Keep process memory, reclaimable cache, memory pressure, and past swap placement distinct.
What This Part Should Cover
- Useful commands and fields, not just one unexplained number
- Interpreting available memory, cache, swap, and pressure
- The limits of a single snapshot
Part 2: Current Directory and Listing Without ls
Which command displays the current working directory? Provide at least two safe ways to list the entries in the current directory without ls, including hidden entries when feasible.
Candidate hint: Be explicit about recursion, dotfiles, quoting, and unusual filenames.
What This Part Should Cover
- The meaning of
pwd - Shell expansion or
find-based alternatives, along with their caveats - Filename-safe output when the results are passed to another command
Part 3: Threads and Processes
Compare a Linux process and a thread. Cover address spaces, resources, scheduling, communication, isolation, and what happens on failure. Candidate hint: Do not claim that threads are not scheduled entities; concentrate on what is shared and what is private.
What This Part Should Cover
- Shared state versus isolated state
- Context, communication, synchronization, and fault boundaries
- Practical performance trade-offs without making absolute claims
Part 4: Symbolic and Hard Links
Explain how a symbolic link differs from a hard link. Include inode relationships, filesystem boundaries, directories, what happens when the target name is deleted, and how common tools show them. Candidate hint: Ask which directory entry each link refers to and what keeps the file data alive.
What This Part Should Cover
- Path indirection versus an additional name for the same inode
- Lifetime and broken-link behavior
- Cross-filesystem and directory restrictions
Part 5: Delete a File Named -rf
A regular file in the current directory is literally called -rf. How can you remove exactly that file without it being treated as command options? Explain why the command is safe.
Candidate hint: Either end option parsing or make the operand no longer start with a hyphen.
What This Part Should Cover
- A correctly quoted, exact operand
--or an explicit relative path- Awareness that quoting alone does not turn a leading hyphen into a non-option
Part 6: Recover After an Accidental Recursive Delete
Suppose a recursive removal deleted the contents of the current directory. Is there a general shell command that restores those files? Explain what deletion actually changes, and give a responsible immediate response and recovery order. Candidate hint: Distinguish unlinking names from securely erasing blocks, but do not promise that unallocated data can be recovered.
What This Part Should Cover
- No universal undo, and why continued writes reduce the chance of recovery
- Backups, snapshots, version control, and still-open file descriptors
- Filesystem-specific recovery as a last resort, not a guarantee
What a Strong Answer Covers
- Commands paired with an explanation of what they measure or change
- Safe handling of filenames and destructive operations
- Kernel and filesystem concepts tied to practical troubleshooting
- Appropriate caveats across distributions, filesystems, and runtime environments
Follow-up Questions
- Why can a process be killed by a memory limit even though the host still reports available memory?
- How would you safely pass arbitrary filenames from
findto another command? - Why can an open file keep consuming disk after its pathname has been deleted?
- How do bind mounts differ from symbolic links?
Overview: Review practical Linux fundamentals: interpreting memory and swap, safe directory enumeration, process-versus-thread trade-offs, filesystem links, and option-safe file deletion. Also explain responsible recovery steps after an accidental recursive delete.