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.

1.

To find out how efficiently a program a used the system resources, which command is used?(a) sys(b) time(c) crontab(d) daemonThe question was asked in an international level competition.My query is from Process Management in section The Process of Unix

Answer»

The correct answer is (B) time

For explanation: When there are multiple versions of a program and we want to FIND out how efficiently they’ve used the SYSTEM resources we can USE the time command. The time command accepts the entire command line to be timed as its argument. It executes the command and also displays the time usage on the terminal. For example,

2.

The cron tab is a table having a list of commands that are scheduled to be run at regular intervals.(a) True(b) FalseThis question was posed to me in an interview for job.The above asked question is from Process Management topic in section The Process of Unix

Answer»

The correct option is (a) True

The explanation is: The cron-tab or cron table is a list of commands that are scheduled to be RUN at REGULAR intervals. The crontab command opens the crontab for scheduling, EDITING, REMOVING, modify scheduled TASKS.

3.

Which of the following command will remove the current crontab?(a) crontab -p(b) crontab -l(c) crontab -e(d) crontab -rI have been asked this question in final exam.The query is from Process Management in portion The Process of Unix

Answer»

Right answer is (d) crontab -r

To ELABORATE: We can see the CONTENTS of our crontab file using crontab -l COMMAND and can REMOVE them with crontab -r. We can also enter cron COMMANDS using crontab -e command.

4.

What is cron?(a) a simple process(b) an orphan process(c) a daemon(d) a zombie processI had been asked this question in an international level competition.Enquiry is from Process Management topic in division The Process of Unix

Answer»

Right choice is (c) a daemon

For explanation I would say: CRON is a daemon which runs on UNIX systems. It executes programs at regular INTERVALS. It lets us to SCHEDULE jobs so that they can be scheduled repeatedly. It executes cron jobs created by the crontab. For example, a cron job can be scheduled for PROCESSING logs EVERY evening.

5.

Jobs scheduled using batch command can be removed using ___ option.(a) -a(b) -d(c) -f(d) -rI have been asked this question in an internship interview.My question is from Process Management in chapter The Process of Unix

Answer» CORRECT option is (d) -r

For explanation: Any job scheduled USING BATCH goes to a special at QUEUE. To remove a job from this queue we can use the -r option with at command. For example,
6.

What is a daemon?(a) process whose parent has died(b) process who has completed its execution but still has an entry in the process table(c) process which is running infinitely(d) process which runs automatically without any user interactionThe question was posed to me in an online quiz.Enquiry is from Process Management topic in chapter The Process of Unix

Answer»

Right option is (d) process which runs automatically WITHOUT any user INTERACTION

The explanation: DAEMONS are processes which RUN automatically without requiring any user interaction. These are designed to help the user by performing tasks which are COMMONLY done. For example, checking for an e-mail.

7.

Jobs scheduled using batch command goes to a special at queue.(a) True(b) FalseThis question was addressed to me in exam.My question is taken from Process Management in section The Process of Unix

Answer»

Right CHOICE is (a) True

Explanation: The batch command ALSO allows us to schedule jobs for later execution but unlike at command, it executes the jobs as soon as the system load permits. Any job scheduled USING batch goes to a special at queue.

8.

Which command permits to schedule jobs for later execution, as soon as the system load permits?(a) at(b) %(c) batch(d) cronThe question was asked in homework.The question is from Process Management in section The Process of Unix

Answer» CORRECT option is (c) batch

To elaborate: The batch command also allows us to SCHEDULE jobs for LATER execution but UNLIKE at command, it executes the jobs as soon as the system load permits. For EXAMPLE,
9.

We cannot find out the name of the program scheduled using at command.(a) True(b) FalseI have been asked this question during an interview for a job.This is a very interesting question from Process Management topic in chapter The Process of Unix

Answer»

The correct option is (a) True

For explanation I WOULD say: Unfortunately, the major drawback in at command is that we cannot find out the name of the program SCHEDULED to be executed. This may create a problem when we are unable to RECALL whether a specific job has actually been scheduled for LATER execution.

10.

To remove a job from the queue, which option is used with at command?(a) -r(b) -l(c) -e(d) -tThis question was posed to me by my college director while I was bunking the class.My question is taken from Process Management topic in chapter The Process of Unix

Answer»

The correct option is (a) -r

To explain I would say: Jobs can be listed using -L option with at command and can be removed using -r option. All we have to do is to provide the job NUMBER (of the job which we WANT to remove from the queue) as an argument to at command along with -r option. For example,

11.

Which one of the following forms used with at command is invalid?(a) at noon(b) at now +2 years(c) at3:07 + 1 day(d) at morningI had been asked this question during an interview.This is a very interesting question from Process Management topic in division The Process of Unix

