Interview Centric Questions Flashcards

(348 cards)

1
Q

What is IPC?

A

Interprocess Communication (IPC) is a mechanism that allows different processes to communicate with each other using shared resources like memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the different IPC mechanisms?

A

Different IPC mechanisms include:
* Pipes
* Message Queuing
* Semaphores
* Socket
* Shared Memory
* Signals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the main purpose of an OS?

A

The main purpose of an OS is to execute user programs and manage computational activities, including memory, processes, and hardware/software operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the different types of OS?

A

Types of OS include:
* Batched OS
* Multi-Programmed OS
* Timesharing OS
* Distributed OS
* Real-Time OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a multiprocessor system?

A

A multiprocessor system includes two or more CPUs and allows processing of different programs simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the benefits of a multiprocessor system?

A

Benefits include:
* Improved performance
* Increased throughput
* Cost-effectiveness
* Enhanced reliability

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is RAID structure in OS?

A

RAID (Redundant Arrays of Independent Disks) is a method for data storage that combines multiple hard disks for data protection and performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the different levels of RAID configuration?

A

Different levels of RAID include:
* RAID 0
* RAID 1
* RAID 2
* RAID 3
* RAID 4
* RAID 5
* RAID 6

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is GUI?

A

GUI (Graphical User Interface) is a user interface that allows users to interact with the OS using graphics instead of text commands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a Pipe?

A

A pipe is a connection among two or more processes used for inter-process communication through message passing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What operations are possible on a semaphore?

A

Two atomic operations possible on a semaphore are:
* Wait()
* Signal()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a bootstrap program in OS?

A

A bootstrap program initializes the OS during startup and is responsible for loading the kernel into main memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is demand paging?

A

Demand paging loads pages into memory only when they are needed during execution, primarily used in virtual memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is RTOS?

A

Real-Time Operating System (RTOS) is used for applications requiring data processing within a fixed time frame.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What types of RTOS exist?

A

Types of RTOS include:
* Hard Real-Time
* Firm Real-Time
* Soft Real-Time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is process synchronization?

A

Process synchronization is a method to coordinate processes that use shared resources to maintain data consistency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Why is the operating system important?

A

The OS is essential for enabling interaction between software and users, managing hardware, and providing a platform for running applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the difference between main memory and secondary memory?

A

Main memory is RAM and volatile, while secondary memory is non-volatile storage like hard drives.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are overlays in OS?

A

Overlays is a programming method that divides processes into pieces to run programs larger than physical memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What are some examples of OS?

A

Examples of OS include:
* MS-Windows
* Ubuntu
* Mac OS
* Fedora
* Solaris
* Free BSD
* Chrome OS
* CentOS
* Debian
* Android

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is thrashing in OS?

A

Thrashing occurs when the CPU spends more time swapping or paging than executing processes, leading to degraded performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the main objective of multiprogramming?

A

The main objective of multiprogramming is to execute multiple programs on a single processor to improve CPU utilization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is asymmetric clustering?

A

Asymmetric Clustering is a system where one node is in hot standby mode while others run different applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the difference between multitasking and multiprocessing OS?

A

Multitasking uses one CPU for multiple tasks; multiprocessing uses multiple CPUs for executing different parts of the same program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What is a socket in OS?
A socket is an endpoint for IPC, combining an IP address and port number to facilitate communication.
26
What is a zombie process?
A zombie process is a completed process that still has an entry in the process table, indicating it has not been fully cleaned up.
27
What is cascading termination?
Cascading termination occurs when a parent process's exit causes its child processes to also terminate.
28
What are starvation and aging in OS?
Starvation is when low-priority processes are blocked from resources; aging increases the priority of long-waiting processes to avoid starvation.
29
What is starvation in operating systems?
A problem where low priority processes are blocked and only high priority processes proceed towards completion.
30
What is aging in the context of operating systems?
A technique that increases the priority of processes waiting for resources to prevent starvation.
31
What is paging?
A memory management technique that retrieves processes from secondary storage into main memory in fixed-size pages.
32
What is segmentation?
A memory management technique that divides processes into modules of different sizes known as segments.
33
What is a key difference between paging and segmentation?
Paging is invisible to programmers and has fixed page sizes, while segmentation is visible and has variable segment sizes.
34
What is virtual memory?
A memory management technique that creates the illusion of a larger main memory by using disk space.
35
What is a thread in operating systems?
A path of execution within a process, consisting of a program counter, thread id, stack, and registers.
36
What are the different states of a process?
New, Running, Waiting, Ready, Terminate.
37
What does FCFS stand for?
First Come First Serve.
38
What is a key characteristic of the FCFS scheduling algorithm?
It executes processes in the order they arrive and is non-preemptive.
39
What is reentrancy in operating systems?
A function that allows multiple clients to use a single copy of a program simultaneously.
40
What is a scheduling algorithm?
A process used to allocate resources among competing tasks to improve CPU efficiency.
41
Name the different types of kernels.
* Monolithic Kernel * MicroKernel * Hybrid Kernel * Nano Kernel * Exo Kernel
42
What is a semaphore in operating systems?
A synchronization mechanism used to control access to shared resources.
43
What are the two main types of semaphores?
* Binary semaphore * Counting semaphore
44
What is the role of the kernel in an operating system?
To manage and control all operations of computer systems and hardware.
45
What is the difference between a microkernel and a monolithic kernel?
* MicroKernel: Minimal OS with essential functions * Monolithic Kernel: Supports all basic features of computer components
46
What is SMP in computing?
Symmetric Multiprocessing, where multiple processors share a common OS and memory.
47
What is context switching?
The process of saving the context of one process and loading the context of another.
48
What is the difference between a kernel and an operating system?
* Kernel: Central component managing hardware and software * OS: System software providing user interface and resource management
49
What is the difference between a process and a thread?
* Process: A program in execution * Thread: The smallest execution unit within a process
50
What are the four sections of a process?
* Stack * Heap * Data * Code or text
51
What is a deadlock in operating systems?
A situation where processes are blocked, each holding resources and waiting for others.
52
What are the necessary conditions for a deadlock?
* Mutual Exclusion * Hold and Wait * No Pre-emption * Circular Wait
53
What is Belady's Anomaly?
A phenomenon where increasing the number of frames in memory leads to more page faults.
54
What does spooling stand for in operating systems?
Simultaneous Peripheral Operations Online.
55
What is a process table?
A data structure maintained by the OS to manage processes, including their states and resource allocations.
56
What is a process?
An instance of a program in execution.
57
What is a process table?
A table maintained by the operating system that lists every process along with the resources it is using and its current state.
58
What are the different states of a process?
Processes can be in one of three states: *running, *ready, *waiting.
59
What does the running state of a process mean?
The process has all resources needed for execution and permission to use the processor.
60
What is a thread?
A single sequence stream within a process, often called a lightweight process.
61
What are the differences between process and thread?
Process is a program in action; thread is the smallest segment of a process that can be scheduled independently.
62
What are the benefits of multithreaded programming?
*Increased responsiveness, *resource sharing, *utilization of multiprocess architecture.
63
What is thrashing?
A situation where a computer's performance degrades due to excessive page faults.
64
What is a buffer?
A memory area that stores data being transferred between devices or between a device and an application.
65
What is virtual memory?
A memory management technique that creates an illusion of a large address space using disk space to extend RAM.
66
What is the main purpose of an operating system?
To act as an intermediary between the user and computer hardware, providing an environment for program execution.
67
What is demand paging?
Loading a page into memory only when a page fault occurs.
68
What is a kernel?
The central component of an operating system that manages memory and CPU operations.
69
What are the different scheduling algorithms?
*First-Come, First-Served (FCFS), *Shortest-Job-Next (SJN), *Priority Scheduling, *Shortest Remaining Time, *Round Robin (RR), *Multiple-Level Queues.
70
What is the objective of multi-programming?
To increase CPU utilization by keeping multiple jobs in main memory.
71
What is a time-sharing system?
An extension of multiprogramming that allows multiple users to share computers simultaneously.
72
What problems are faced without an operating system?
*Poor resource management, *lack of user interface, *no file system, *no networking, *error handling.
73
What is FCFS?
First-Come, First-Served scheduling algorithm where the first job in the queue is allocated to the CPU.
74
What is the RR scheduling algorithm?
A scheduling algorithm that allocates a fixed time slot for processes, allowing for fair sharing of CPU resources.
75
Enumerate the different RAID levels.
*Level-0, *Level-1, *Level-2, *Level-3, *Level-4, *Level-5, *Level-6.
76
What is the Banker’s algorithm?
A resource allocation and deadlock avoidance algorithm that tests for safety by simulating resource allocation.
77
What is the main difference between logical and physical address space?
Logical addresses are generated by the CPU; physical addresses are located in memory.
78
How does dynamic loading aid in better memory space utilization?
A routine is loaded only when called, useful for infrequently occurring cases.
79
What are overlays?
The process of loading only parts of a program into memory as needed.
80
What is fragmentation?
When free memory space is too small to be used for different processes.
81
What is the basic function of paging?
A technique used for non-contiguous memory allocation by dividing memory into fixed-size partitions.
82
How does swapping result in better memory management?
It moves blocked processes to secondary memory, allowing more processes to be executed concurrently.
83
Name some classic synchronization problems.
*Bounded-buffer, *Readers-writers, *Dining philosophers, *Sleeping barber.
84
What is the Direct Access Method?
A method allowing arbitrary blocks to be read or written based on a disk model of a file.
85
When does thrashing occur?
When processes frequently access pages that are not available in memory.
86
What is the best page size when designing an operating system?
It varies by system; factors include page table size and paging time.
87
What is multitasking?
A system that supports multiple programs running concurrently.
88
What is caching?
A smaller, faster memory that stores copies of frequently accessed data from main memory.
89
What is spooling?
The process of placing jobs in a buffer for devices to access when ready.
90
What is the functionality of an Assembler?
To translate assembly language into machine code.
91
What are interrupts?
Signals emitted by hardware or software that require immediate attention from the processor.
92
What is GUI?
Graphical User Interface, allowing users to interact with programs using graphical elements.
93
What is preemptive multitasking?
A type of multitasking that allows sharing of OS resources through predefined criteria.
94
What is a pipe and when is it used?
A technique for inter-process communication directing output from one process to another.
95
What are the advantages of semaphores?
*Machine-independent, *easy to implement, *correctness is easy to determine, *can manage multiple critical sections.
96
What is a bootstrap program in the OS?
Instructions loaded during startup to initialize the OS and perform diagnostic tests.
97
What is IPC?
Inter-process communication, allowing processes to communicate and synchronize actions.
98
What are the different IPC mechanisms?
*Pipes, *Named Pipes, *Message Queuing, *Semaphores.
99
What is a Named Pipe?
A pipe with a specific name that can be used in processes without a shared common process origin ## Footnote E.g., FIFO where details are written to a pipe that is first named.
100
What is Message Queuing?
A method that allows messages to be passed between processes using one or several message queues, managed by the system kernel ## Footnote Messages are coordinated using an API.
101
What are Semaphores used for?
To solve problems associated with synchronization and avoid race conditions ## Footnote Semaphores are integer values that are greater than or equal to 0.
102
What is Shared Memory?
An area of memory that allows interchange of data between processes ## Footnote Semaphore values must be obtained before accessing shared memory.
103
What are Sockets primarily used for?
To communicate over a network between a client and a server ## Footnote Sockets provide a standard connection that is computer and OS independent.
104
What is the difference between preemptive and non-preemptive scheduling?
In preemptive scheduling, CPU is allocated for a limited time; in non-preemptive scheduling, allocation continues until the process terminates or waits ## Footnote Preemptive scheduling can interrupt executing processes, while non-preemptive does not.
105
What is a zombie process?
A process that has completed execution but still has an entry in the process table to report to its parent ## Footnote The parent process reads the exit status to remove the entry.
106
What defines an orphan process?
A process whose parent no longer exists, either finished or terminated without waiting for the child ## Footnote Orphan processes are often adopted by the init process.
107
Define starvation in operating systems.
A resource management problem where a process does not receive the resources it needs for a long time due to allocation to other processes.
108
What is aging in OS?
A technique to avoid starvation by increasing the priority of requests over time ## Footnote Ensures that requests eventually become the highest priority.
109
What is a Monolithic Kernel?
A kernel where user services and kernel services are implemented under the same address space, increasing kernel size and OS size ## Footnote It provides CPU scheduling, memory management, and file management through system calls.
110
What is Context Switching?
The process of saving the state of the old process and loading the saved state for a new process ## Footnote Context switching uses the Process Control Block to store the process state.
111
What is the difference between an Operating System and a Kernel?
An Operating System is system software providing an interface between the user and hardware; the Kernel is the core component managing system resources ## Footnote Types of operating systems include single and multiuser; types of kernels include Monolithic and Microkernel.
112
What is the difference between a process and a thread?
A process is an executing program; a thread is a segment of a process ## Footnote Threads are lightweight and share memory, while processes are heavyweight and isolated.
113
What is a Process Control Block (PCB)?
A block used to track a process's execution status, containing information such as registers, quantum, and priority ## Footnote The process table is an array of PCBs for all current processes.
114
When is a system considered to be in a safe state?
When there exists at least one temporal order in which all processes can run to completion without resulting in a deadlock.
115
What is Cycle Stealing?
A method of accessing computer memory or bus without interfering with the CPU ## Footnote Similar to direct memory access (DMA) allowing I/O controllers to read/write RAM without CPU intervention.
116
Define a trap in operating systems.
A software interrupt, usually resulting from an error condition, with the highest priority ## Footnote A trapdoor is a secret undocumented entry point used for access without normal authentication.
117
What is the difference between a program and a process?
A program is a passive entity residing in secondary memory; a process is an active entity created during execution ## Footnote Processes have resource requirements and control blocks, while programs do not.
118
What is a dispatcher?
The module that gives process control over the CPU after selection by the short-term scheduler ## Footnote Functions include switching context and jumping to the user program's location.
119
Define dispatch latency.
The amount of time it takes for a system to respond to a request for a process to begin operation.
120
What are the goals of CPU scheduling?
Max CPU utilization, fair allocation of CPU, max throughput, min turnaround time, min waiting time, min response time ## Footnote These goals optimize process execution and resource management.
121
What is a critical section?
A segment of code accessed by multiple processes that contains shared variables or resources needing synchronization ## Footnote It must be executed atomically to maintain data consistency.
122
List synchronization techniques.
* Mutexes * Condition variables * Semaphores * File locks
123
What is the difference between user-level threads and kernel-level threads?
User-level threads are implemented by users and not recognized by the OS; kernel threads are implemented by the OS and recognized by it ## Footnote Context switch time is less for user-level threads.
124
What are the advantages of multithreading?
* Improved throughput * Superior application responsiveness * Improved server responsiveness * Minimized system resource usage * Program structure simplification * Better communication
125
What is the difference between Multithreading and Multitasking?
Multithreading involves multiple threads executing within the same program; multitasking involves multiple programs executing concurrently ## Footnote Multithreading is a feature of processes, while multitasking is a feature of the OS.
126
What are the drawbacks of semaphores?
* Priority Inversion * Use is by convention, not enforced * Programmer must track wait and signal calls * Improper use can lead to deadlock
127
What is Peterson's approach?
A concurrent programming algorithm used to synchronize two processes for mutual exclusion using a bool array and an integer variable.
128
Define bounded waiting.
A condition where a process wanting to enter a critical section will do so within some finite time.
129
What are the solutions to the critical section problem?
* Software solutions * Hardware solutions * Semaphores
130
What is the Banker's algorithm?
A resource allocation and deadlock avoidance algorithm that tests for safety by simulating the allocation of resources before deciding on continuation.
131
What is concurrency?
A state where processes exist simultaneously with another process.
132
What is a drawback of concurrency?
It requires additional mechanisms for protection and coordination, leading to performance overheads and complexities.
133
What conditions can lead to a deadlock in a system?
* Mutual Exclusion * Hold and Wait * No Preemption * Circular Wait
134
What issues are related to concurrency?
* Non-atomic operations * Race conditions * Blocking * Starvation * Deadlock
135
Why do we use precedence graphs?
To show execution levels of processes in the OS, with nodes representing statements and edges representing execution order.
136
What is a resource allocation graph?
A diagram that represents the state of processes and resources in the system, helping to identify deadlocks.
137
What is a deadlock?
A situation where two or more processes wait indefinitely for each other to finish.
138
What are the goals of memory management?
* Relocation * Protection * Sharing * Logical organization * Physical organization
139
What is the difference between a physical address and a logical address?
A logical address is a virtual address generated by the CPU; a physical address is the actual location in memory.
140
What is the goal and functionality of memory management?
The goal and functionality of memory management include: * Relocation * Protection * Sharing * Logical organization * Physical organization ## Footnote Memory management optimizes the use of a computer's RAM and ensures that processes operate effectively.
141
What is the difference between physical address and logical address?
Parameters: * Logical Address: Virtual address generated by CPU. * Physical Address: Actual location in a memory unit. Visibility: * Logical Address: User can view it. * Physical Address: User cannot view it. Access: * Logical Address: Used to access physical address. * Physical Address: Cannot be directly accessed by the user. Generation: * Logical Address: Generated by CPU. * Physical Address: Computed by MMU. ## Footnote MMU stands for Memory Management Unit, which translates logical addresses to physical addresses.
142
What is address binding?
The association of program instructions and data to the actual physical memory locations.
143
What are the different types of address binding?
Address Binding is divided into three types: * Compile-time Address Binding * Load time Address Binding * Execution time Address Binding ## Footnote Each type of binding occurs at different stages of program execution.
144
What is an advantage of dynamic allocation algorithms?
Advantages include: * Unknown memory needs beforehand * Data structures without upper memory limits * Efficient memory space usage * Easy insertions and deletions * Necessary for structures and linked lists in programming. ## Footnote Dynamic allocation allows for flexible memory management during runtime.
145
What is the difference between internal fragmentation and external fragmentation?
Internal Fragmentation: * Fixed-sized memory blocks allocated to process. * Occurs when process is larger than memory. * Solution: best-fit block. External Fragmentation: * Variable-sized memory blocks allocated. * Occurs when process is removed. * Solutions: compaction, paging, segmentation. ## Footnote Internal fragmentation wastes space within allocated blocks, while external fragmentation occurs between allocated blocks.
146
Define Compaction.
The process of collecting fragments of available memory space into contiguous blocks by moving programs and data.
147
What are the advantages and disadvantages of a hashed-page table?
Advantages: * Synchronization * Efficiency in many situations * Widely used for associative arrays, database indexing, caches Disadvantages: * Hash collisions are unavoidable * Inefficiency with many collisions * Does not allow null values. ## Footnote Hash tables are a common data structure used in various applications.
148
What is the difference between paging and segmentation?
Paging: * Fixed-size pages. * OS accountable. * Page size determined by hardware. * Faster but may result in internal fragmentation. Segmentation: * Variable-size sections. * Compiler accountable. * Section size given by user. * Slower but may result in external fragmentation. ## Footnote Paging and segmentation are both memory management schemes that handle how programs access memory.
149
Define Associative Memory.
A memory unit accessed by content.
150
Define Cache Memory.
Fast and small memory used to reduce average memory access time.
151
What is 'Locality of reference'?
A phenomenon where a computer program tends to access the same set of memory locations for a particular time period.
152
What are the advantages of virtual memory?
Advantages include: * Higher degree of multiprogramming * Easy and cheap memory allocation * Eliminates external fragmentation * Scattered data in physical memory * Supports large programs * Less I/O required * More efficient swapping. ## Footnote Virtual memory allows for the execution of larger applications by using disk space as an extension of RAM.
153
How is performance calculated in virtual memory?
Performance depends on the total number of page faults, calculated with: Effective access time = (1-p) x Memory access time + p x page fault time. ## Footnote 'p' represents the probability of a page fault occurring.
154
What is the basic concept of the file system?
A file is a collection of related information recorded on secondary storage.
155
List different operations on a file.
Operations include: * Create * Open * Read * Write * Rename * Delete * Append * Truncate * Close.
156
Define the term Bit-Vector.
A Bitmap or Bit Vector is a series of bits where each bit corresponds to a disk block, indicating allocation status.
157
What is a File Allocation Table (FAT)?
A table maintained by the OS on a hard disk that provides a map of the clusters where files are stored.
158
What is rotational latency?
The time taken by the desired sector of the disk to rotate into position for access.
159
What is seek time?
The time taken to locate the disk arm to a specified track for data reading or writing.
160
What is Belady's Anomaly?
An anomaly where increasing the number of page frames results in an increase in page faults, particularly with FIFO page replacement.
161
What happens if a non-recursive mutex is locked more than once?
It leads to deadlock, as the thread cannot release the mutex it already holds.
162
What are the advantages of a multiprocessor system?
Advantages include: * Enhanced performance * Multiple applications * Multi-tasking within applications * High throughput and responsiveness * Hardware sharing among CPUs.
163
Define real-time systems.
Systems that guarantee response within specified timing constraints.
164
How to recover from a deadlock?
Methods include: * Process termination * Abort all deadlock processes * Abort one process at a time * Resource preemption * Rollback * Selecting a victim. ## Footnote Recovery strategies depend on the system design and application requirements.
165
What factors determine whether a detection algorithm must be utilized in a deadlock avoidance system?
Factors include: * Frequency of deadlocks * Number of processes affected by deadlock.
166
Explain the resource allocation graph.
A diagram representing the state of the system in terms of processes and resources, useful for visualizing potential deadlocks.
167
What is an Operating System?
An interface between computer hardware and users, performing tasks like memory management, file management, and controlling peripheral devices. ## Footnote Examples include Linux and Windows.
168
List some of the standard services provided by an OS.
Standard services include: * User interface * Program execution * I/O operations * File-system manipulation * Communications * Error detection * Resource allocation * Accounting * Protection and security.
169
What is the primary purpose of an operating system?
To ensure optimal performance of a computer system and provide an environment for program development and execution.
170
What are the different states of a process?
States include: * Running * Ready * Waiting.
171
Name some crucial functions of an operating system.
Functions include: * Memory Management * Processor Management * Device Management * File Management * Security * Control over system performance * Job accounting * Error detecting aids * Coordination between software and users.
172
What are the different types of operating systems?
Types include: * Batched operating systems * Distributed operating systems * Time-Sharing operating systems * Multiprogrammed operating systems * Real-time operating systems.
173
What is a socket in OS?
A software construct allowing two applications to communicate over a network, identified by IP addresses and port numbers.
174
What is a Batch Operating System?
An OS that groups similar jobs into batches for processing without direct user interaction.
175
What are the benefits and disadvantages of a Batch Operating System?
Advantages: * Multiple users can share the system * Reduced idle time * Easier management of repetitive work. Disadvantages: * Hard to debug * Job failures delay other jobs.
176
What are Time-Sharing Operating Systems?
OS that allocates CPU time to each user for multitasking, with a time quantum for task execution.
177
What are the benefits and disadvantages of a Time-Sharing Operating System?
Advantages: * Equal opportunity for tasks * Reduced CPU idle time. Disadvantages: * Security and integrity concerns for user programs and data.
178
What is a Distributed Operating System?
An OS that allows various interconnected computers to communicate over a shared network, each with its own memory and CPU.
179
What are the advantages of a Time-Sharing Operating System?
* Each task gets an equal opportunity * CPU idle time can be reduced ## Footnote Time-sharing systems allow multiple users to share system resources effectively.
180
What are the disadvantages of a Time-Sharing Operating System?
* Security and integrity of user programs and data must be maintained ## Footnote Ensuring user data protection is critical in a time-sharing environment.
181
What is a Distributed Operating System?
A system where various autonomous, interconnected computers communicate using a shared network, with each having its own memory unit and CPU.
182
What are the benefits of a Distributed Operating System?
* Independence of systems prevents failure from affecting others * High-speed computation due to resource sharing * Easily scalable ## Footnote Scalability allows adding more systems to the network without major issues.
183
What are the disadvantages of a Distributed Operating System?
* Failure of the leading network halts entire communication.
184
What is a Real-Time Operating System?
An OS that serves real-time systems with minimal response time, crucial for applications with stringent time requirements.
185
What are the two types of Real-Time Operating Systems?
* Hard Real-Time Systems: Stringent time constraints, e.g., automatic parachutes * Soft Real-Time Systems: Less strict time constraints.
186
What are the advantages of a Real-Time Operating System?
* Maximum utilization of devices * Error-free operation ## Footnote These systems are designed to minimize errors due to their critical applications.
187
What are the disadvantages of a Real-Time Operating System?
* Complex algorithms that are challenging for designers.
188
What is a thread?
A lightweight subunit of a process that enables parallel execution within an application.
189
How do threads differ from processes?
Threads are lightweight and share the same memory space, while processes are independent execution units with their own memory.
190
What is a kernel in an OS?
The core part of an operating system providing essential services for all parts of the OS.
191
What is a monolithic kernel?
A kernel that includes all operating system code in a single executable image.
192
Define a process.
An executing program in an OS.
193
What are the different states of a process in OS?
* New Process * Running Process * Waiting Process * Ready Process * Terminated Process
194
What is the difference between process and program?
A program is a set of instructions, while a process is a program currently running.
195
What is aging in the Operating System?
A technique to avoid starvation by increasing the priority of processes that have been waiting for a long time.
196
What are the advantages of multithreaded programming in OS?
* Enhances user responsiveness * Resource sharing within the process * Economical * Utilizes multiprocessing architecture ## Footnote Multithreading allows better performance and resource management.
197
What are System calls?
Interfaces to the services provided by an operating system.
198
Why do application programmers prefer APIs over actual system calls?
APIs offer program portability and are generally easier to work with than detailed system calls.
199
What is the role of the System Interface?
Provides a system call interface that links system calls made available by the OS.
200
What are the different scheduling algorithms in OS?
* First-Come, First-Served (FCFS) * Shortest-Job-Next (SJN) * Priority Scheduling * Shortest Remaining Time * Round Robin (RR) * Multiple-Level Queues Scheduling
201
What is the objective of multiprogramming in OS?
To increase CPU utilization by organizing jobs so that the CPU always has one to execute.
202
What are various types of System calls in OS?
* Process control * Communication * Information maintenance * Device management * File management
203
Which of the following is a primary function of an operating system?
Managing hardware resources.
204
What is the purpose of a system call in an operating system?
To request a service from the operating system.
205
In which type of operating system does the processor allocate time to each task in a rotating manner?
Time-sharing.
206
What is the role of the kernel in an operating system?
It manages system resources and hardware.
207
Which of the following is not a characteristic of a distributed operating system?
It runs on a single computer only.
208
Which operating system concept allows multiple programs to run simultaneously?
Multiprogramming.
209
What is a process in an operating system?
A program in execution.
210
Which of the following memory management techniques involves dividing memory into fixed-sized blocks?
Paging.
211
Which scheduling algorithm selects the process that has been waiting the longest?
First-Come, First-Served (FCFS).
212
What is the purpose of an interrupt in an operating system?
To signal the processor for immediate attention.
213
What are the 4 main types of operating system?
* Real-Time OS * Single-User/Multi-Tasking OS * Multi-User OS * Embedded OS
214
How to prepare for an OS interview?
Study core concepts like process management, memory allocation, file systems, and synchronization.
215
What are the 5 concepts of operating system?
* Process management * Memory management * File system management * Device management * Security
216
What are the 4 main purposes of an OS?
* Managing computational activities * Providing an environment for program development and execution * Ensuring security * Managing resources.
217
What is the main purpose of an operating system?
An operating system (OS) manages computer hardware, software resources, and provides common services for computer programs.
218
What are the different types of operating systems?
* Batch OS * Distributed OS * Multitasking OS * Network OS * Real-Time OS * Mobile OS
219
Define a socket.
A socket is an endpoint for communication between processes, often over a network, identified by an IP address and port number.
220
What is the kernel in an operating system?
The kernel is the central core component of an operating system managing CPU scheduling, memory management, device drivers, file systems, and security.
221
What is a monolithic kernel?
A monolithic kernel is a kernel design where all OS services run in kernel space in one large binary.
222
What is the difference between a process and a program?
A program is a static set of instructions stored on disk; a process is a running instance of that program.
223
What is a thread?
A thread is a single sequential flow of control within a process, allowing concurrent execution.
224
What are the different states of a process?
* New * Ready * Running * Waiting (Blocked) * Terminated (Exit)
225
Define virtual memory.
Virtual memory is a memory management technique giving the illusion of a large address space, which may exceed physical RAM.
226
What is thrashing?
Thrashing occurs when the system spends more time handling page faults than executing process instructions.
227
What is RAID?
RAID (Redundant Array of Independent Disks) uses multiple disks to improve performance and reliability.
228
What are the different types of RAID?
* RAID 0 (Striping) * RAID 1 (Mirroring) * RAID 5 (Block-level striping with distributed parity) * RAID 6 (Double distributed parity) * RAID 10 (1+0)
229
What is a deadlock?
A deadlock is a situation where a set of processes are waiting for resources held by each other, preventing any from proceeding.
230
What are the necessary conditions for deadlock?
* Mutual Exclusion * Hold and Wait * No Preemption * Circular Wait
231
Define fragmentation.
Fragmentation refers to unusable gaps in memory/storage allocation.
232
What are the types of fragmentation?
* External Fragmentation * Internal Fragmentation
233
What is spooling?
Spooling is the process of placing data into a temporary buffer for I/O devices to access at their own speed.
234
What is a semaphore?
A semaphore is a synchronization primitive used to control access to shared resources.
235
What is the difference between a semaphore and a mutex?
A semaphore allows multiple concurrent accesses; a mutex allows only one.
236
Define binary semaphore.
A binary semaphore is a semaphore with a value of 0 or 1, used for mutual exclusion without enforcing ownership.
237
What is Belady’s Anomaly?
Belady’s Anomaly is a phenomenon where increasing page frames can lead to more page faults in certain algorithms.
238
What is starvation in operating systems?
Starvation occurs when a low-priority process waits indefinitely due to higher-priority processes.
239
What is aging in operating systems?
Aging is a technique to gradually increase the priority of waiting processes over time.
240
What is paging?
Paging is a memory management scheme that eliminates the need for contiguous physical memory allocation.
241
What is demand paging?
Demand paging is a lazy loading scheme where pages are loaded into memory only when they are first referenced.
242
Define segmentation.
Segmentation is a memory management technique dividing the program's address space into variable-sized segments.
243
What is a Real-Time Operating System (RTOS)?
RTOS is designed to serve real-time applications with strict timing constraints.
244
What are the types of RTOS?
* Hard Real-Time OS * Firm Real-Time OS * Soft Real-Time OS
245
What is the difference between main memory and secondary memory?
Main memory is volatile RAM directly accessible by the CPU; secondary memory is non-volatile storage like HDD or SSD.
246
What is static binding?
Static binding resolves function calls or variable addresses at compile time.
247
What is dynamic binding?
Dynamic binding resolves function calls at runtime, allowing for greater flexibility.
248
What is FCFS scheduling?
FCFS (First-Come, First-Served) is a non-preemptive scheduling algorithm serving processes in the order they arrive.
249
What is SJF scheduling?
SJF (Shortest Job First) is a non-preemptive scheduling algorithm selecting the process with the smallest CPU burst time.
250
What is SRTF scheduling?
SRTF (Shortest Remaining Time First) is a preemptive version of SJF that runs the process with the shortest remaining time.
251
What is the main purpose of an operating system?
An operating system manages computer hardware, software resources, and provides services for computer programs.
252
What is a socket?
An endpoint for inter-process communication, identified by IP address + port number.
253
What is a kernel?
The core component of an OS, managing CPU scheduling, memory, device I/O, file access, and process isolation.
254
What is a monolithic kernel?
A design where all OS services run in kernel space in one large binary.
255
What is the difference between a process and a program?
Program: Static set of instructions on disk. Process: A running instance of a program with its own address space.
256
What is a thread?
A lightweight execution unit within a process, sharing the process's address space.
257
What are the different states of a process?
* New * Ready * Running * Waiting/Blocked * Terminated
258
Define virtual memory.
An abstraction giving processes a large contiguous address space mapped to physical frames.
259
What is thrashing?
Excessive paging activity where the system spends most time swapping pages rather than executing processes.
260
What are threads?
Independent flows of execution within a process, sharing code and data.
261
What is RAID?
A technology that combines multiple disks for performance and/or fault tolerance.
262
What are the different types of RAID?
* RAID 0: striping * RAID 1: mirroring * RAID 5: striping with distributed parity * RAID 6: double parity * RAID 10: stripe over mirrored sets
263
What is a deadlock?
A situation where processes wait indefinitely for resources held by each other.
264
What are the necessary conditions for a deadlock?
* Mutual Exclusion * Hold and Wait * No Preemption * Circular Wait
265
What is fragmentation?
The condition where free memory is in scattered holes or allocated blocks are larger than requested.
266
What is external fragmentation?
Free memory in small scattered holes; total free is sufficient but no contiguous block is large enough.
267
What is internal fragmentation?
Allocated block larger than requested, leaving unused space inside.
268
What is spooling?
Buffers I/O data on disk so processes do not wait for slow devices.
269
What is a semaphore?
An integer synchronization primitive with atomic wait (P) and signal (V).
270
What is a mutex?
A mutual exclusion lock allowing exactly one thread into a critical section.
271
What is Belady’s Anomaly?
A phenomenon where increasing frames can increase page faults in some page replacement algorithms.
272
What is starvation in OS?
A low-priority process waits indefinitely if higher-priority processes keep getting CPU.
273
What is aging in OS?
Gradually increasing the priority of waiting processes over time to ensure eventual execution.
274
What is paging?
Breaking virtual address space into fixed-size pages and physical memory into frames.
275
What is demand paging?
Loading pages into memory only when first referenced.
276
What is segmentation?
Dividing address space into variable-sized segments.
277
What is a Real-Time Operating System?
An OS designed to meet strict timing constraints.
278
What are the types of Real-Time Operating Systems?
* Hard RTOS * Firm RTOS * Soft RTOS
279
What is the difference between main memory and secondary memory?
Main Memory (RAM): Volatile and fast. Secondary Memory (Disk/SSD): Non-volatile and slower.
280
What is static binding?
Function calls/addresses resolved at compile time.
281
What is dynamic binding?
Resolution at runtime.
282
What is First-Come, First-Served scheduling?
A non-preemptive scheduling method that serves processes in arrival order.
283
What is Shortest Job First scheduling?
A non-preemptive scheduling method that picks the process with the smallest CPU burst next.
284
What is Shortest Remaining Time First scheduling?
A preemptive version of SJF where the current process may be preempted if a new process has a shorter remaining time.
285
What is Longest Remaining Time First scheduling?
A preemptive version of Longest Job First that picks the process with the largest remaining time.
286
What is priority scheduling?
A method where the highest-priority process is selected to run next.
287
What is Round Robin scheduling?
A preemptive scheduling method that assigns a fixed time quantum to processes in cyclic order.
288
What is the Producer-Consumer Problem?
A synchronization problem where a producer generates data and a consumer removes it from a bounded buffer.
289
What is the Banker’s Algorithm?
A deadlock avoidance algorithm that checks if resource requests keep the system in a safe state.
290
What is cache memory?
A small, fast memory layer between CPU and RAM that holds frequently accessed data/instructions.
291
What is the difference between direct mapping and associative mapping in cache?
* Direct Mapping: Each block maps to one specific cache line. * Fully Associative Mapping: A block can go into any cache line.
292
What is set-associative mapping?
A cache mapping technique where the cache is divided into sets, and each block maps to one set.
293
What is multitasking?
The OS allows multiple tasks to share a CPU by time-slicing.
294
What is multiprocessing?
The system has multiple CPUs that can execute multiple processes in parallel.
295
What is throughput?
The number of processes that complete their execution per time unit.
296
What is deadlock?
A situation where two or more processes hold some resources and wait for resources held by others. ## Footnote Deadlock can occur when the following four conditions hold simultaneously: Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait.
297
What is a Time-sharing system?
A system where the CPU executes multiple jobs by switching among them, allowing users to interact with each program while it is running.
298
Define Throughput.
The number of processes that complete their execution per time unit.
299
What are the main functions of an operating system?
* Resource utilization * Resource allocation * Process management * Memory management * File management * I/O management * Device management
300
What are Real-time Systems?
Systems with rigid time requirements for processor operations and well-defined time constraints.
301
Explain Reentrancy.
A memory-saving technique where multiple users can share a single copy of a program, requiring that code cannot modify itself and local data is stored separately.
302
What is multiprogramming?
An operating system that allows multiple programs to execute over one CPU.
303
What is virtual memory?
A memory management method that allows processes to execute using both primary and secondary memory.
304
What is Thrashing?
A situation where performance degrades due to excessive processing of page faults rather than executing transactions.
305
What is the difference between micro kernel and macro kernel?
* Micro kernel: runs minimal performance affecting services * Macro Kernel: a combination of micro and monolithic kernel
306
Enumerate different RAID levels.
* RAID 0 – Non-redundant striping * RAID 1 – Mirrored Disks * RAID 2 – Memory-style error-correcting codes * RAID 3 – Bit-interleaved Parity * RAID 4 – Block-interleaved Parity * RAID 5 – Block-interleaved distributed Parity * RAID 6 – P+Q Redundancy
307
Is it possible to have a deadlock involving only one process?
No, because circular wait cannot exist with only one process.
308
How are Server Systems classified?
* Computer-server systems * File server systems
309
List Coffman’s conditions that lead to a deadlock.
* Mutual Exclusion * Hold & Wait * No Pre-emption * Circular Wait
310
Describe how to boot an operating system.
Booting is the process of starting a computer from the kernel, often when the computer is first powered on or needs to be restarted.
311
What is demanding Paging?
A concept where only part of the process is present in main memory to execute, with the rest kept in secondary memory.
312
What is Banker’s algorithm?
A deadlock-avoidance method that ensures resources are allocated in a way that can still satisfy all customers' requirements.
313
Give an example of a Process State.
* New State * Running * Waiting * Ready * Terminate
314
What is a pipe?
An unnamed pipe used for communication between related processes; named pipes allow unrelated processes to communicate.
315
What are the two main purposes of an operating system?
* To ensure a computer system performs well by managing computational activities * To provide an environment for program development and execution
316
What are the advantages of a multiprocessor system?
* Increased throughput * Cost savings through resource sharing * Enhanced reliability
317
What is a kernel?
The core of an operating system that connects applications to data processing and manages communication between software and hardware.
318
What do you mean by a process?
An executing program, which can be an Operating System Process or a User Process.
319
What are the different states of a process?
* New Process * Running Process * Waiting Process * Ready Process * Terminated Process
320
What is the difference between process and program?
* A program is a set of instructions; a process is a program in execution. * A program is static; a process is dynamic.
321
What are the disadvantages of file processing systems?
* Significant overhead * Limited lifespan of processes * Requires execution time in CPU and shared resources
322
What is the basic difference between pre-emptive and non-preemptive scheduling?
Pre-emptive scheduling allows a process to be interrupted, while non-preemptive scheduling does not.
323
What is CPU Scheduler?
Selects processes in memory that are ready to execute and allocates the CPU to one of them.
324
What is Dispatcher?
A module that gives control of the CPU to the selected process, involving context switching and mode switching.
325
What are the necessary conditions to achieve a deadlock?
* Mutual Exclusion * Hold and Wait * No preemption * Circular Wait
326
How many types of fragmentation occur in Operating System?
* Internal fragmentation * External fragmentation
327
What is Memory-Management Unit (MMU)?
A hardware device that maps virtual to physical addresses, allowing user programs to deal with logical addresses.
328
Explain the different sections of a process.
* Stack: temporary data and local variables * Heap: dynamic memory allocation * Text: low-level instructions * Data: static and global variables
329
What are the different types of scheduling algorithms?
* First Come First Serve (FCFS) * Round Robin (RR) * Shortest Job First (SJF) * Priority Scheduling (PS)
330
What is the difference between user level thread and kernel level thread?
* User-Level Threads: implemented by users, not recognized by OS * Kernel-Level Threads: implemented by OS, recognized by OS
331
What is synchronization?
The coordination of processes that share data to avoid inconsistencies.
332
What are the different synchronization mechanisms?
* Mutex * Semaphores * Monitors * Condition variables * Critical regions * Read/Write locks
333
What is the use of paging in operating system?
A memory-management scheme that allows a process's physical address space to be non-contiguous.
334
What is paging in operating system?
Paging is a memory-management scheme that permits the physical address space of a process to be non-contiguous.
335
What is a Zombie process?
A zombie process is a process that has completed and is in the terminated state but has its entry in the process table.
336
When does Belady’s anomaly occur?
Belady’s Anomaly occurs when the number of page faults increases significantly in a virtual memory system using demand paging.
337
What is the basic difference between Segmentation and Paging?
Paging is a physical unit of information; Segmentation is a logical unit of information.
338
What are the types of Kernel?
* Monolithic Kernels * Microkernels
339
What is Starvation in operating systems?
Starvation occurs when lower burst time processes get blocked because higher burst time processes dominate the CPU.
340
What is a safe state in deadlock avoidance?
A safe state is when the system can allocate all resources requested by all processes without entering a deadlock state.
341
What is the difference between turn around time and response time?
Turn around time is the interval between job submission and completion; response time is the interval between request submission and first response.
342
What are the reasons for process suspension?
* Swapping * Interactive User Request * Timing * Parent Process Request
343
What are the various scheduling queues?
* Job Queue * Ready Queue * Device Queue
344
What is the main goal of RAID technology?
The main goal of RAID is to improve data storage reliability, availability, and performance.
345
Fill in the blank: A _______ process is one that has completed but still has an entry in the process table.
Zombie
346
True or False: Paging allows logical partitioning and protection of application components.
False
347
Fill in the blank: The _______ effect occurs when lower burst time processes are blocked by higher burst time processes.
convoy
348
What techniques are primarily used in RAID technology?
* Data striping * Mirroring * Redundancy