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.

HardTechnical
51 practiced

Your service is making roughly 100k syscalls per second and consuming high user CPU. How would you profile which syscalls dominate (tools and commands, e.g. perf, strace, sysdig, bpftrace), and what concrete changes would you propose to reduce syscall overhead (batching, vectored I/O, zero-copy APIs, user-space buffering)? For each proposed change, describe the latency-versus-throughput trade-off and how you would validate the improvement safely in production.

HardTechnical
57 practiced

Describe pidfd_open(2) and pidfd_send_signal(2). Explain how pidfds solve races with PID reuse and why they are useful for multithreaded supervisors. Sketch a design for a robust process supervisor that uses pidfds to wait on and signal child processes, including how you'd detect exit events and avoid race windows.

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?

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?

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.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.