Answer»

The CORRECT CHOICE is (d) at morning

To elaborate: at command offer keywords like now, NOON, midnight, TODAY, tomorrow to schedule jobs according to our CONVENIENCE. For example,

12.

We can list the jobs queued using at command by using ____ option.(a) -p(b) -v(c) -l(d) -rI got this question during an online exam.The origin of the question is Process Management in division The Process of Unix

Answer» RIGHT choice is (c) -l

For explanation: Jobs scheduled using at command are sent to a QUEUE for later EXECUTION. To LIST the jobs in this queue we can use the -l OPTION with at command. This command will list each of the scheduled jobs in the queue in this format.
13.

Which of the following keyword is not supported by at command?(a) now(b) noon(c) tomorrow(d) eveningThis question was addressed to me in an online quiz.The question is from Process Management in portion The Process of Unix

Answer»

Correct answer is (d) evening

The explanation is: at command offer keywords like now, noon, MIDNIGHT, today, TOMORROW to schedule jobs according to our CONVENIENCE. We can ALSO use the + operator with at command.The words that can be used with + operator include hours, days, month, years, WEEKS.

14.

We can schedule a job to run at a specified time of day using _______ command.(a) batch(b) at(c) cron(d) jobsThe question was asked in an interview for internship.My question is from Process Management topic in portion The Process of Unix

Answer»

Right option is (B) at

Easiest explanation: UNIX provides sophisticated FACILITIES to schedule a JOB to run at a specified time of day using at command. at command TAKES as its arguments the time the job is to be executed and displays the > prompt. The input then has to be supplied from STANDARD input. For example,

15.

We can use the _____ symbol with at command to redirect our output to a specified file.(a) >(b) >(d) %I got this question during an online interview.I'm obligated to ask this question of Process Management in chapter The Process of Unix

Answer»

Right choice is (a) >

To elaborate: The standard output and standard error of the program scheduled using at command are mailed to the user who can use any mail READING program to view it. Alternatively, we can use the > SYMBOL to REDIRECT our output to a SPECIFIED file for viewing it later. For example,

16.

Which command is used to list the status of jobs?(a) fg(b) JOBS(c) jobs(d) fgI had been asked this question in semester exam.Asked question is from Process Management topic in section The Process of Unix

Answer»

Right CHOICE is (C) jobs

To ELABORATE: We can use the jobs command to list the STATUS of the jobs. This command tells the state of the job along with job NUMBER. For example,

17.

POSIX shell provides job control facilities like bg or fg.(a) True(b) FalseThe question was posed to me in semester exam.I'm obligated to ask this question of Process Management topic in section The Process of Unix

Answer»

The correct answer is (b) False

For explanation I would say: If we are using the C, KORN or Bash SHELL then we can use their job CONTROL facilities to manipulate jobs LIKE killing a job, pushing to background or foreground, suspending a foreground job. We cannot use these job control COMMANDS in any other shell except the above mentioned.

18.

Which of the following is not a part of job control facilities?(a) relate a job to the background(b) bring it back to the foreground(c) kill a job(d) create a new jobThis question was addressed to me in an interview for job.The above asked question is from Process Management in chapter The Process of Unix

Answer»

The correct option is (d) CREATE a NEW job

Easy explanation: If we are using the C, Korn or Bash shell then we can use their job control FACILITIES to manipulate JOBS. Job control in these shells means that we can :

•Relate a job to the background (BG)

•bring it back to the foreground (fg)

•kill a job (kill)

•list the active jobs (jobs)

•suspend a foreground job (ctrl-Z)

19.

The command bg %2 is valid.(a) True(b) FalseI have been asked this question in a job interview.This intriguing question comes from Process Management topic in section The Process of Unix

Answer»

Right option is (a) True

Easiest explanation: bg command can also be used with the job number, job name or a string as ARGUMENTS prefixed with the % symbol. For example, if we’ve suspended two jobs but now we WANTTO send the second job to the background, USE the FOLLOWING command:

20.

____ command will bring the background jobs to the foreground.(a) bg(b) fg(c) ctrl-Z(d) killThe question was posed to me in an online interview.My doubt stems from Process Management in section The Process of Unix

Answer»

The correct choice is (b) fg

For explanation I would SAY: We can USE the fg command to BRING any of the BACKGROUND jobs to the foreground. To bring the most RECENT background job to the foreground we can use the following command:

21.

The command fg %1 will bring the first background job to the foreground.(a) True(b) FalseThis question was addressed to me in an international level competition.Origin of the question is Process Management topic in division The Process of Unix

