Operating Systems Interview Questions – Part III

Ankur Kulhari

  1. How does swapping result in better memory management?
  2. Ans:During regular intervals that are set by the operating system, processes can be copied from
    main memory to a backing store, and then copied back later. Swapping allows more processes to be run that can fit into memory at one time.

  3. Give an example of a Process State.
  4. Ans:Process may be in any state at a time out of the following:

    • New State – means a process is being created
    • Running – means instructions are being executed
    • Waiting – means a process is waiting for certain conditions or events to occur
    • Ready – means a process is waiting for an instruction from the main processor
    • Terminate – means a process is done executing
  5. What is a socket?
  6. Ans:A socket provides a connection between two applications. Each endpoint of a communication is a socket.

  7. What is Direct Access Method?
  8. Ans:Direct Access method is based on a disk model of a file, such that it is viewed as a numbered sequence of blocks or records. It allows arbitrary blocks to be read or written. Direct access is advantageous when accessing large amounts of information.

  9. When does trashing occur?
  10. Ans:Trashing refers to an instance of high paging activity. This happens when it is spending more
    time paging instead of executing.

  11. What is the best page size when designing an operating system?
  12. Ans:The best paging size varies from system to system, so there is no single best when it comes to
    page size. There are different factors to consider in order to come up with a suitable page size, such as page table, paging time, and its effect on the overall efficiency of the operating system.

  13. When designing the file structure for an operating system, what attributes are considered?
  14. Ans:Typically, the different attributes for a file structure are naming, identifier, supported file types, and location for the files, size, and level of protection.

  15. What is root partition?
  16. Ans:Root partition is where the operating system kernel is located. It also contains other potentially important system files that are mounted during boot time.

  17. What are device drivers?
  18. Ans:Device drivers provides a standard means of representing I/O devices that maybe manufactured
    by different companies. This prevents conflicts whenever such devices are incorporated in a systems unit.

  19. What are the primary functions of VFS?
  20. Ans:VFS, or Virtual File System, separates file system generic operations from their implementation
    by defining a clean VFS interface. It is also based on a file-representation structure known as vnode, which contains a numerical designator needed to support network file systems.

  21. What are the different types of CPU registers in a typical operating system design?
  22. Ans:A CPU contains:

    • Accumulators
    • Index Registers
    • Stack Pointer
    • General Purpose Registers

What do you think about the article?