Top 60 Interview Questions & Answers on Operating System
- Posted by: BlogWriter
- Category: Interview_Questions
1. What is an operating system?
An operating system (OS) is system software that manages computer hardware and software resources and provides common services for computer programs.
2. What are the different operating systems?
- Batched operating systems
- Multi-programmed operating systems
- timesharing operating systems
- Distributed operating systems
- Real-time operating systems
3. What are the basic functions of an operating system?
An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers. Some popular Operating Systems include Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc.
4. What is kernel?
A kernel is the central part of an operating system. It manages the operations of the computer and the hardware – most notably memory and CPU time. There are two types of kernels: A microkernel, which only contains basic functionality; A monolithic kernel, which contains many device drivers.
5. What is difference between micro kernel and macro kernel?
Micro kernel is a kernel which run services those are minimal for operating system performance. In this kernel all other operations are performed by processor. Macro Kernel is a combination of micro and monolithic kernel. In monolithic kernel all operating system code is in single executable image.
6. What is dead lock?
A deadlock is a situation in which two computer programs sharing the same resource are effectively preventing each other from accessing the resource, resulting in both programs ceasing to function. The earliest computer operating systems ran only one program at a time.
7. What is a process?
A program in execution is called a process. Processes are of two types:
- Operating system processes
- User processes
8. What are the states of a process?
9. What is starvation and aging?
Starvation: 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.
Aging: Aging is a technique to avoid starvation in a scheduling system.
10. What is semaphore?
In computer science, a semaphore is a variable or abstract data type used to control access to a common resource by multiple processes in a concurrent system such as a multitasking operating system. Semaphore is simply a variable. This variable is used to solve critical section problems and to achieve process synchronization in the multi processing environment.
11. What is context switching?
A context switch (also sometimes referred to as a process switch or a task switch) is the switching of the CPU (central processing unit) from one process or thread to another. A process (also sometimes referred to as a task) is an executing (i.e., running) instance of a program.
12. What is a thread?
A thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system. … In particular, the threads of a process share its executable code and the values of its variables at any given time.
13. What is process synchronization?
Process Synchronization means sharing system resources by processes in a such a way that, Concurrent access to shared data is handled thereby minimizing the chance of inconsistent data. Maintaining data consistency demands mechanisms to ensure synchronized execution of cooperating processes.
14. What is virtual memory?
A computer can address more memory than the amount physically installed on the system. This extra memory is actually called virtual memory and it is a section of a hard disk that’s set up to emulate the computer’s RAM.
15. What is thrashing?
In a virtual storage system (an operating system that manages its logical storage or memory in units called pages), thrashing is a condition in which excessive paging operations are taking place.
16. What is fragmentation? Tell about different types of fragmentation?
When many of free blocks are too small to satisfy any request then fragmentation occurs. External fragmentation and internal fragmentation are two types of fragmentation. External Fragmentation happens when a dynamic memory allocation algorithm allocates some memory and a small piece is left over that cannot be effectively used. Internal fragmentation is the space wasted inside of allocated memory blocks because of restriction on the allowed sizes of allocated blocks.
17. What are necessary conditions for dead lock?
- Mutual exclusion (where at least one resource is non-sharable)
- Hold and wait (where a process holds one resource and waits for other resource)
- No preemption (where the resources can’t be preempted)
- Circular wait (where p[i] is waiting for p[j] to release a resource.
18. What is cache memory?
Cache memory, also called CPU memory, is high-speed static random access memory (SRAM) that a computer microprocessor can access more quickly than it can access regular random access memory (RAM).
19. What is logical and physical addresses space?
Address binding is the process of mapping from one address space to another address space. Logical address is address generated by CPU during execution whereas Physical Address refers to location in memory unit(the one that is loaded into memory).Note that user deals with only logical address(Virtual address).
20. Differentiate between Complier and Interpreter?
Interpreter: Translates program one statement at a time.
Compiler: Scans the entire program and translates it as a whole into machine code.
21. What is Throughput, Turnaround time, waiting time and Response time?
Throughput – number of processes that complete their execution per time unit
Turnaround time – amount of time to execute a particular process
Waiting time – amount of time a process has been waiting in the ready queue
Response time – amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment)
22. What is Memory-Management Unit (MMU)?
A memory management unit (MMU) is a computer hardware component that handles all memory and caching operations associated with the processor. In other words, the MMU is responsible for all aspects of memory management.
23. What is a Real-Time System?
A real-time operating system (RTOS) is an operating system (OS) intended to serve real-time applications that process data as it comes in, typically without buffer delays. Processing time requirements (including any OS delay) are measured in tenths of seconds or shorter increments of time.
24. What is a trap and trapdoor?
- Trapdoor is a secret undocumented entry point into a program used to grant access without normal methods of access authentication. A trap is a software interrupt, usually the result of an error condition.
25. When is a system in safe state?
A state is safe if the system can allocate resources to each process (up to its maximum) in some order and still avoid a deadlock. More formally, a system is in a safe state only if there exists a safe sequence.
26. Explain the concept of the Distributed systems?
Distributed systems work in a network. They can share the network resources, communicate with each other.
27. What is cache-coherency?
Cache coherence is the uniformity of shared resource data that ends up stored in multiple local caches. When clients in a system maintain caches of a common memory resource, problems may arise with incoherent data, which is particularly the case with CPUs in a multiprocessing system.
28. What is a long term scheduler & short term schedulers?
Long term schedulers are the job schedulers that select processes from the job queue and load them into memory for execution. The short term schedulers are the CPU schedulers that select a process from the ready queue and allocate the CPU to one of them.
29. Explain the meaning of mutex.
In computer programming, a mutual exclusion object (mutex) is a program object that allows multiple program threads to share the same resource, such as file access, but not simultaneously.
30. What is cycle stealing?
Traditionally cycle stealing is a method of accessing computer memory (RAM) or bus without interfering with the CPU. It is similar to direct memory access (DMA) for allowing I/O controllers to read or write RAM without CPU intervention.
31. What is Marshalling?
In computer science, marshalling or marshaling is the process of transforming the memory representation of an object to a data format suitable for storage or transmission, and it is typically used when data must be moved between different parts of a computer program or from one program to another.
32. What is a daemon?
A daemon is a long-running background process that answers requests for services. The term originated with Unix, but most operating systems use daemons in some form or another. In Unix, the names of daemons conventionally end in “d”. Some examples include inetd , httpd , nfsd , sshd , named , and lpd .
33. What is pre-emptive and non-preemptive scheduling?
Preemptive scheduling: The preemptive scheduling is prioritized. The highest priority process should always be the process that is currently utilized.
Non-Preemptive scheduling: When a process enters the state of running, the state of that process is not deleted from the scheduler until it finishes its service time.
34. What is busy waiting?
In software engineering, busy-waiting, busy-looping or spinning is a technique in which a process repeatedly checks to see if a condition is true, such as whether keyboard input or a lock is available.
35. What is page cannibalizing?
Page swapping or page replacements are called page cannibalizing.
36. What is SMP?
Symmetric multiprocessing (SMP) is a computing architecture in which two or more processors are attached to a single memory and operating system (OS) instance. SMP combines multiple processors to complete a process with the help of a host OS, which manages processor allocation, execution and management.
37. What is process migration?
In computing, process migration is a specialized form of process management whereby processes are moved from one computing environment to another.
38. Difference between Primary storage and secondary storage?
Primary memory is the main memory (Hard disk, RAM) where the operating system resides. Secondary memory can be external devices like CD, floppy magnetic discs etc. secondary storage cannot be directly accessed by the CPU and is also external memory storage.
39. Define compactions.
Compaction is a process in which the free space is collected in a large memory chunk to make some space available for processes. In memory management, swapping creates multiple fragments in the memory because of the processes moving in and out. Compaction refers to combining all the empty spaces together and processes.
40. What are residence monitors?
A resident monitor is a type of system software program that was used in many early computers from the 1950s to 1970s. It can be considered a precursor to the operating system. The name is derived from a program which is always present in the computer’s memory thus being “resident”.
41. What is dual-mode operation?
In order to protect the operating systems and the system programs from the malfunctioning programs the two mode operations were evolved System mode User mode.
42. What is a device queue?
Waiting (Device) Queues: The set of processes waiting for allocation of certain I/O devices is kept in the waiting (device) queue. The short-term scheduler (also known as CPU scheduling) selects a process from the ready queue and yields control of the CPU to the process.
43. What are the different types of Real-Time Scheduling?
Hard real-time systems required to complete a critical task within a guaranteed amount of time. Soft real-time computing requires that critical processes receive priority over less fortunate ones.
44. What is relative path and absolute path?
A full path or absolute path is a path that points to the same location on one file system regardless of working directory or combined path. It is usually written in reference to a root directory. A relative path is the path related to the current working directory.
45. What are the disadvantages of context switching?
Time taken for switching from one process to other is pure over head. Because the system does no useful work while switching. So one of the solutions is to go for threading when ever possible.
46. What is a data register and address register?
Data registers – can be assigned to a variety of functions by the programmer. They can be used with any machine instruction that performs operations on data. Address registers – contain main memory addresses of data and instructions or they contain a portion of the address that is used in the calculation of the complete addresses.
47. What is DRAM?
Dynamic random access memory (DRAM) is a type of memory that is typically used for data or program code that a computer processor needs to function. DRAM is a common type of random access memory (RAM) used in personal computers (PCs), workstations and servers.
48. What are local and global page replacements?
Local replacement means that an incoming page is brought in only to the relevant process’ address space. Global replacement policy allows any page frame from any process to be replaced. The latter is applicable to variable partitions model only.
49. Explain the concept of the batched operating systems?
In batched operating system the users gives their jobs to the operator who sorts the programs according to their requirements and executes them. This is time consuming but makes the CPU busy all the time.
50. What is SCSI?
SCSI – Small computer systems interface is a type of interface used for computer components such as hard drives, optical drives, scanners and tape drives. It is a competing technology to standard IDE (Integrated Drive Electronics).
51. When is a system in safe state?
The set of dispatchable processes is in a safe state if there exists at least one temporal order in which all processes can be run to completion without resulting in a deadlock.
52. What is cycle stealing?
We encounter cycle stealing in the context of Direct Memory Access (DMA). Either the DMA controller can use the data bus when the CPU does not need it, or it may force the CPU to temporarily suspend operation. The latter technique is called cycle stealing. Note that cycle stealing can be done only at specific break points in an instruction cycle.
53. What is an idle thread?
In Windows NT operating systems, the System Idle Process contains one or more kernel threads which run when no other runnable thread can be scheduled on a CPU. In a multiprocessor system, there is one idle thread associated with each CPU core.
54. What is FtDisk?
FT Disk allows you to utilize redundant storage in Windows NT 4.0 and later. It gives you a wide variety of disk service abilities, including the ability to restore lost data. Founded in 1975, Microsoft’s flagship product is the Windows operating system, which is installed on over 90% of workstations worldwide.
55. What is Dispatcher?
Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves: Switching context, Switching to user mode, Jumping to the proper location in the user program to restart that program, dispatch latency – time it takes for the dispatcher to stop one process and start another running.
56. When does the condition ‘rendezvous’ arise?
In message passing, it is the condition in which, both, the sender and receiver are blocked until the message is delivered.
57. What is process spawning?
When the OS at the explicit request of another process creates a process, this action is called process spawning
58. What are the reasons for process suspension?
swapping,interactive user request,timing,parent process request.
59. What are the sub-components of I/O manager in Windows NT?
Network redirector or Server,Cache manager,File systems,Network driver,Device driver.
60. What is a drawback of MVT?
An Operating System is a collection of system programs that manages all the other programs application programs in a computer as well as the allocation and use of hardware resources such as the CPU, Memory and the Hard Disk Drive. It acts as an interface between the hardware and the user level program.