Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Collections of Company Wise DSA questions done during my job hunt & Core Subject Materials

NotificationsYou must be signed in to change notification settings

codewithjaspreet/Company-Wise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microsoft SDE sheet :

https://docs.google.com/document/d/1uY8U4JFndDC0gDxqrGxQSL5a8EViVy5eKBA8jTQYyNs/edit?usp=sharing

Gfg Last Minutes Notes:

https://www.geeksforgeeks.org/last-minute-notes-operating-systems/

Basic OS Interview Questions

1.    Why is the operating system important?

2.    What's the main purpose of an OS? What are the different types of OS?

3.    What are the benefits of a multiprocessor system?

4.    What is RAID structure in OS? What are the different levels of RAID configuration?

5.    What is GUI?

6.    What is a Pipe and when it is used?

7.    What are the different kinds of operations that are possible on semaphore?

8.    What is a bootstrap program in OS?

9.    Explain demand paging?

10.    What do you mean by RTOS?

11.    What do you mean by process synchronization?

12.    What is IPC? What are the different IPC mechanisms?

13.    What is different between main memory and secondary memory.

14.    What do you mean by overlays in OS?

15.    Write top 10 examples of OS?

Intermediate OS Interview Questions

16.    What is virtual memory?

17.    What is thread in OS?

18.    What is a process? What are the different states of a process?

Contents

Intermediate OS Interview Questions (.....Continued)

19.    What do you mean by FCFS?

20.    What is Reentrancy?

21.    What is a Scheduling Algorithm? Name different types of scheduling algorithms.

22.    What is the difference between paging and segmentation?

23.    What is thrashing in OS?

24.    What is the main objective of multiprogramming?

25.    What do you mean by asymmetric clustering?

26.    What is the difference between multitasking and multiprocessing OS?

27.    What do you mean by Sockets in OS?

28.    Explain zombie process?

29.    What do you mean by cascading termination?

30.    What is starvation and aging in OS?

Advanced OS Interview Questions

31.    What do you mean by Semaphore in OS? Why is it used?

32.    What is Kernel and write its main functions?

33.    What are different types of Kernel?

34.    Write difference between micro kernel and monolithic kernel?

35.    What is SMP (Symmetric Multiprocessing)?

36.    What is a time-sharing system?

Advanced OS Interview Questions (.....Continued)

37.    What is Context Switching?

38.    What is difference between Kernel and OS?

39.    What is difference between process and thread?

40.    What are various sections of the process?

41.    What is a deadlock in OS? What are the necessary conditions for a deadlock?

42.    What do you mean by Belady’s Anomaly?

43.    What is spooling in OS?

What do you mean by an operating system? What are its basic
functions?

Operating System (OS) is basically a soware program that manages and handles allresources of a computer such as hardware and soware. The first OS was introducedin the early 1950s known as GMOs. An OS is responsible for managing, handling, andcoordinating overall activities and sharing of computer resources. It acts as anintermediary among users of computer and computer hardware.

Functions of OS:There are many functions of the OS. Some of the important functions of OS are givenbelow:

Let's get Started

Memory and Processor ManagementProviding user interface to usersFile Management and Device ManagementScheduling of resources and jobsError DetectionSecurity

Basic OS Interview Questions

1.   Why is the operating system important?

OS is the most essential and vital part of a computer without which it is considereduseless. It enables an interface or acts like a link for interaction between computersoware that is installed on OS and users. It also helps to communicate withhardware and also maintains balance among hardware and CPU. It also providesservices to users and a platform for programs to run on. It performs all common tasksapplications require.

2.   What's the main purpose of an OS? What are the different

types of OS?

The main purpose of an OS is to execute user programs and make it easier for usersto understand and interact with computers as well as run applications. It is speciallydesigned to ensure that the computer system performs better by managing allcomputational activities. It also manages computer memory, processes, andoperation of all hardware and soware.

Types of OS:

Batched OS (Example: Payroll System, Transactions Process, etc.)Multi-Programmed OS (Example: Windows O/S, UNIX O/S, etc.)Timesharing OS (Example: Multics, etc.)Distributed OS (LOCUS, etc.)Real-Time OS (PSOS, VRTX, etc.)

3.   What are the benefits of a multiprocessor system?

A Multiprocessor system is a type of system that includes two or more CPUs. Itinvolves the processing of different computer programs at the same time mostly by acomputer system with two or more CPUs that are sharing single memory.

Benefits:

