Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

51.

There are ___ distinct phases of a process.(a) 2(b) 5(c) 4(d) 3I have been asked this question during an internship interview.Origin of the question is Process Status:ps Command and Phases of a Process topic in division The Process of Unix

Answer»

Correct ANSWER is (d) 3

The best I can explain: There are three distinct phases of a PROCESS which uses three different SYSTEM calls or functions. A process can be in its initial state when it is created, after that, the process is in execution state when the INSTRUCTIONS of a process are being executed. The third phase of a process is waiting for state when the process is waiting for some action to be taken.

52.

The -a option when used with ps command lists processes of all users but doesn’t display the system processes.(a) True(b) FalseI got this question in an interview for job.The question is from Process Status:ps Command and Phases of a Process in section The Process of Unix

Answer» CORRECT answer is (a) True

Easiest explanation: The -a (all) OPTION lists PROCESSES of all users but doesn’t DISPLAY the system processes. For EXAMPLE,
53.

Which option is used by the system administrator for displaying processes of a user?(a) -f(b) -u(c) -a(d) -eThe question was asked in final exam.The origin of the question is Process Status:ps Command and Phases of a Process in division The Process of Unix

Answer»

The correct answer is (B) -u

For EXPLANATION I WOULD say: The system ADMINISTRATOR needs to use the -u (user) OPTION to know the activities of a user. For example,

54.

Which option is used by ps command to get a detailed listing of process attributes?(a) -u(b) -f(c) -l(d) -xThe question was asked in an internship interview.I would like to ask this question from Process Status:ps Command and Phases of a Process topic in division The Process of Unix

Answer» CORRECT choice is (b) -f

For explanation: ps is a highly VARIANT command; its actual output varies across different flavours. To GET a detailed listing of process attributes ALONG with PPID and owner (UID), we have to use the -f option with ps command. For EXAMPLE,
55.

Which of the following attribute is not shown by ps command?(a) PID(b) PPID(c) tty(d) sizeThe question was posed to me during a job interview.This interesting question is from Process Status:ps Command and Phases of a Process topic in chapter The Process of Unix

Answer»

Right OPTION is (d) size

To EXPLAIN I would say: PS command displays the processes owned by the user RUNNING the command. If we execute the command immediately after logging in, it MAY produce an output like this:

56.

Which command shows some attributes of a process?(a) pid(b) $$(c) ps(d) HOMEThe question was posed to me in final exam.The query is from Process Status:ps Command and Phases of a Process topic in division The Process of Unix

Answer»

Right answer is (c) PS

The explanation is: ps command is USED to show some ATTRIBUTES of a process. This command reads through the kernel’s data structures and process tables to fetch the characteristics of a process. By default, ps command displays the processes owned by the user RUNNING the command.

57.

Which of the following command doesn’t create a process?(a) pwd(b) fork(c) cd(d) pwd and cdI got this question in an interview for internship.My question is taken from Process Basics topic in portion The Process of Unix

Answer»

Correct answer is (d) pwd and cd

Easiest EXPLANATION: When we run a command, a process REPRESENTING the command is started by the SHELL process but all COMMANDS don’t SET up processes. Built-in commands of the shell like pwd, cd etc do not create processes.

58.

Which process is immediately set up by the kernel when we log on to a UNIX system?(a) shell(b) parent(c) shell(d) bashI got this question in an interview for job.I'm obligated to ask this question of Process Basics in section The Process of Unix

Answer»

The CORRECT choice is (a) shell

The BEST explanation: As we log on to a UNIX system, a process is immediately set up by the kernel. This process REPRESENTS a UNIX command which may sh (Bourne shell), ksh (Korn shell), CSH (C shell) or bash (Bash). This process remains alive until we log out when it is killed by the kernel.

59.

What is the PID of the first process that is set up when the system is booted?(a) 1(b) 0(c) any(d) 2I had been asked this question during an interview.This interesting question is from Process Basics in portion The Process of Unix

Answer»

Correct ANSWER is (B) 0

To explain: EVERY process has a parent process, we can’t have any orphaned process for a longer time. The ancestry of every process is ultimately traced to the first process (PID 0) that is set up when the system is booted. It’s LIKE the root DIRECTORY of the system.

60.

The PID of our login shell doesn’t change.(a) True(b) FalseThis question was posed to me in homework.This question is from Process Basics topic in chapter The Process of Unix

Answer»

Right option is (b) False

The BEST explanation: The PID of our LOGIN shell can’t obviously change as LONG as we are logged in. But when we log out and log in again, our login shell will be assigned a different PID. This knowledge of PID is necessary to CONTROL the activities at our terminal.

61.

To know the PID of your current shell, which command will be used?(a) echo $$(b) echo $(c) $SHELL(d) $PATHThe question was posed to me in an international level competition.The query is from Process Basics in portion The Process of Unix

