← Back to 18. The Linux System

📝 Processes and threads in The Linux System

📖 From Operating System • 18. The Linux System • 11 questions available

Practice MCQs for Processes and threads in The Linux System. Test your knowledge with carefully crafted questions across easy, medium, and hard difficulty levels.

🔄 Last updated: 2026-07-27

2
Easy Questions
5
Medium Questions
4
Hard Questions

📝 Sample Questions

Q1. A program calls fork() and then, in the child process, calls exec() to run /usr/bin/ls. Which sequence correctly describes what happens?

🔹 A. fork creates a child; the child runs ls while the parent continues the original program.
🔹 B. fork creates a child; the parent runs ls while the child continues the original program.
🔹 C. exec replaces both the parent and child processes with ls.
🔹 D. fork creates a child, but exec fails because only the parent can call exec.

💡 Difficulty: easy | ✅ Correct: A

Q2. Why does UNIX separate process creation (fork) from program execution (exec) instead of providing a single call that does both?

🔹 A. To simplify kernel design
🔹 B. To allow the parent to modify the child's environment before exec
🔹 C. To enable multithreading
🔹 D. To reduce memory usage

💡 Difficulty: medium | ✅ Correct: B

Q3. Consider the code: pid = fork(); if (pid == 0) execve(\/bin/grep\, args, env); else execve(\/usr/bin/wc\, args2, env); Which program runs in the parent and which in the child?

🔹 A. Parent runs grep, child runs wc
🔹 B. Parent runs wc, child runs grep
🔹 C. Both run grep
🔹 D. Both run wc

💡 Difficulty: hard | ✅ Correct: B

⬆️ View all questions in the quiz below

🔗 Related Topics

📝 Linux History📝 The Linux kernel📝 The Linux system📝 Linux distributions📝 Linux licensing
🚀 Start Quiz 📝 Practice Mode