Such systems are used widely nowadays to improve performance in systemsthat are running multiple programs concurrently. By increasing the number of processors, a greater number of tasks can becompleted in unit time. One also gets a considerable increase in throughput and is cost-effective also asall processors share the same resources.It simply improves the reliability of the computer system.

4.   What is RAID structure in OS? What are the different levels of

RAID configuration?

RAID (Redundant Arrays of Independent Disks) is a method used to store data onMultiple hard disks therefore it is considered as data storage virtualizationtechnology that combines multiple hard disks. It simply balances data protection,system performance, storage space, etc. It is used to improve the overallperformance and reliability of data storage. It also increases the storage capacity ofthe system and its main purpose is to achieve data redundancy to reduce data loss.

Different levels of RAID

Nowadays, RAID is available in various schemes or RAID level as given below:

RAID 0 - Non-redundant striping: This level is used to increase the performanceof the server.RAID 1 - Mirroring and duplexing: This level is also known as disk mirroring and isconsidered the simplest way to implement fault tolerance.RAID 2 - Memory-style error-correcting codes: This level generally uses dedicatedhamming code parity I.e., a liner form of error correction code.RAID 3 - Bit-interleaved Parity: This level requires a dedicated parity drive tostore parity information.RAID 4 - Block-interleaved Parity: This level is similar to RAID 5 but the onlydifference is that this level confines all parity data to a single drive.RAID 5 - Block-interleaved distributed Parity: This level provides far betterperformance than disk mirroring and fault tolerance.RAID 6 - P+Q Redundancy: This level generally provides fault tolerance for twodrive failures.

5.   What is GUI?

GUI (Graphical User Interface) is basically a type of user interface that allows users touse graphics to interact with OS. GUI is created because it is more user-friendly, lesscomplex, and easier to understand rather than a command-line interface. Its maingoal is to increase efficiency and ease of use. Instead of having to memorizecommands, users can just click on a button to simply execute the procedure.Examples of GUI include Microso Windows, macOS, Apple’s iOS, etc.

6.   What is a Pipe and when it is used?

The pipe is generally a connection among two or more processes that areinterrelated to each other. It is a mechanism that is used for inter-processcommunication using message passing.  One can easily send information such as theoutput of one program process to another program process using a pipe. It can beused when two processes want to communicate one-way i.e., inter-processcommunication (IPC).

7.   What are the different kinds of operations that are possible

on semaphore?

There are basically two atomic operations that are possible:

Wait()Signal()

8.   What is a bootstrap program in OS?

It is generally a program that initializes OS during startup i.e., first code that isexecuted whenever computer system startups. OS is loaded through a bootstrappingprocess or program commonly known as booting. Overall OS only depends on thebootstrap program to perform and work correctly. It is fully stored in boot blocks at afixed location on the disk. It also locates the kernel and loads it into the mainmemory aer which the program starts its execution.

9.   Explain demand paging?

Demand paging is a method that loads pages into memory on demand. This methodis mostly used in virtual memory. In this, a page is only brought into memory when alocation on that particular page is referenced during execution. The following stepsare generally followed:

Attempt to access the page.If the page is valid (in memory) then continue processing instructions as normal.If a page is invalid then a page-fault trap occurs.Check if the memory reference is a valid reference to a location on secondarymemory. If not, the process is terminated ( illegal memory access ). Otherwise,we have to page in the required page.Schedule disk operation to read the desired page into main memory.Restart the instruction that was interrupted by the operating system trap.

10.   What do you mean by RTOS?

Real Time Operating System (RTOS) is an operating system that is used for real-timeapplications i.e., for those applications where data processing should be done in afixed and small measure of time. It performs much better on tasks that are needed tobe executed within a short time. It also takes care of execution, monitoring, and all-controlling processes. It also occupies less memory and consumes fewer resources.

Types of RTOS:

Hard Real-TimeFirm Real-TimeSo Real-Time

RTOS is used in Air traffic control systems, Anti-lock Brake Systems, and Heartpacemakers.

11.   What do you mean by process synchronization?

Process synchronization is basically a way to coordinate processes that use sharedresources or data. It is very much essential to ensure synchronized execution ofcooperating processes so that will maintain data consistency. Its main purpose is toshare resources without any interference using mutual exclusion. There are twotypes of process synchronization:

Independent ProcessCooperative Process

12.   What is IPC? What are the different IPC mechanisms?

