YouTube Icon

Interview Questions.

Top 100+ Unix Inter-process Communication (ipc) Interview Questions And Answers - Jun 02, 2020

fluid

Top 100+ Unix Inter-process Communication (ipc) Interview Questions And Answers

Question 1. How To Get Or Set An Environment Variable From A Program?

Answer :

To get surroundings variable execute getenv();
To set environment variable execute setenv();
 

Question 2. What Are The System Calls Used For Process Management?

Answer :

This have to now not allow to growth process priority.

Python Interview Questions
Question three. Predict The Output Of The Following Program Code?
Important()

fork();
printf("hey World!");


Answer :

Output : prints Hello global Hello international.

All the statements after the call to fork() may be completed twice

Question 4. Explain Fork() System Call?

Answer :

Fork() is a device call used for creating baby approaches of a determine procedure.It returns the manner id of the created baby system.After that pid(procedure id ) is checked if it is bad,it approach no baby manner is created,pid==zero implies the id of the newly created system and pid>zero is the identity of infant method given to the discern method.The statements following fork device call are executed by each the discern and toddler procedure.And one more component,the discern and baby process have the precise copy of cope with area but it exist one at a time for the two procedures.

Python Tutorial
Question 5. What Are Various Ids Associated With A Process?

Answer :

Real User id, Effective User Id, stored user identity.
Real Group identification, Effective Group Id, stored Group identification.
UNIX/XENIX Interview Questions
Question 6. Explain The Initial Process Sequence While The System Boots Up?

Answer :

While booting, unique process called the 'swapper' or 'scheduler' is created by the Process-ID 0. The swapper manages memory allocation for approaches and affects CPU allocation. The swapper in turn creates 3 children: the manner dispatcher, vhand, and so on...

Question 7. Tell Me Set-user-id Is Related To (in Unix)?

Answer :

setuid quick for set user ID upon execution is Unix get admission to rights flag that allow customers to run an executable with the permissions of the executable's proprietor. This is frequently used to allow users on a computer machine to run applications with briefly accelerated privileges with a view to carry out a particular undertaking. While the assumed consumer identification privileges supplied are not usually improved, at a minimum this is unique. 

Setuid and setgid are needed for obligations that require higher privileges than those which a commonplace person has, inclusive of changing his or her login password. Some of the obligations that require increased privileges won't right now be apparent, even though - along with the ping command, which ought to ship and listen for manage packets on a community interface.

Socket.IO Tutorial Red Hat Linux Essentials Interview Questions
Question 8. What Is The Condition Required For Dead Lock In Unix System?

Answer :

deadlock takes place due to :

no preembtion.
Circular waiting i.E.. While A technique is awaiting the  resources which are held by using the procees B,which is awaiting the sources engaged through method A.
Question 9. What Is I-node Numbers?

Answer :

File is identified through the I-node number in linux.Kernel uses inode number to access the document. It is particular for the perticular filesystem. Inode incorporates all the statistics about the record like , document length, get admission to permissions, time stamp , uid , gid , tips to information blocks..And so forth.

Red Hat Linux System Administration Interview Questions
Question 10. Max Relax-able Permission Value With Out Giving Write Permission To Others?

Answer :

chmod 755 <filename>

GDB Debugger Tutorial
Question 11. What Is Fork()?

Answer :

Fork device name is used to create a brand new technique. Fork is called onces and returns two times.It will return 0 to the newly created process (infant procedure) and technique id of toddler to the calling procedure(determine process). 

The infant manner gets replica of parents records, stack and heap segement.The code segement is common for both.Both the strategies will resume execution from the command next to fork.Scheduler determine which process to run first.

CorelDRAW Interview Questions
Question 12. Explain Linking Across Directories?

Answer :

It's possible through each symbolic and difficult hyperlinks. However, hard hyperlinks are handiest possible if both supply and destination belong to the equal quantity.

Python Interview Questions
Question thirteen. What Is The Very First Process Created By Kernel?

Answer :

The first method in Unix is INIT.

Unix/Linux Tutorial
Question 14. What Is The Process Id For Kernel Process?

Answer :

zero(zero)

