Unit 8: Process Management - Practice Quiz

CSE105 — Creative Engineering Workshop 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is a process in an operating system?

Concept of Processes Easy
A. A program in execution
B. A file stored on disk
C. A block of unused memory
D. A hardware component of the CPU

2 Which of the following best describes the difference between a program and a process?

Concept of Processes Easy
A. A process is stored on disk and a program runs in memory
B. There is no difference between them
C. A program runs faster than a process
D. A program is a passive set of instructions, while a process is an active execution of those instructions managed by the operating system with its own resources

3 What does PID stand for?

Process ID (PID) Easy
A. Priority Index Descriptor
B. Program Instruction Data
C. Process Input Device
D. Process Identifier

4 Which statement about a Process ID (PID) is correct?

Process ID (PID) Easy
A. A PID is always a negative number
B. All processes share the same PID
C. Each running process is assigned a unique PID
D. A PID is the name of the program

5 In Linux, which process is traditionally assigned the PID of 1?

Process ID (PID) Easy
A. bash
B. kernel
C. root
D. init/systemd

6 What is the primary purpose of the ps command?

ps Easy
A. To change file permissions
B. To display information about currently running processes
C. To copy files between directories
D. To shut down the system

7 Which command displays a snapshot of processes at the moment it is run, rather than updating continuously?

ps Easy
A. jobs
B. ps
C. kill
D. top

8 Which ps option combination is commonly used to display all processes on the system with full details?

ps Easy
A. ps -z
B. ps clear
C. ps aux
D. ps --off

9 What does the top command do?

top Easy
A. Moves a process to the top of the disk
B. Deletes the topmost file in a directory
C. Displays a real-time, continuously updating view of running processes and system resource usage such as CPU and memory
D. Renames a running process

10 Which key is commonly pressed to quit the top command?

top Easy
A. q
B. x
C. z
D. e

11 The top command is mainly used to monitor which of the following?

top Easy
A. Network cable connections
B. System resource usage and active processes
C. Disk partition tables
D. Printer queues only

12 What does the jobs command display?

jobs Easy
A. A list of all users logged into the system
B. The employment history of the user
C. Jobs started from the current shell that are running or stopped in the background
D. The scheduled cron tasks

13 In the shell, a job typically refers to which of the following?

jobs Easy
A. A user account
B. A permanent file on disk
C. A network port
D. A process or group of processes started from the shell

14 What does the bg command do?

bg Easy
A. Deletes a background job
B. Brings a job to the foreground
C. Displays the system's boot log
D. Resumes a suspended job and runs it in the background

15 Which key combination is typically used to suspend a foreground job before sending it to the background with bg?

bg Easy
A. Ctrl + Z
B. Ctrl + A
C. Ctrl + C
D. Ctrl + D

16 What is the purpose of the fg command?

fg Easy
A. Brings a background or suspended job to the foreground
B. Sends a running job to the background
C. Lists the file group ownership
D. Terminates all running processes

17 If you have a job running in the background and want to interact with it directly in the terminal, which command should you use?

fg Easy
A. ps
B. bg
C. fg
D. kill

18 What is the main purpose of the kill command?

kill Easy
A. To pause the system clock
B. To restart the network service
C. To send a signal to a process, commonly to terminate it
D. To create a new process

19 The kill command identifies which process to signal by using its __.

kill Easy
A. user password
B. file name
C. IP address
D. PID

20 How does pkill differ from kill?

pkill Easy
A. pkill can only stop the shell itself
B. pkill lets you terminate processes by name or other attributes instead of requiring a specific PID like kill does
C. pkill restarts processes instead of stopping them
D. pkill works only on the top process

21 A running program creates a child process using fork(). Which statement best describes the relationship between the two processes immediately after fork() returns?

Concept of Processes Medium
A. The child is an exact copy of the parent with a separate address space
B. The child and parent share the same address space directly
C. The child replaces the parent process entirely
D. The child runs only after the parent terminates

22 A process that has finished execution but still has an entry in the process table because its parent has not read its exit status is called a:

Concept of Processes Medium
A. Sleeping process
B. Zombie process
C. Daemon process
D. Orphan process

23 A child process continues running after its parent terminates. Which process typically adopts this orphaned child on a modern Linux system?

Concept of Processes Medium
A. The user's login shell
B. The nearest sibling process
C. The kernel scheduler process
D. The init/systemd process (PID 1)

24 Which command displays the PID of the currently running shell?

Process ID (PID) Medium
A. echo $#
B. echo $!
C. echo $$
D. echo $?

25 After launching a command in the background with &, which shell variable holds the PID of that most recently backgrounded process?

Process ID (PID) Medium
A. $$
B. $!
C. $?
D. $-

26 On a standard Linux system, which process always has a PID of 1?

