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
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?

HardTechnical
54 practiced

A malware analyst tool walks a directory tree, filters for regular files, and then hashes them. How would you make the file-type checks and traversal resistant to symlink tricks, renamed paths, and concurrent filesystem changes?

EasyTechnical
59 practiced

Explain the differences between stat(2), fstat(2), and lstat(2), including examples of when each should be used and how they behave with symbolic links. How would you robustly detect whether a path refers to a regular file, directory, or symlink, and what TOCTOU considerations apply when relying on stat information during a security review?

MediumTechnical
104 practiced

You are building a secure file-copy routine for a forensic tool. How would you preserve metadata such as permissions and timestamps while avoiding symlink attacks, unsafe path traversal, and accidental writes outside the target directory?

HardTechnical
52 practiced

Describe TOCTOU (time-of-check to time-of-use) race conditions when performing file system operations. Provide concrete examples where checking a path then opening it leads to vulnerabilities. Explain how openat(2), O_NOFOLLOW, O_DIRECTORY, and fstatat(2) can be used to avoid races and perform secure atomic checks and opens.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.