Answer» RIGHT option is (a) True

Best EXPLANATION: fg command can be used with the JOB NUMBER, job name or a string as ARGUMENTS prefixed with the % symbol. For example,
22.

Which command will push the current foreground job to the background?(a) bg(b) fg(c) ctrl-Z(d) killThe question was asked in class test.My doubt is from Process Management in section The Process of Unix

Answer»

Right choice is (a) BG

Best explanation: If we’d suspended a job using ctrl-Z then after that we can use the bg COMMAND to push the CURRENT foreground job to the background. For EXAMPLE,

23.

Which of the following command is used to suspend a job?(a) ctrl-Z(b) ctrl-Q(c) bg(d) $I got this question in examination.My question is from Process Management in portion The Process of Unix

Answer»

Correct ANSWER is (a) ctrl-Z

To EXPLAIN I would say: Suppose we invoke a command and the prompt hasn’t RETURNED even after a LONG time then we can suspend that job by pressing Ctrl-Z. The point needed to be focused here is, the job hasn’t terminated yet; it’s only suspended or STOPPED.

24.

What is a job?(a) group of tasks(b) group of commands(c) group of processes(d) group of signalsI had been asked this question in unit test.My question is taken from Process Management topic in division The Process of Unix

Answer» RIGHT choice is (c) group of PROCESSES

The best explanation: A JOB is a name given to a group of processes. The easiest WAY of creating a job is to run a pipeline of two or more commands. If we are using C, Korn or Bash shell we can USE the job control commands to manipulate jobs.
25.

Kill -l will list all the signal numbers on our machine.(a) True(b) FalseI had been asked this question during an interview.Asked question is from Process Handling Commands topic in chapter The Process of Unix

Answer»

Correct answer is (a) True

Explanation: To view the list of all SIGNAL names and numbers that are AVAILABLE on our machine, we have to USE the -L option with kill command or view the file /usr/include/sys/signal.h

26.

Which of the followings command(s) is used to kill the login shell?(a) kill 0(b) kill-9$$(c) kill-sKILL 0(d) kill-9$$ and kill-sKILL 0I got this question in semester exam.My question comes from Process Handling Commands in division The Process of Unix

Answer» RIGHT answer is (d) KILL-9$$ and kill-sKILL 0

Explanation: A SIMPLE kill COMMAND (with TERM) will not kill the LOGIN shell. We can kill the login shell by using any of the following commands:
27.

Which option is preferred while killing a process using SIGKILL signal (9)?(a) -p(b) -s(c) -h(d) -dI got this question by my school teacher while I was bunking the class.This question is from Process Handling Commands topic in portion The Process of Unix

Answer»

The correct answer is (b) -s

The best explanation: Sometimes it may happen that some programs ignore the SIGTERM signal (15) and continue their execution normally. In such a case, the process can be killed by using SIGKILL signal (9). This signal can’t be generated at the press of a KEY, so we have to use KILLwith the signal name preceded with -s OPTION. For example, to kill a job with PID 184 use the following command:

28.

Which signal is used with kill command to terminate the process when they ignore the SIGTERM signal (15)?(a) SIGTERM (16)(b) SIGTERM(0)(c) SIGKILL(9)(d) -dThe question was asked in a national level competition.Question is from Process Handling Commands topic in division The Process of Unix

Answer»

The correct answer is (c) SIGKILL(9)

The explanation: By default, the SIGTERM signal (15) is USED by the KILL command to terminate processes. But sometimes it may happen that some PROGRAMS ignore it and CONTINUE their execution normally. In such a case, the process can be killed by using SIGKILL signal (9). For example, to kill a job with PID 134 use the following command:

29.

By default, kill uses the SIGTERM signal (15) to terminate the process.(a) True(b) FalseI got this question in homework.Enquiry is from Process Handling Commands in portion The Process of Unix

Answer»

Correct choice is (a) True

The explanation: UNIX often requires to COMMUNICATE the occurrence of events to process. This is done by sending a signal. The SIGTERM signal (15) is the default signal USED by the KILL COMMAND to TERMINATE processes.

30.

Which one of the following command is used for killing the last background job?(a) kill $(b) kill $$(c) kill $!(d) kill !I got this question in examination.My question is from Process Handling Commands in section The Process of Unix

Answer»

The correct choice is (c) kill $!

Explanation: For most SHELLS, the system variable $! Stores the PID of the last BACKGROUND job. So we can kill any PROCESS by USING kill COMMAND. The PID of the job can be seen when & is affixed to a command. For example,

31.

