Confluent · CS Fundamentals
Explain Linux Command Execution, Filesystems, and Isolation
TrueInterview
October 7, 2026 · 2 min read
Explain Linux Command Execution, Filesystems, and Isolation
Examine the OS-level machinery that underlies typical Linux commands and isolation decisions. Stay specific: point out user-space activity, syscalls, kernel data structures, permission checks, and error routes rather than treating each command as an opaque unit.
Clarifying Questions to Ask
- What shell and executable lookup conventions are we taking as given?
- Is the scope Linux-only, or should we cover portable Unix semantics as well?
- Do namespaces and cgroups fall within the container discussion?
- To what depth should we explore packet routing and device driver internals?
Part 1: From Shell Input to a Running Command
Describe the sequence that follows when a user types an external command. Compare that flow with a shell builtin like cd. Then give a high-level account of how ls, pwd, ip, and older interface-inspection utilities gather their output.
What This Part Should Cover
- Tokenizing, expansion, path resolution, process spawning,
exec, waiting, and exit codes - The reason a child process cannot alter its parent shell's current directory
- Syscalls for listing directory contents and reading metadata
- How the working directory is tracked and how the kernel exposes network interfaces
Part 2: Files, Directories, Permissions, and procfs
Describe how a process opens a pathname, how directories are distinct from ordinary files, how user and group permission tests are enforced, what the main top-level filesystem regions stand for, and why /proc is not a typical on-disk directory.
What This Part Should Cover
- Walking a path through directory entries to reach inode-like structures
- File descriptors and the shared open-file-description abstraction
- The difference between execute and read permission on directories, and how effective credentials are used
- Virtual filesystems and the process/kernel information made visible via
/proc
Part 3: Containers Versus Virtual Machines
Contrast containers with virtual machines across isolation boundaries, kernel sharing, startup and resource costs, operational trade-offs, and scenarios where one is more appropriate than the other.
What This Part Should Cover
- Namespaces, cgroups, capabilities, and the risk of a shared kernel
- Isolation provided by a hypervisor and a separate guest kernel
- Trade-offs in image size, portability, density, and boot speed
- Choosing based on workload requirements instead of a one-size-fits-all preference
What a Strong Answer Covers
- A clear separation among shell, libraries, kernel, and hardware
- Correct reasoning about permissions and filesystem behavior
- Realistic security and operational trade-offs
- Acknowledgment that specific implementations differ even though the fundamental contracts stay the same
Follow-up Questions
- What is different when a command is part of a pipeline?
- Why is there a race window between checking a pathname and opening the file?
- In a shared-kernel design, what does a container escape imply?
- How do user namespaces change privilege semantics within a container?
Overview: Describe Linux's behavior from shell parsing through process creation, exec, waiting, and exit codes, then follow paths, permissions, file descriptors, directories, procfs, and network inspection. Contrast containers and virtual machines based on their real isolation boundaries and operational trade-offs.