Level 1: Bronze
A memorized definition. Not wrong, but it stops there.
A system call is how a program asks the OS to do something.
2 stars Asked often.
In one or two sentences
A system call is how a user program asks the kernel for something such as a file or the network, through a defined entry point. The CPU moves from user mode to kernel mode while it runs.
Say it out loud, or type it below. What you type never leaves this device.
A memorized definition. Not wrong, but it stops there.
A system call is how a program asks the OS to do something.
Correct, but too broad or missing context.
Normal programs run in user mode and cannot touch hardware directly. A system call switches to kernel mode, the OS does the work for you, and control comes back.
Reaches principle, use and trade-off, with words that invite the next question.
CPU privilege levels keep a buggy or hostile application from damaging the OS or other programs. A system call enters the kernel at a fixed entry point through a trap instruction, the kernel validates arguments, does the work and returns to user mode. That mode switch costs more than a normal function call, which is why buffering and batching I/O matters for speed. It is a trade between protection and speed.
These are likely next questions from an interviewer. Think of your answer first, then press the button.
1 / 3
How do an interrupt and a system call differ?
A system call is a synchronous request the program makes on purpose. An interrupt is an asynchronous signal from a hardware device to the CPU.
2 / 3
Is printf a system call?
No. It is a user space library function. It collects output in a buffer and calls a system call such as write.
3 / 3
What does fork do?
It duplicates the calling process to create a child. The return value tells parent and child apart, and many systems use copy on write to delay the copying cost.