Which command is used for premature termination of a process?(a) signal(b) nice(c) kill(d) nohupThe question was asked by my college director while I was bunking the class.The origin of the question is Process Handling Commands in division The Process of Unix

Answer»

Correct option is (C) kill

The best explanation: The kill command is used for premature termination of a PROCESS. It usually SENDS a signal with the intention of killing one or more processes. kill is an INTERNAL command in most shells. Kill command USES one or more PID’s as its arguments. For example,

32.

Which option can be used explicitly to reduce the priority of any process.(a) -a(b) -n(c) -o(d) -qThe question was posed to me by my school teacher while I was bunking the class.Enquiry is from Process Handling Commands in chapter The Process of Unix

Answer»

Correct option is (b) -N

Best explanation: nice VALUES are system-dependent and TYPICALLY range from 1 to 19. We can also specify the nice value explicitly with the -n option but a non-privileged user cannot increase the priority of a PROCESS. For EXAMPLE, to increase the priority by 8 times use the following command:

33.

nice command is a ______ command in C shell.(a) internal(b) external(c) built-in(d) directoryThe question was posed to me in final exam.I need to ask this question from Process Handling Commands topic in portion The Process of Unix

Answer»

Correct choice is (C) built-in

Easiest explanation: NICE is a built-in command in the C shell. nice VALUES are system-dependent and typically range from 1 to 19. A HIGHER nice VALUE implies a lower priority. nice reduces the priority of any process.

34.

It is better to use & with nice command.(a) True(b) FalseI had been asked this question by my college professor while I was bunking the class.The question is from Process Handling Commands topic in chapter The Process of Unix

Answer»

Right answer is (a) True

For explanation: UNIX offers the nice command, which is used with the & operator to INCREASE the priority of jobs. More important jobs can have GREATER ACCESS to the system resources. For EXAMPLE,

35.

Which command is used for executing jobs according to their priority?(a) nohup(b) $(c) &(d) niceI had been asked this question in quiz.The above asked question is from Process Handling Commands in chapter The Process of Unix

Answer»

Correct choice is (d) nice

Explanation: PROCESSES in UNIX system are USUALLY executed with equal PRIORITY but sometimes it is necessary to complete high priority jobs at the earliest. For this purpose, UNIX OFFERS nice command. For example,

36.

What is the PID of the process who takes the parentage of the process run with nohup command?(a) 0(b) 1(c) 2(d) InfiniteThe question was asked in unit test.I would like to ask this question from Process Handling Commands in section The Process of Unix

Answer»

Right answer is (B) 1

To explain I would SAY: The shell dies on logging out but it’s child didn’t. The KERNEL handles such situations by reassigning the PPID of the orphan PROCESS to the SYSTEM’s init process (PID 1), which is the parent of all shells.

37.

nohup command doesn’t send the standard output of a command to any file.(a) True(b) FalseThis question was addressed to me during an online exam.This intriguing question comes from Process Handling Commands topic in chapter The Process of Unix

Answer»

Right answer is (b) False

The explanation is: Some shells DISPLAY a message when the NOHUP command is used. In these shells, nohup command sends the STANDARD output of the command to the file nohup.out. If you don’t get this message then you have to make sure that you’ve taken care of the output USING REDIRECTION, if necessary.

38.

When nohup command is used, shells returns the _____(a) PID(b) PPID(c) tty(d) TTyThe question was posed to me in an international level competition.My question is from Process Handling Commands in chapter The Process of Unix

Answer»

The correct option is (a) PID

For explanation I would say: When the NOHUP command is USED, the shell returns the PID and some SHELLS also DISPLAY a message. For EXAMPLE,

39.

Which of the following shell(s) allows the user to run jobs in the background even when the user has logged out (without using nohup command)?(a) C(b) bash(c) Korn(d) C and bashI have been asked this question in an internship interview.This intriguing question comes from Process Handling Commands topic in portion The Process of Unix

Answer»

Right option is (d) C and bash

For explanation I would SAY: Background JOBS are terminated automatically when the user logs out. But in C shell and bash shell jobs are not terminated even after the user logs out. While this is not the case with Bourne and Korn shells. In these shells, jobs are ABORTED as SOON as the user logs out.

40.

It is necessary to terminate the command line with &, even when we are using nohup command.(a) True(b) FalseThis question was posed to me in examination.The question is from Process Handling Commands in section The Process of Unix

Answer»

Correct option is (a) True

Best explanation: nohup command ALLOWS running JOBS in the background even when the user logs out of the system. But it is necessary to terminate the command line with & when using nohup command.

41.

Which command is used for running jobs in the background?(a) nice(b) ps(c) nohup(d) execThe question was posed to me by my college professor while I was bunking the class.My question comes from Process Handling Commands in portion The Process of Unix