Process ID (PID) Medium
A. The init/systemd process
B. The first user login shell
C. The kernel swapper task
D. The system clock daemon

27 Which ps command lists every process on the system with detailed information in the BSD-style format?

ps Medium
A. ps -p
B. ps -l
C. ps t
D. ps aux

28 You want to find the PID of a process named nginx using ps. Which pipeline achieves this?

ps Medium
A. ps -kill nginx
B. ps -ef | grep nginx
C. ps -name nginx
D. ps -find nginx

29 In the output of ps -ef, which column shows the parent process ID of each listed process?

ps Medium
A. TTY
B. PPID
C. UID
D. PID

30 While top is running interactively, which key sorts the process list by memory usage?

top Medium
A. q
B. k
C. M
D. P

31 The load average shown in top reports three numbers. What do these three values represent?

top Medium
A. Load on core 1, core 2, and core 3
B. Load for user, system, and idle CPU
C. Minimum, average, and maximum load today
D. Average load over the last 1, 5, and 15 minutes

32 In top, a process shows a state of R in the status column. What does this indicate?

top Medium
A. The process is a zombie
B. The process is in uninterruptible sleep
C. The process is running or runnable
D. The process is stopped

33 You run jobs and see [2]+ Stopped vim file.txt. What does the + symbol next to the job number indicate?

jobs Medium
A. It is the current (default) job for fg/bg
B. The job is running with elevated priority
C. The job produced a positive exit code
D. The job has completed successfully

34 Which command lists the active jobs of the current shell along with their PIDs?

jobs Medium
A. jobs -l
B. jobs -r
C. jobs -s
D. jobs -p

35 You pressed Ctrl+Z to suspend a long-running command. Which command resumes it in the background so the terminal is freed?

bg Medium
A. kill -CONT
B. jobs -r
C. fg
D. bg

36 You have two stopped jobs [1] and [2]. Which command resumes job 1 specifically in the background?

bg Medium
A. bg -1
B. bg job1
C. bg 1
D. bg %1

37 A command is running in the background and you want to bring it back to the foreground to interact with it. Which command does this?

fg Medium
A. kill -STOP
B. top
C. fg
D. bg

38 A process ignores the default kill signal. Which command forcibly and unconditionally terminates the process with PID 4521?

kill Medium
A. kill -1 4521
B. kill -15 4521
C. kill -9 4521
D. kill -19 4521

39 Which signal number does the kill command send by default when no signal is specified?

kill Medium
A. 9 (SIGKILL)
B. 1 (SIGHUP)
C. 15 (SIGTERM)
D. 19 (SIGSTOP)

40 Which command terminates all running processes whose name matches firefox in a single step?

pkill Medium
A. pkill -p firefox
B. kill -name firefox
C. pkill firefox
D. kill firefox

41 A process ignores SIGTERM because it has installed a custom handler that only logs the signal. Which signal number should you send to force termination that the process cannot catch, block, or ignore?

kill Hard
A. Signal 15 (SIGTERM)
B. Signal 2 (SIGINT)
C. Signal 1 (SIGHUP)
D. Signal 9 (SIGKILL)

42 A process calls fork() which returns 0 in one context and a positive integer in another. What do these two return values indicate respectively?