Question 15. What Is Semaphone?

Answer :

a semaphor is not anything however a time period utilized in unix for a variable which acts as a counter.For instance there may be times while  techniques try and get admission to the same file simultaneously.In this event we have to control the get entry to of the when the opposite system is having access to that is accomplished via assigning value to a semaphore.The cost of the semaphore is initialized by using the first technique while the record is in get entry to by using it.When the second technique attempt to get entry to the record it exams the fee of the semaphore and if it unearths the value as initialized it does no longer get admission to the document.

Java-Multithreading Interview Questions
Question 16. How To Write The Program On Full-duplex Communication On Bidirectional(e.G Using Two Pipes)?

Answer :

#include<stdio.H>
#consist of<stdlib.H>
#consist of<unistd.H>
#consist of<sys/ipc.H>
#include<sys/types.H>
int fundamental()
 
int p1[2],p2[2],i;
char buf[5];
pipe(p1);
pipe(p2);
if(fork()==zero)

printf("n that is baby(the enter text is textual content)n");
near(p1[0]);
close(p2[1]);
write(p1[1],"textual content",five);
read(p2[0],buf,5);
write(1,buf,5);

else

printf("n that is determine(the output text is textual content)n");
close(p2[0]);
close(p1[1]);
read(p1[0],buf,five)
for(i=zero;i<4;i++)
buf[i]=to upper(buf[i]);
write(p2[1],buf,5)

Unix socket Tutorial
Question 17. What Are The System Calls Used For Process Management:

Answer :

The system calls for process management are  :

Fork() > create infant system 
Vfork() > create toddler process (copy-on-write best)
exec() > exec to do a distinctive mission
wait() > anticipate a system to finish execution
kill() > to send a sign to a procedure
signal() > to handle a signal
sigaction() > take care of signal
go out() > exit from a technique execution
_exit() > identical as go out() however with out easy up
and plenty of more ................

Socket Programming Interview Questions
Question 18. Describe The Initial Process Sequence While The System Boots Up?

Answer :

Hardware Boot 
Read boot block (block zero) and cargo to reminiscence 
Transfer manage to kernel 
Kernel initialization 
Mount the basis file gadget on / and create environment for system zero 
Process zero invokes procedure 1(init manner) 
init technique invokes method getty 
gettyinvokes login
UNIX/XENIX Interview Questions
Question 19. What Is Ipc? What Are The Various Schemes Available?

Answer :

Inter Process Communication. IPC is used to pass facts among  or greater approaches.Schemes are pipes, shared reminiscence & semaphore.

Below are the unique IPC techniques:

Semaphores
FIFO's (Also known as Named Pipes)
Message Queues
Shared Memory
Question 20. How Do You Execute One Program From Within Another?

Answer :

By calling gadget call fork() to create baby method which handles the other.

UNIX Memory Management Interview Questions
Question 21. What Is An Advantage Of Executing A Process In Background?

Answer :

There are  fundamental benefit :

you may use console to execute your command.
More importantly if one is hooked up via faraway console and as there may be no controlling terminal attached to heritage procedure even if your terminal get disconnected the system keeps (with help of nohup in shell script or by way of the usage of setsid in C)
Question 22. What Happens When We Execute A Unix Command?

Answer :

When command is given then unix os will fork the shell i.E will creat a new method and will execute the command the usage of exec command...Some thing like assume you gave command "ls" inside the shell then...

Fork();

exec(ls);

It will provide you with the end result and after this the child procedure will die.

Question 23. What Is Daemon?

Answer :

The methods like vhand, bdflush, sched are housed in kernel document or /unix machine which can be referred to as daemons. These files run within the background without customers request.These are created when the gadget boots up and remains energetic till it close down or hold. These aren't related to any consumer or any terminal .We cannot kill a daemon.

Unix/Linux Interview Questions
Question 24. Explain A Zombie?

Answer :

A gadget that has been taken over the use of Remote Control Software. Zombies are regularly used to send junk mail or to attack faraway servers with an overwhelming quantity of traffic (a Distributed Denial of Service Attack).

Red Hat Linux Essentials Interview Questions




CFG