IPC (Interprocess Communication) is a mechanism that requires the use of resourceslike a memory that is shared between processes or threads. With IPC, OS allowsdifferent processes to communicate with each other. It is simply used for exchangingdata between multiple threads in one or more programs or processes. In thismechanism, different processes can communicate with each other with the approvalof the OS.

Different IPC Mechanisms:

PipesMessage QueuingSemaphoresSocketShared MemorySignals

13.   What is different between main memory and secondary

memory.

Main memory: Main memory in a computer is RAM (Random Access Memory). It isalso known as primary memory or read-write memory or internal memory. Theprograms and data that the CPU requires during the execution of a program arestored in this memory.Secondary memory: Secondary memory in a computer are storage devices that canstore data and programs. It is also known as external memory or additional memoryor backup memory or auxiliary memory. Such storage devices are capable of storinghigh-volume data. Storage devices can be hard drives, USB flash drives, CDs, etc.

Primary Memory Secondary Memory
Data can be directlyaccessed by the processingunit.
Firstly, data is transferred toprimary memory and aerthen routed to the processingunit.
It can be both volatile andnon-volatile in nature.
It is non-volatile in nature.
It is more costly thansecondary memory.
It is more cost-effective or lesscostly than primary memory.
It is temporary becausedata is stored temporarily.
It is permanent because datais stored permanently.
In this memory, data can belost whenever there is apower failure.
In this memory, data is storedpermanently and thereforecannot be lost even in case ofpower failure.
It is much faster thansecondary memory andsaves data that is currentlyused by the computer.
It is slower as compared toprimary memory and savesdifferent kinds of data indifferent formats.
It can be accessed by data. It can be accessed by I/Ochannels.

14.   What do you mean by overlays in OS?

Overlays is basically a programming method that divides processes into pieces sothat instructions that are important and need can be saved in memory. It does notneed any type of support from the OS. It can run programs that are bigger in size thanphysical memory by only keeping only important data and instructions that can beneeded at any given time.

15.   Write top 10 examples of OS?

Some of the top OS’s that are used mostly are given below:

MS-WindowsUbuntuMac OSFedoraSolarisFree BSDChrome OSCentOSDebianAndroid

Intermediate OS Interview Questions

16.   What is virtual memory?

It is a memory management technique feature of OS that creates the illusion to usersof a very large (main) memory. It is simply space where a greater number of programscan be stored by themselves in the form of pages. It enables us to increase the use ofphysical memory by using a disk and also allows us to have memory protection. It canbe managed in two common ways by OS i.e., paging and segmentation. It acts astemporary storage that can be used along with RAM for computer processes.

17.   What is thread in OS?

Thread is a path of execution that is composed of a program counter, thread id,stack, and set of registers within the process. It is a basic unit of CPU utilization thatmakes communication more effective and efficient, enables utilization ofmultiprocessor architectures to a greater scale and greater efficiency, and reducesthe time required in context switching. It simply provides a way to improve andincrease the performance of applications through parallelism. Threads aresometimes calledlightweight processes because they have their own stack but canaccess shared data.

Multiple threads running in a process share: Address space, Heap, Static data, Codesegments, File descriptors, Global variables, Child processes, Pending alarms, Signals,and signal handlers.

Each thread has its own: Program counter, Registers, Stack, and State.

18.   What is a process? What are the different states of a

process?

The process is basically a program that is currently under execution. The mainfunction of an OS is to manage and handle all of these processes. When a program isloaded into the memory and it becomes a process, it can be divided into foursections ─ stack, heap, text, and data. There are two types of processes:

1. Operating System Processes2. User Processes

States of Process:

Different states of the process through which process goes are given below:

New State : In this state, a process is just created.Running: In this state, the CPU starts working on the process’s instructions.Waiting: In this state, the process cannot run because it just waits for someevent to occurReady: In this state, the process has all resources available that are required torun but it waits to get assigned to a processor because CPUs are not workingcurrently on instructions passed by the process.Terminate: In this state, the process is completed I.e., the process has finishedexecution.

19.   What do you mean by FCFS?

FCFS (First Come First Serve) is a type of OS scheduling algorithm that executesprocesses in the same order in which processes arrive. In simple words, the processthat arrives first will be executed first. It is non-preemptive in nature. FCFS schedulingmay cause the problem of starvation if the burst time of the first process is thelongest among all the jobs. Burst time here means the time that is required inmilliseconds by the process for its execution. It is also considered the easiest andsimplest OS scheduling algorithm as compared to others. Implementation of FCFS isgenerally managed with help of the FIFO (First In First Out) queue.