Concept of Processes Hard
A. 0 is returned to the parent; the positive value (parent's PID) is returned to the child
B. 0 indicates failure; the positive value indicates success in both processes
C. 0 is returned to the child; the positive value (child's PID) is returned to the parent
D. 0 is the thread ID; the positive value is the process group ID

43 A parent process terminates before its child completes. Which process becomes the new parent of the orphaned child, and what is that process's typical PID?

Process ID (PID) Hard
A. The login shell with the lowest available PID
B. init/systemd with PID 1 adopts the orphan
C. The kernel scheduler with PID 0 adopts the orphan
D. The orphan's original grandparent, whatever its PID

44 You run sleep 100 &, then sleep 200 &, then sleep 300 &. Running jobs shows job [3] marked with a +. What does the + sign specifically denote?

jobs Hard
A. The job that was started first in the session
B. The job with the highest priority set by nice
C. The current (default) job that fg and bg act on when no job spec is given
D. The job consuming the most CPU among the three

45 You run pkill -9 -f "python.*server". Which processes are targeted for SIGKILL?

pkill Hard
A. Processes owned by the user named python.*server
B. The process with PID matching the pattern python.*server
C. Only processes whose executable name is exactly python.*server
D. Processes whose full command line matches the regex python.*server

46 A foreground process is stopped with Ctrl+Z. You then run bg. What is the sequence of signals delivered that resumes the job in the background?

bg Hard
A. Ctrl+Z sends SIGTSTP; bg sends SIGCONT to resume it in the background
B. Ctrl+Z sends SIGCONT; bg sends SIGTSTP to resume it
C. Ctrl+Z sends SIGINT; bg sends SIGHUP to resume it
D. Ctrl+Z sends SIGSTOP; bg sends SIGTERM to resume it

47 In top, a process shows %CPU of 150.0 on a 4-core system. How is this value possible and what does it indicate?

top Hard
A. It is a multi-threaded process using 1.5 cores; top sums usage across cores (max would be 400%)
B. The process is using 150% of a single core via hyperthreading overcommit
C. It is a display bug since %CPU cannot exceed 100%
D. It indicates the process is swapping and counting I/O wait as CPU

48 Which ps command reliably lists processes sorted by memory usage in descending order, showing the top memory consumers?

ps Hard
A. ps aux --sort=%mem
B. ps -ef --order mem
C. ps aux --memsort=desc
D. ps aux --sort=-%mem

49 A defunct (zombie) process appears in ps output. Why does kill -9 <PID> fail to remove it?

kill Hard
A. The zombie blocks SIGKILL using a signal mask
B. Zombies run in kernel space where signals are ignored
C. kill -9 requires root privileges for zombies
D. A zombie is already dead; only its parent reaping it via wait() clears the entry

50 You have jobs [1], [2], and [3] in the background. Which command brings job 2 specifically to the foreground?

fg Hard
A. fg 2
B. fg -2
C. fg #2
D. fg %2

51 What is the key behavioral difference between pkill firefox and killall firefox?

pkill Hard
A. pkill only kills the oldest matching process; killall kills all matches
B. pkill matches process names as a substring/pattern by default; killall requires an exact name match
C. pkill sends SIGKILL by default; killall sends SIGTERM
D. pkill works only on the current user's processes; killall works system-wide

52 A process in the D state shown by ps cannot be terminated even with SIGKILL. What does the D state represent?

Concept of Processes Hard
A. Defunct/dead state where the process table entry persists
B. Uninterruptible sleep, typically blocked on I/O; the process cannot handle signals until the operation completes
C. Detached daemon state that ignores all terminal signals
D. Debugging state where the process is stopped by a tracer

53 In a shell, $$ expands to 4821 and $! expands to 4835. What do these two variables represent?

Process ID (PID) Hard
A. $$ is the foreground job's PID; $! is the number of running jobs
B. $$ is the last exit status; $! is the last background exit status
C. $$ is the parent shell's PID; $! is the current shell's PID
D. $$ is the current shell's PID; $! is the PID of the most recent background process

54 In top, the summary line shows %wa (iowait) at 45% while %us and %sy are low. What does this most likely indicate?

top Hard
A. The CPU is idle but waiting on slow I/O operations, indicating an I/O bottleneck rather than CPU saturation
B. 45% of processes are in a waiting-for-signal state
C. Memory is exhausted and the system is thrashing on swap only
D. The system is CPU-bound and needs more processing cores

55 What does the STAT column value Ss mean in the output of ps aux?

ps Hard
A. S = sleeping; s = scheduled for the next quantum
B. S = system process; s = single-threaded
C. S = interruptible sleep; s = the process is a session leader
D. S = stopped; s = swapped out to disk

56 Running kill -0 <PID> produces no output and returns exit status 0. What is the purpose of signal 0?

kill Hard
A. It broadcasts a signal to all processes in the group
B. It sends a null signal that gracefully pauses the process
C. It resets the process's signal handlers to defaults
D. It checks whether the process exists and is signalable, without actually sending any signal

57 A backgrounded job (via bg) attempts to read from the terminal (stdin). What happens to the job?

bg Hard
A. It reads directly from the terminal without interruption
B. It is stopped with SIGTTIN and appears as stopped in jobs until brought to the foreground
C. It automatically returns to the foreground to complete the read
D. It receives SIGKILL and terminates immediately

58 You want to send SIGTERM only to processes named nginx owned by user www-data. Which command is correct?

pkill Hard
A. pkill -u www-data nginx
B. pkill nginx --owner www-data
C. pkill -U nginx www-data
D. pkill --user=www-data --name=nginx --all

59 After running jobs -l, what additional information is shown compared to plain jobs?

jobs Hard
A. The full environment variables of each job
B. The parent shell PID that launched each job
C. The CPU and memory percentages for each job
D. The PID of each job is displayed alongside the job number and state

60 A daemon process is created by double-forking. Why is the second fork() performed after the first child calls setsid()?

Concept of Processes Hard
A. To ensure the daemon is not a session leader, so it can never reacquire a controlling terminal
B. To create a backup process in case the first child crashes
C. To duplicate the daemon across two CPU cores for load balancing
D. To reset the daemon's PID to a lower value for priority