Have you prepared to attend the job interview? Are you confused in job research? Then no problem we have the right answer to you in in our site page. If you are aware with the Unix Inter-Process Communication (IPC) then there are numerous leading companies that offer job roles Software Developer-C++/, IPC, Senior Technical Architect - Object Oriented Software Design and many other leading roles too. If you are preparing for Unix Inter-Process Communication (IPC) job interview and don’t know how to crack interview and what level or difficulty of questions to be asked in job interviews then go through Wisdomjobs Unix Inter-Process Communication (IPC) interview questions and answers page to crack your job interview. Underneath are the commonly asked Unix Inter-Process Communication (IPC) interview questions and answers which can make you feel relaxed to face the interviews:
Question 1. How To Get Or Set An Environment Variable From A Program?
Answer :
Question 2. What Are The System Calls Used For Process Management?
Answer :
This should not allow to increase process priority.
Answer :
Output : prints Hello world Hello world.
All the statements after the call to fork() will be executed twice
Question 4. Explain Fork() System Call?
Answer :
Fork() is a system call used for creating child processes of a parent process.it returns the process id of the created child process.after that pid(process id ) is checked if it is negative,it means no child process is created,pid==0 implies the id of the newly created process and pid>0 is the id of child process given to the parent process.the statements following fork system call are executed by both the parent and child process.and one more thing,the parent and child process have the exact copy of address space but it exist separately for the two processes.
Question 5. What Are Various Ids Associated With A Process?
Answer :
Question 6. Explain The Initial Process Sequence While The System Boots Up?
Answer :
While booting, special process called the 'swapper' or 'scheduler' is created by the Process-ID 0. The swapper manages memory allocation for processes and influences CPU allocation. The swapper in turn creates 3 children: the process dispatcher, vhand, etc...
Question 7. Tell Me Set-user-id Is Related To (in Unix)?
Answer :
setuid short for set user ID upon execution is Unix access rights flag that allow users to run an executable with the permissions of the executable's owner. This is often used to allow users on a computer system to run programs with temporarily elevated privileges in order to perform a specific task. While the assumed user id privileges provided are not always elevated, at a minimum that is specific.
setuid and setgid are needed for tasks that require higher privileges than those which a common user has, such as changing his or her login password. Some of the tasks that require elevated privileges may not immediately be obvious, though - such as the ping command, which must send and listen for control packets on a network interface.
Question 8. What Is The Condition Required For Dead Lock In Unix System?
Answer :
deadlock occurs because of :
Question 9. What Is I-node Numbers?
Answer :
File is identified by the I-node number in linux.Kernel uses inode number to access the file. It is unique for the perticular filesystem. Inode contains all the information about the file like , file size, access permissions, time stamp , uid , gid , pointers to data blocks..etc.
Question 10. Max Relax-able Permission Value With Out Giving Write Permission To Others?
Answer :
chmod 755 <filename>
Answer :
Fork system call is used to create a new process. Fork is called onces and returns twice.It will return 0 to the newly created process (child process) and process id of child to the calling process(parent process).
The child process gets copy of parents data, stack and heap segement.The code segement is common for both.Both the processes will resume execution from the command next to fork.Scheduler decide which process to run first.
Question 12. Explain Linking Across Directories?
Answer :
It's possible through both symbolic and hard links. However, hard links are only possible if both source and destination belong to the same volume.
Question 13. What Is The Very First Process Created By Kernel?
Answer :
The first process in Unix is INIT.
Question 14. What Is The Process Id For Kernel Process?
Answer :
zero(0)
Question 15. What Is Semaphone?
Answer :
a semaphor is nothing but a term used in unix for a variable which acts as a counter.for instance there may be times when two processes try to access the same file simultaneously.in this event we must control the access of the when the other process is accessing this is done by assigning value to a semaphore.the value of the semaphore is initialized by the 1st process when the file is in access by it.when the 2nd process try to access the file it checks the value of the semaphore and if it finds the value as initialized it does not access the file.
Answer :
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/ipc.h>
#include<sys/types.h>
int main()
{
int p1[2],p2[2],i;
char buf[5];
pipe(p1);
pipe(p2);
if(fork()==0)
{
printf("n this is child(the input text is text)n");
close(p1[0]);
close(p2[1]);
write(p1[1],"text",5);
read(p2[0],buf,5);
write(1,buf,5);
}
else
{
printf("n this is parent(the output text is text)n");
close(p2[0]);
close(p1[1]);
read(p1[0],buf,5)
for(i=0;i<4;i++)
buf[i]=to upper(buf[i]);
write(p2[1],buf,5)
}
}
Question 17. What Are The System Calls Used For Process Management:
Answer :
The system calls for process management are :
and many more ................
Question 18. Describe The Initial Process Sequence While The System Boots Up?
Answer :
Question 19. What Is Ipc? What Are The Various Schemes Available?
Answer :
Inter Process Communication. IPC is used to pass information between two or more processes.Schemes are pipes, shared memory & semaphore.
Below are the different IPC methods:
Question 20. How Do You Execute One Program From Within Another?
Answer :
By calling system call fork() to create child process which handles the other.
Question 21. What Is An Advantage Of Executing A Process In Background?
Answer :
There are two main advantage :
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 process and will execute the command using exec command...something like suppose you gave command "ls" in the shell then...
fork();
exec(ls);
It will give you the result and after this the child process will die.
Answer :
The processes like vhand, bdflush, sched are housed in kernel file or /unix system which are known as daemons. These files run in the background without users request.These are created when the system boots up and remains active till it shut down or hang. These are not linked to any user or any terminal .We can't kill a daemon.
Question 24. Explain A Zombie?
Answer :
A system that has been taken over using Remote Control Software. Zombies are often used to send spam or to attack remote servers with an overwhelming amount of traffic (a Distributed Denial of Service Attack).
Unix Inter-Process Communication (IPC) Related Tutorials |
|
---|---|
Python Tutorial | Socket.IO Tutorial |
GDB Debugger Tutorial | Unix/Linux Tutorial |
Unix socket Tutorial |
Unix Inter-Process Communication (IPC) Related Practice Tests |
|
---|---|
Python Practice Tests | UNIX/XENIX Practice Tests |
Red Hat Linux Essentials Practice Tests | Red Hat Linux System Administration Practice Tests |
CorelDRAW Practice Tests | Java-Multithreading Practice Tests |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.