InterviewStack.io LogoInterviewStack.io

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
70 practiced

A process opens a log file and passes the file descriptor to another component. What exactly does a file descriptor represent, how is it different from the underlying open file description, and why are descriptors useful in secure designs?

EasyTechnical
63 practiced

Explain the difference between a user-space function call and a system call on Linux/x86-64. What happens during the kernel-user boundary transition (which instruction is used, the register calling convention for arguments and return value, how context changes), and why is a system call more expensive than an ordinary function call? Explain why this overhead matters when designing low-latency or high-throughput services, and which measurements you would collect to validate the impact.

MediumTechnical
101 practiced

Describe how to set a file descriptor to non-blocking mode in C using fcntl(2) or by passing O_NONBLOCK to open(2). Explain race conditions when setting flags after open, how to avoid them, and common bugs in servers that forget to handle EAGAIN/EWOULDBLOCK properly (especially with edge-triggered epoll).

MediumTechnical
58 practiced

Compare select(2), poll(2), and epoll(7) on Linux: their complexity characteristics, limits (e.g. fd_set size), kernel/user interactions, and pitfalls when implementing an event loop (such as edge-triggered epoll gotchas). Which would you choose for a service handling tens of thousands of concurrent connections, and why?

MediumTechnical
57 practiced

sendfile(2), splice(2), and tee(2) all enable zero-copy or reduced-copy data transfer on Linux. What does each one actually do (typical use cases like file-to-socket or pipe-to-socket, and limitations like supported fd types and blocking behavior), and when is the added complexity worth it? What monitoring signals would tell you it paid off?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.