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

Write C code or pseudocode for a function that copies data from one file descriptor to another robustly. It must correctly handle partial reads, partial writes, EINTR, and end-of-file without corrupting the destination.

EasyTechnical
59 practiced

Walk through what happens at the OS level when a program calls a system call such as read() and it returns -1 with EINTR. How should robust systems code handle this, and why does it matter for long-running monitoring or automation software?

HardTechnical
57 practiced

How can mprotect(), mlock(), and page permissions be used to reduce the exposure of secrets in memory? What are the limitations of these primitives, especially after a fork() or during a crash?

EasyTechnical
54 practiced

Compare execve(), execl(), execvp(), and posix_spawn(). When would you choose one over another in a security-sensitive application that launches helper programs or scripts?

HardTechnical
53 practiced

During an incident, you notice a suspicious process tree spawning rapidly and executing different binaries. How would you use your understanding of fork(), exec(), and process parent-child relationships to distinguish normal automation from a fork bomb or malware loader?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.