Answer»

The CORRECT ANSWER is (a) ECHO $$

To explain: The shell’s pathname is stored in SHELL, but it’s PID is stored in a SPECIAL variable, $$. To know the PID of our current shell, type

62.

Each process is identified by a unique integer called ______(a) PID(b) PPID(c) TID(d) PTIDThis question was posed to me during an interview for a job.This intriguing question originated from Process Basics in section The Process of Unix

Answer» CORRECT option is (a) PID

To explain I WOULD say: Each PROCESS is UNIQUELY identified by a unique integer called as the Process ID (PID) which is allotted by the kernel when the process is born. This PID is used for CONTROLLING the process of killing it.
63.

Some attributes of every process are maintained by the kernel in memory in a separate structure called the ______(a) pcb(b) task control block(c) process table(d) task tableThis question was addressed to me in semester exam.This intriguing question originated from Process Basics topic in chapter The Process of Unix

Answer»

Correct option is (c) PROCESS table

To explain: As every process has some attributes. Some of these attributes are maintained by the KERNEL in memory in a SEPARATE structure called the process table. A process table is simply an array of many pcb’s. Process table CONTAINS two MAJOR attributes of a process i.e. processed and parent process ID.

64.

The parent id of a child is called ______(a) PID(b) PPID(c) TID(d) PTIDThis question was posed to me during an online exam.The origin of the question is Process Basics in chapter The Process of Unix

Answer»

The correct option is (b) PPID

To explain I would say: The PARENT ID of a CHILD PROCESS is calledPPID (parent process ID) and is available as a process attribute. It is COMMON that several processes have the same parent. When several processes have the same parent, it often makes sense to kill the parent process RATHER than killing each child separately.

65.

Every process has a parent process.(a) True(b) FalseI have been asked this question during an interview.This interesting question is from Process Basics in portion The Process of Unix

Answer» RIGHT option is (a) True

To explain: Just like a file has a parent, EVERY process also has the same.The parent is also a process and the process born from it is CALLED child process. For example, when we run the cat command a process representing the cat command is STARTED by the SHELL process. The process started by the shell is called child process and the shell (which could be sh, ksh or any other) is the parent process.
66.

Process table and process control block store same attributes of a process.(a) True(b) FalseThe question was posed to me by my college director while I was bunking the class.Enquiry is from Process Basics topic in section The Process of Unix

Answer»

Correct option is (b) False

The best explanation: Both pcb and PROCESS table store attributes and information about processes. But the major DIFFERENCE between both is, pcb CONTAINS all the information about the process and is used in CONTEXT switching while process table contains very few attributes of a process like registers, PID, parent pid.

67.

A process is an instance of_______ program.(a) waiting(b) executing(c) terminated(d) haltedI had been asked this question in an online quiz.The origin of the question is Process Basics topic in division The Process of Unix

Answer»

The correct choice is (B) executing

To elaborate: A process is simply an instance of a running program. A process PASSES through many states throughout its LIFE cycle i.e. when it is BORN until it is executed. After the process has completed it is said to be terminated.

68.

A process is said to be ____ when it starts its execution.(a) born(b) die(c) waiting(d) terminatedThe question was posed to me at a job interview.This key question is from Process Basics topic in chapter The Process of Unix

Answer»

Correct answer is (a) BORN

The best explanation: A process is said to be born when it STARTS its execution. It is the initial state of a process. The process is assigned to CPU for its execution further.

69.

Programs and process are synonymous.(a) True(b) FalseI had been asked this question during an interview for a job.The origin of the question is Process Basics in portion The Process of Unix

Answer»

Right choice is (b) False

For explanation I WOULD say: PROGRAM should not be confused with the PROCESS. Both differ from each other but very slightly. The process is only an INSTANCE of a RUNNING program. Until a program hasn’t started its execution it is referred to a program only but as soon it is in execution state it is called as a process.

70.

Which data structure is used to store information about a process?(a) process control block (pcb)(b) array(c) queue(d) program control blockI got this question during an internship interview.This key question is from Process Basics in chapter The Process of Unix

Answer»

Correct option is (a) process control BLOCK (pcb)

Easy explanation: A process control block is a data structure which is used for STORING information about a process. It is also known as task control block and is MAINTAINED by the kernel for maintenance of a process. Each process has its own pcb.

71.

When the process has completed its execution it is called ______(a) born(b) terminated(c) waiting(d) exitThis question was posed to me by my school teacher while I was bunking the class.The above asked question is from Process Basics in chapter The Process of Unix

Answer» CORRECT option is (d) exit

Easy EXPLANATION: A process is said to be died or terminated when it has completed its execution either normally or ABNORMALLY. As long as the process is running it is in an ACTIVE state but as soon as the process has completed its execution, the process is said to DIE.