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

Describe how process credentials (real and effective UID/GID) interact with execve(2) and the setuid/setgid bits. Explain the security model for setuid binaries, how interpreters and shebang lines affect setuid behavior, and what operational recommendations you'd make for running third-party binaries that require elevated privileges.

MediumTechnical
86 practiced

Suppose your agent must execute a helper binary as a different user on a production host. What environment variables, file descriptors, path-resolution rules, and privilege transitions would you review before allowing that launch?

HardTechnical
54 practiced

You need to reduce the blast radius of a compromised helper process. What system-level techniques would you combine around fork()/exec() to drop privileges, restrict filesystem access, and prevent privilege regain?

HardTechnical
63 practiced

Implement a minimal ptrace-based tracer in C that attaches to a running process, intercepts execve syscalls, and logs the command-line arguments of executed programs. Provide code for attaching, using PTRACE_SYSCALL to intercept entry/exit, and reading strings from traced process memory. Discuss performance and security limitations of ptrace in production.

HardSystem Design
84 practiced

Design a hardened command-execution wrapper for a cybersecurity agent that runs third-party tools on demand. How would you sanitize arguments, environment, descriptors, working directory, and inherited state before exec()?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.