Answer»

Correct CHOICE is (c) nohup

To explain I WOULD say: The nohup command when prefixed to a command allows execution of the process even after the user has logged out of the system. Background JOBS cease to run when a user logs out of the system. This happens because the shell is KILLED. To avoid this CONDITION, the nohup command can be used. For example,

42.

Shell ___ operator is used for running jobs in the background.(a) $(b) #(c) |(d) &I had been asked this question in an interview for job.Asked question is from Process Handling Commands topic in chapter The Process of Unix

Answer»

Right OPTION is (d) &

The EXPLANATION is: The & is the shell OPERATOR used to run a process in the background. All we have to do is to terminate the COMMAND line with a & symbol, the command will automatically run in the background. For example,

43.

We can run the jobs in the background in UNIX.(a) True(b) FalseI had been asked this question in an interview.My doubt stems from Process Handling Commands in portion The Process of Unix

Answer»

The correct CHOICE is (a) True

The EXPLANATION is: Since UNIX is a multitasking system, it ALLOWS the user to do more than one job at a time. But there can be only one process in the foreground and the rest of jobs have to RUN in the background.

44.

Which system call is used by the parent process to wait for the child process to complete?(a) wait(b) exec(c) fork(d) exitThe question was posed to me during an online exam.This interesting question is from Process Status:ps Command and Phases of a Process topic in portion The Process of Unix

Answer»

Right answer is (B) exec

Easy explanation: The parent process executes the WAIT() SYSTEM CALL to wait for the child process to complete. It picks up the exit status of the child and then continues with its other functions.

45.

Which system call is used to run a new program?(a) fork(b) wait(c) exec(d) exitThe question was asked at a job interview.My doubt stems from Process Status:ps Command and Phases of a Process in section The Process of Unix

Answer»

Correct choice is (c) exec

The best I can explain: Forking CREATES a new PROCESS but it is not ENOUGH to RUN a new program. To do so, the forked child needs to overwrite its own images with the code and data of the new program. This mechanism is called exec and the child process is SAID to exec a new program.

46.

What is the value returned by fork system call, when the creation of child process is unsuccessful?(a) positive integer(b) negative integer(c) zero(d) fractional valueThe question was asked in unit test.My enquiry is from Process Status:ps Command and Phases of a Process in portion The Process of Unix

Answer»

Right choice is (b) negative integer

The best explanation: fork() system call is used in UNIX for creating NEW processes. It TAKES no parameters and returns an integer value. The value returned depends on the following cases:

Positive value: returned to the parent process. The value contains PID of child process which is created.

Negative value: returned if the creation of child process is unsuccessful.

Zero: returned to the NEWLY created child process.

47.

When fork() is invoked, the child process created gets a new PID.(a) True(b) FalseI have been asked this question in semester exam.My question is from Process Status:ps Command and Phases of a Process in chapter The Process of Unix

Answer»

The correct answer is (a) True

The best I can EXPLAIN: The process created using fork is PRACTICALLY identical to that of calling process except for a few parameters like PID. When a process is FORKED in this manner, the child process gets a NEW PID.

48.

Which option is used with ps command to list system processes?(a) -A(b) -a(c) -e(d) –A and -eI got this question in my homework.I'd like to ask this question from Process Status:ps Command and Phases of a Process topic in section The Process of Unix

Answer» RIGHT option is (d) –A and -e

Explanation: Apart from PROCESSES a user generates, a number of system processes keep running all the time. Most of them are not associated with any terminal. To list all PROCESS on our MACHINE, we can use either -A or -e option with ps command. But beware, this list could be very long on a busy system.
49.

Which of the following system call is used for creating a new process?(a) read(b) fork(c) wait(d) newThis question was posed to me in my homework.My doubt is from Process Status:ps Command and Phases of a Process topic in division The Process of Unix

Answer»

Right option is (b) fork

Explanation: A process in UNIX is CREATED using fork() system call. It CREATES an exact COPY of the process that invokes it. Now there will be two processes, ONE parent process and one child process. The process which invokes the fork system call is called parent process and the new process created is called child process.

50.

A system call is a programmatic way in which the program requests for the service from the kernel of an operating system.(a) True(b) FalseThis question was addressed to me during an online exam.My doubt stems from Process Status:ps Command and Phases of a Process in portion The Process of Unix

Answer»

The correct option is (a) True

The best I can explain: A system call often referred to as kernel call, is a request from a COMPUTER PROGRAM for the SERVICES of the operating system. Basically, to ACCESS the resources or to utilize the services of the operating system, system calls are used by computer programs.