20.   What is Reentrancy?

Reentrant is simply a function in which various clients can use and shares a singlecopy of a program during a similar period. This concept is generally associated withOS code and does not deal with concurrency. It has two major functions:

Program code cannot change or modify itself.Local data for every client process needs to be stored in different disks.

21.   What is a Scheduling Algorithm? Name different types of

scheduling algorithms.

A scheduling algorithm is a process that is used to improve efficiency by utilizingmaximum CPU and providing minimum waiting time to tasks. It simply deals with theproblem of deciding which of outstanding requests is to be allocated resources. Itsmain aim is to reduce resource starvation and to ensure fairness amongst partiesthat are utilizing the resources. In simple words, it is used to allocate resourcesamong various competing tasks.

Types of Scheduling Algorithm

There are different types of scheduling algorithms as given below:

22.   What is the difference between paging and segmentation?

Paging: It is generally a memory management technique that allows OS to retrieveprocesses from secondary storage into main memory. It is a non-contiguousallocation technique that divides each process in the form of pages. Segmentation: It is generally a memory management technique that dividesprocesses into modules and parts of different sizes. These parts and modules areknown as segments that can be allocated to process.

Paging Segmentation

It is invisible to aprogrammer.

It is visible to a programmer.

In this, the size of pagesis fixed.

In this, the size of segments is notfixed.

Procedures and datacannot be separated inpaging.

Procedures and data can beseparated in segmentation.

It allows a cumulativetotal of virtual addressspaces to cross physicalmain memory.

It allows all programs, data, andcodes to break up intoindependent address spaces.

It is mostly available onCPUs and MMU chips.

It is mostly available on Windowsservers that may supportbackward compatibility, whileLinux has limited support.

It is faster for memoryaccess as compared tosegmentation.

It is slower as compared to paging.

In this, OS needs tomaintain a free frame.

In this, OS needs to maintain a listof holes in the main memory.

In paging, the type offragmentation isinternal.

In segmentation, the type offragmentation is external.

The size of the page isdetermined byavailable memory.

The size of the page is determinedby the user.

23.   What is thrashing in OS?

It is generally a situation where the CPU performs less productive work and moreswapping or paging work. It spends more time swapping or paging activities ratherthan its execution. By evaluating the level of CPU utilization, a system can detectthrashing. It occurs when the process does not have enough pages due to which thepage-fault rate is increased. It inhibits much application-level processing that causescomputer performance to degrade or collapse.

24.   What is the main objective of multiprogramming?

It refers to the ability to execute or perform more than one program on a singleprocessor machine. This technique was introduced to overcome the problem ofunderutilization of CPU and main memory. In simple words, it is the coordination ofexecution of various programs simultaneously on a single processor (CPU). The mainobjective of multiprogramming is to have at least some processes running at alltimes. It simply improves the utilization of the CPU as it organizes many jobs wherethe CPU always has one to execute.

25.   What do you mean by asymmetric clustering?

Asymmetric Clustering is generally a system in which one of the nodes among allnodes is in hot standby mode whereas the rest of all nodes run different applications.It simply uses whole or entire hardware resources therefore it is considered a morereliable system as compared to others.

26.   What is the difference between multitasking and

multiprocessing OS?

Multitasking: It is a system that allows more efficient use of computer hardware.This system works on more than one task at one time by rapidly switching betweenvarious tasks. These systems are also known as time-sharing systems.

Multiprocessing: It is a system that allows multiple or various processors in acomputer to process two or more different portions of the same programsimultaneously. It is used to complete more work in a shorter period of time.

Multitasking Multiprocessing
It performs more than onetask at a time using a singleprocessor.
It performs more than onetask at a time using multipleprocessors.
In this, the number of CPUs isonly one.
In this, the number of CPUsis more than one.
It is more economical. It is less economical.
It is less efficient thanmultiprocessing.
It is more efficient thanmultitasking.
It allows fast switching amongvarious tasks.
It allows smooth processingof multiple tasks at once.
It requires more time toexecute tasks as compared tomultiprocessing.
It requires less time for jobprocessing as compared tomultitasking.

27.   What do you mean by Sockets in OS?

The socket in OS is generally referred to as an endpoint for IPC (InterprocessCommunication). Here, the endpoint is referred to as a combination of an IP addressand port number.  Sockets are used to make it easy for soware developers to createnetwork-enabled programs. It also allows communication or exchange ofinformation between two different processes on the same or different machines. It ismostly used in client-server-based systems.

