Operating System Interview Questions and Answers:

Following are the below Operating System Interview Questions and Answers, Operating System Important Questions and Answers

1. Define Operating Systems.

Ans. An Operating system is a program that manages the computer hardware. It provides a basis for application programs and acts as an intermediary between a user of a computer and the computer hardware.


2. What are the advantages of cooperating processes?

Ans.

  • Information sharing
  • Computation speed-up
  • Modularity
  • Convenience

3. Define ‘monitor’. What does it consist of?

Ans. A high level abtraction that provides a convenient and effective mechahism for process synchronization. It has shared data, a set of atomic operations of that data, a set of condition variables.


4. What are the disadvantages of single contiguous memory allocation?

Ans. Time in the main constraint in contigous memory allocation, as it takes much time to compact the whole disk, especially in the case of hard disks.


5. What is demand paging?

Ans. A demand paging system is similar to a paging system with swapping.


6. Differentiate absolute path from relative path.

Ans. An absolute path name begins at the root and follows a path down to the specific file, giving the directory names on the path.

A relative path name defines a path from the current directory.


7. Define mirroring and shadowing.

Ans.

Shadowing – Disk shadowing is a technique for maintaining a set of two or more identical disk images on separate disk devices.

Mirroring – Disk mirror stores the same data to two separate disks at once.


8. Define a Process.

Ans. A process is a program in execution. A process needs certain resources including CPU time, membry, files and I/o devices to accomplish its task.


9. What are four necessary conditions for deadlock to-occur?

Ans. Mutual exclusion hold and wait, no preemption, circular wait.


10. What is the difference between simple paging and virtual memory paging?

Ans. Paging is a memory management scheme that permits the physical address spare of a process to be noncontiguous.

A demand paging system is similar to a paging system with swapping.


11. What is principle of locality?

Ans. As a process executes, it moves from locality to locality. A locality is a set of pages that are actively used together. A program is generally composed of several difference localities, which may overlap.


12. List the file attributes.

Ans. File attributes – Name, identifier, type, locality size, protection, time date and user identification.


13. Define seek time and rotational latency.

Ans.

Seek time – It is the time for the disk arm to move the heads to the cylinder containing the desired sector.

Rotational latency – It is additional time waiting for the disk to rotate the desired sector to the disk head.


14. How do you improve I/O performance?

Ans. Principles to improve the efficiency of I/O :

  • Reduce the no. of content switches.
  • Reduce the no. of time that data must be copied in memory while passing between device and application.

15. What is a bootstrap program?

Ans. A bootstrap is the process of starting up a computer. It also refers to the program that initializes the OS during start-up.


16. Define context switch.

Ans. When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process.


17. Differentiate preemptive from non-preemptive scheduling.

Ans.

Non preemptive : Once CPU given to the process it cannot be preempted until it completes its CPU burst.

Preemptive : It a new process arrives with CPU burst length less than remaining time if current executing process, preept.


18. Is it possible to have a deadlock involving only one process? State your answer.

Ans. No. this follows directly from the hold-and-wait condition.


19. What is an overlay? What is the use of it?

Ans. An overlay is the act of a process replacing itself with the code of another program.


20. Define thrashing.

Ans. A program causing page faults every few instructions is said to be thrashing.


21. Name any four common file types.

Ans.

  • Executable file
  • Object file
  • Batch file
  • Text file

22. What is NFS?

Ans. A network attached storage device is a special purpose storage system that is accessed remotely over a data network.


23. What is trap?

Ans. A trap usually results in a switch to kernel mode, where in the operating system performs some action before returning control to the orginating process.


24. What do you mean by WORM disk?

Ans.

  • The data on read-write disks can be modified over and over.
  • WORM (“Write Once, Read Many Times”) disks can be written only once.
  • Thin aluminum film sandwiched between two glass or plastic platters.
  • To write a bit, the drive uses a laser light to burn a small hole through the aluminum; information can be destroyed by not altered.
  • Very durable and reliable.
  • Read Only disks, such ad CD-ROM and DVD, com from the factory with the data pre-recorded.

25. What is virtual machine?

Ans. A virtual machine takes the layered approach to its logical conclusion. It treats hardware and the operating system kernel as though they were all hardware.


26. What is system a call and what are the types of system call?

Ans.

System calls provide the interface between a running program and the operating system.

  • Generally available as assembly-language instructions.
  • Languages defined to replace assembly language for systems programming allow system calls to be made directly (e.g., C, Bliss, PL/360).

System calls can be roughly grouped into five major categories:

  • process control
  • file manipulation
  • device manipulation
  • information maintenance
  • comunications

27. What is meant by starvation in operating system?

Ans. Starvation is a resource management problem where a process does not get the resources it needs for a long time because the resources are being allocated to other processes.


28. What is a critical section and what requirements must a solution to the critical section problem satisfy?

Ans. n processes competing to use some shared data, where each process has a code segment, called critical section, in which the shared data is accessed. To ensure that when one process is executing in its critical section, no other process is allowed to execute in its critical section.

A solution to the Critical Section problem must satisfy:

  • Mutual Exclusion
  • Progress
  • Bounded Waiting

29. Differentiate between page and segment.

Ans.

Segment : The address space is typically divided into a preset number. of segments like data segment (not equal size)

Page : The address space is divided into fixed size unit called pages.


30. Differentiate between internal and external fragmentation.

Ans. Internal fragmentation is the area in a region or a page that is not used by the job, occupying that region or page. This space is unavailable for use by the system until the job is finished and the page or region is released.


31. What is a file Management system?

Ans. The system that an operating system or program uses to organize and keep pack of files.


32. What are the disadvantages of log-structured file systems?

Ans. The transactions in the log are asynchronously writen to the file-system. When the file system is modified, the transaction is removed from the log.


33. What are device drivers?

Ans. Device driver layer hides differences among I/O controllers from kernel.


34. What is tertiary storage?

Ans. Tertiary storage is built using removable media. Eg: Flopp disks and CD-Roms.


35. What are the reasons for providing process cooperation?

Ans. Advantages of process cooperation

  • Information sharing
  • Computation speed-up
  • Modularity
  • Convenience

36. List out any four scheduling criteria.

Ans.

  • First-come first serve scheduling
  • Shortest-job first scheduling
  • Priority scheduling
  • Round- Robin scheduling

37. What is a safe state?

Ans. When a process requests an available resource, system must decide if immediate allocation leaves the system in a safe state.

System is in safe state if there exists a safe sequence of all processes.


38. What is a working-set model?

Ans. The working set model is based on the assumption of locality. The idea is to examine the most recent page veterences. If the page is in active use, it will be in the working set. If it is no longer being used, it will drop from the working set.


39. How the problem of external fragmentation can be solved?

Ans. One solution to the problem of external fragmentation is compation. The goal is to shuffle the memory contents as to place all free memory together in one large block.


40. What are the attributes of files?

Ans. A file has certain other attributes, which vary from one operations system to another, but typically consistof these:

Operating System Interview Questions and Answers


41. Define log structured file.

Ans. It is a file in which data and meta data are written sequentially to a circular buffer, called a log.


42. Give the various Disk scheduling methods.

Ans.

  • FCFS scheduling
  • SSTF scheduling
  • Scan scheduling
  • C-Scan scheduling
  • Look scheduling

43. What is meant by RAID ( Redundant Array of Inexpensive Disks)?

Ans. Redundant array of inexpensive disks is a series (raido and raid5) of increasing reliable and expensive ways of organising multiple physical hard disks into groups that work as a single logical disk.