System Calls & the Kernel Interface Questions

The boundary between user space and the kernel: how programs request privileged services through system calls, the user/kernel mode transition, and the semantics of core POSIX calls such as fork, exec, wait, open, read, write, and stat. Covers syscall numbers, arguments, return values and errno, and how libc wrappers relate to the underlying trap. This is the foundational interface for all systems programming on Unix/Linux.

MediumTechnical
63 practiced

You suspect a running process is leaking file descriptors and hitting EMFILE. Describe, step-by-step and with concrete commands, how you would locate and confirm the leak on a production Linux host without restarting the process. Include use of /proc/<pid>/fd, lsof, strace, and explain trade-offs between using strace vs eBPF/bpftrace for live systems.

MediumTechnical
57 practiced

You need to rotate logs atomically across multiple processes writing to the same filename. Explain how rename(2) enables atomic rotation, what happens to existing file descriptors after rename, and when copytruncate is required. Propose a robust log rotation strategy that avoids losing logs and works with long-lived processes that keep files open.

MediumTechnical
54 practiced

How would you use inotify(7) to watch configuration files and directories for changes and trigger a reload in a service? Cover the resource limits (inotify max_user_watches), race conditions (e.g. moved or renamed files), and alternatives such as fanotify or eBPF-based watchers for large-scale monitoring with lower overhead.

EasyTechnical
67 practiced

What is a zombie (defunct) process on Unix/Linux? Explain how it is created, how to detect zombies on a running host (commands and /proc files), the consequences for system resources (PID table exhaustion), and strategies to ensure children are properly reaped in long-running services or supervisors.

EasyTechnical
55 practiced

What does umask() do, how does it interact with file creation permissions, and why is it important when writing tools that create reports, temporary files, or secret-bearing artifacts?

Unlock Full Question Bank

Get access to all 11 System Calls & the Kernel Interface interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.