FreeJobAlert.Com

Government Jobs | Results | Admit Cards

unix interview questions | Part4

If you would like to view All operating system interview questions only at one place visit below link

All UNIX Interview Questions

25. What is ‘ps’ command for?
Ans: The ps command prints the process status for some or all of the running processes. The information given are the process identification number (PID),the amount of time that the process has taken to execute so far etc.

26. How would you kill a process?
Ans: The kill command takes the PID as one argument; this identifies which process to terminate. The PID of a process can be got using ‘ps’ command.

27. What is an advantage of executing a process in background?
Ans: The most common reason to put a process in the background is to allow you to do something else interactively without waiting for the process to complete. At the end of the command you add the special background symbol, &. This symbol tells your shell to execute the given command in the background.
Example: cp *.* ../backup& (cp is for copy)

28. How do you execute one program from within another?
Ans: The system calls used for low-level process creation are execlp() and execvp(). The execlp call overlays the existing program with the new one , runs that and exits. The original program gets back control only when an error occurs. execlp(path,file_name,arguments..); //last argument must be NULL A variant of execlp called execvp is used when the number of arguments is not known in advance. execvp(path,argument_array); //argument array should be terminated by NULL

29. What is IPC? What are the various schemes available?
Ans: The term IPC (Inter-Process Communication) describes various ways by which different process running on some operating system communicate between each other. Various schemes available are as follows: Pipes:
One-way communication scheme through which different process can communicate. The problem is that the two processes should have a common ancestor (parent-child relationship). However this problem was fixed with the introduction of named-pipes (FIFO).
Message Queues :
Message queues can be used between related and unrelated processes running on a machine.
Shared Memory:
This is the fastest of all IPC schemes. The memory to be shared is mapped into the address space of the processes (that are sharing). The speed achieved is attributed to the fact that there is no kernel involvement. But this scheme needs synchronization.
Various forms of synchronization are mutexes, condition-variables, read-write locks, record-locks, and semaphores.

30. What is the difference between Swapping and Paging?
Ans: Swapping: Whole process is moved from the swap device to the main memory for execution. Process size must be less than or equal to the available main memory. It is easier to implementation and overhead to the system. Swapping systems does not handle the memory more flexibly as compared to the paging systems.
Paging:
Only the required memory pages are moved to main memory from the swap device for execution. Process size does not matter. Gives the concept of the virtual memory.
It provides greater flexibility in mapping the virtual address space into the physical memory of the machine. Allows more number of processes to fit in the main memory simultaneously. Allows the greater process size than the available physical memory. Demand paging systems handle the memory more flexibly.

31. What is major difference between the Historic Unix and the new BSD release of Unix System V in terms of Memory Management?
Ans: Historic Unix uses Swapping – entire process is transferred to the main memory from the swap device, whereas the Unix System V uses Demand Paging – only the part of the process is moved to the main memory. Historic Unix uses one Swap Device and Unix System V allow multiple Swap Devices.

32. What is the main goal of the Memory Management?
Ans: It decides which process should reside in the main memory, Manages the parts of the virtual address space of a process which is non-core resident, Monitors the available main memory and periodically write the processes into the swap device to provide more processes fit in the main memory simultaneously.

33. What is a Map?
Ans: A Map is an Array, which contains the addresses of the free space in the swap device that are allocatable resources, and the number of the resource units available there.
This allows First-Fit allocation of contiguous blocks of a resource. Initially the Map contains one entry – address (block offset from the starting of the swap area) and the total number of resources. Kernel treats each unit of Map as a group of disk blocks. On the allocation and freeing of the resources Kernel updates the Map for accurate information.

34. What scheme does the Kernel in Unix System V follow while choosing a swap device among the multiple swap devices?
Ans: Kernel follows Round Robin scheme choosing a swap device among the multiple swap devices in Unix System V.

Related Fresher Interview Questions

1. C Language Interview Questions
2. C++ Language Interview Questions
3. Data Structures Interview Questions
4. DBMS Interview Questions
5. Operating System Interview Questions
6. UNIX Interview Questions

Tags: basic unix interview questions, General UNIX interview questions, Some UNIX Interview Questions, unix commands, unix interview, unix interview faq, unix interview questions, Unix Interview Questions And Answers, unix interview questions and answers for freshers, unix interview questions and answers pdf, unix interview questions for freshers, unix interview questions with answers, unix shell scripting interview questions

Responses to “unix interview questions | Part4”

  1. its nice for me

Leave a Comment