Types of Sockets

There are basically four types of sockets as given below:

Stream SocketsDatagram SocketsSequenced Packet SocketsRaw Sockets

28.   Explain zombie process?

Zombie process, referred to as a defunct process, is basically a process that isterminated or completed but the whole process control block is not cleaned up fromthe main memory because it still has an entry in the process table to report to itsparent process. It does not consume any of the resources and is dead, but it stillexists. It also shows that resources are held by process and are not free.

29.   What do you mean by cascading termination?

Cascading termination is a process termination in which if the parent process isexiting or terminating then the children process will also get terminated. It does notallow the child to continue processing as its parent process terminates. It is generallyinitiated by OS.

30.   What is starvation and aging in OS?

Starvation: It is generally a problem that usually occurs when a process has not beenable to get the required resources it needs for progress with its execution for a longperiod of time. In this condition, low priority processes get blocked and only highpriority processes proceed towards completion because of which low priorityprocesses suffer from lack of resources.

Aging: It is a technique that is used to overcome the situation or problem ofstarvation. It simply increases the priority of processes that wait in the system forresources for a long period of time. It is considered the best technique to resolve theproblem of starvation as it adds an aging factor to the priority of each and everyrequest by various processes for resources. It also ensures that low-level queue jobsor processes complete their execution.

Advanced OS Interview Questions

31.   What do you mean by Semaphore in OS? Why is it used?

Semaphore is a signaling mechanism. It only holds one positive integer value. It issimply used to solve the problem or issue of critical sections in the synchronizationprocess by using two atomic operations i.e., wait() and signal().

Types of SemaphoreThere are usually two types of semaphores as given below:

Binary SemaphoreCounting Semaphore
Binary Semaphore Mutex
It allows various process threadsto get the finite instance of theresource until resources areavailable.
It allows various processthreads to get singleshared resource only ata time.
Its functions are based uponsignaling mechanisms.
Its functions are basedupon a lockingmechanism.
Binary semaphores are muchfaster as compared to Mutex.
Mutex is slower ascompared to binarysemaphores.
It is basically an integer. It is basically an object.

32.   What is Kernel and write its main functions?

The kernel is basically a computer program usually considered as a centralcomponent or module of OS. It is responsible for handling, managing, andcontrolling all operations of computer systems and hardware. Whenever the systemstarts, the kernel is loaded first and remains in the main memory. It also acts as aninterface between user applications and hardware.

Functions of Kernel:

It is responsible for managing all computer resources such as CPU, memory,files, processes, etc.It facilitates or initiates the interaction between components of hardware andsoware.It manages RAM memory so that all running processes and programs can workeffectively and efficiently.It also controls and manages all primary tasks of the OS as well as managesaccess and use of various peripherals connected to the computer.It schedules the work done by the CPU so that the work of each user is executedas efficiently as possible.

33.   What are different types of Kernel?

There are basically five types of Kernels as given below:

Monolithic KernelMicroKernelHybrid Kernel Nano KernelExo Kernel

34.   Write difference between micro kernel and monolithic

kernel?

MicroKernel : It is a minimal OS that executes only important functions of OS. It onlycontains a near-minimum number of features and functions that are required toimplement OS. Example: QNX, Mac OS X, K42, etc.

Monolithic Kernel: It is an OS architecture that supports all basic features ofcomputer components such as resource management, memory, file, etc. Example: Solaris, DOS, OpenVMS, Linux, etc.

MicroKernel Monolithic Kernel
In this soware or program,kernel services and userservices are present indifferent address spaces.
In this soware or program,kernel services and userservices are usually present inthe same address space.
It is smaller in size ascompared to themonolithic kernel.
It is larger in size as comparedto a microkernel.
It is easily extendible ascompared to a monolithickernel.
It is hard to as extend ascompared to a microkernel.
If a service crashes, it doesaffect on working of themicrokernel.
If a service crashes, the wholesystem crashes in amonolithic kernel.
It uses message queues toachieve inter-processcommunication.
It uses signals and sockets toachieve inter-processcommunication.

35.   What is SMP (Symmetric Multiprocessing)?

SMP is generally referred to as computer architecture in which the processing ofprograms is done by multiple processors that share a common OS and memory. SMPis very much required if you want to take advantage of multiprocessor hardware. Itsimply enables any processor to work on any of the tasks no matter where data orresources for that particular task are located in memory. These systems are morereliable than single-processor systems.

36.   What is a time-sharing system?

It is a system that allows more than one user to access the resources of a particularsystem in many locations. In simple words, it performs multiple tasks on a singleprocessor or CPU. As the name suggests, it means to share time into multiple slots inseveral processes. It also allows different users from different locations to use aparticular computer system at the same time therefore it is considered one of theimportant types of OS.

37.   What is Context Switching?

Context switching is basically a process of saving the context of one process andloading the context of another process. It is one of the cost-effective and time-savingmeasures executed by CPU the because it allows multiple processes to share a singleCPU. Therefore, it is considered an important part of a modern OS. This technique isused by OS to switch a process from one state to another i.e., from running state toready state. It also allows a single CPU to handle and control various differentprocesses or threads without even the need for additional resources.

38.   What is difference between Kernel and OS?

Kernel: Kernel is a system program that controls all programs running on thecomputer. The kernel is basically a bridge between the soware and hardware of thesystem.

Operating System: Operating system is a system program that runs on the computerto provide an interface to the computer user so that they can easily operate on thecomputer.

Kernel OS
It is considered a centralcomponent of OS
It is considered system soware.
It is generallyresponsible forconverting usercommands intomachine-levelcommands.
It is generally responsible formanaging the resources ofsystem.
It simply acts as aninterface betweenhardware andapplications.
It simply acts as an interfacebetween hardware and user.
It also performsfunctions like processmanagement, filemanagement, devicemanagement, I/Ocommunication, etc.
It also performs functions likeproviding security to data andfiles in the the system, providingaccess controls to users,maintaining the system privacy,etc.
Its type includesMicrokernel, Monolithickernel, etc.
Its type includes Single andMultiprogramming batchsystems, Distributed OS, Real-time OS.

39.   What is difference between process and thread?

Process: It is basically a program that is currently under execution by one or morethreads. It is a very important part of the modern-day OS.

Thread: It is a path of execution that is composed of the program counter, thread id,stack, and set of registers within the process.

Process Thread

It is a computer programthat is under execution.

It is the component or entityof the process that is thesmallest execution unit.

These are heavy-weightoperators.

These are lightweightoperators.

It has its own memory space. It uses the memory of theprocess they belong to.

It is more difficult to create aprocess as compared tocreating a thread.

It is easier to create a threadas compared to creating aprocess.

It requires more resources ascompared to thread.

It requires fewer resources ascompared to processes.

It takes more time to createand terminate a process ascompared to a thread.

It takes less time to createand terminate a thread ascompared to a process.

It usually run-in separatememory space.

It usually run-in sharedmemory space.

It does not share data. It shares data with eachother.

It can be divided intomultiple threads.

It can’t be furthersubdivided.

40.   What are various sections of the process?

There are basically four sections in the process as given below:

Stack: It is used for local variables and returns addresses. Heap: It is used for dynamic memory allocation.Data : It stores global and static variables.Code or text: It comprises compiled program code.

41.   What is a deadlock in OS? What are the necessary conditions

for a deadlock?

Deadlock is generally a situation where a set of processes are blocked as each processis holding resources and waits to acquire resources held by another process. In thissituation, two or more processes simply try to execute simultaneously and wait foreach to finish their execution because they are dependent on each other. We can seea hand problem in our system whenever a deadlock occurs in a program. It is one ofthe common problems you can see in multiprocessing.

Necessary Conditions for Deadlock

There are basically four necessary conditions for deadlock as given below:

Mutual ExclusionHold and WaitNo Pre-emptionCircular Wait or Resource Wait

42.   What do you mean by Belady’s Anomaly?

In the Operating System, process data is loaded in fixed-sized chunks and each chunkis referred to as a page. The processor loads these pages in the fixed-sized chunks ofmemory called frames. Belady’s Anomaly is a phenomenon in which if we increasethe number of frames in memory, then the number of page faults also increases. It isgenerally experienced when we use FIFO (First in First out) page replacementalgorithm.

43.   What is spooling in OS?

Spooling simply stands for Simultaneous peripheral operations online. It is referredto as putting data of various I/O jobs in a buffer. Here, buffer means a special area inmemory or hard disk that can be accessible to an I/O device. It is used for mediationbetween a computer application and a slow peripheral. It is very useful andimportant because devices access or acquire data at different rates. This operationalso uses disk as a very large buffer and is capable of overlapping I/O operations forone task with processor operations for another task.

About

Collections of Company Wise DSA questions done during my job hunt & Core Subject Materials

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp