Operating System Interview Question-1692948732390
Operating System Interview Question-1692948732390
3. What is a Thread?
A thread is a single sequence stream within a process. Because threads have some of the
properties of processes, they are sometimes called lightweight processes. Threads are a
popular way to improve the application through parallelism. For example, in a browser,
multiple tabs can be different threads. MS Word uses multiple threads, one thread to
format the text, another thread to process inputs, etc.
6. What is Thrashing?
Thrashing is a situation when the performance of a computer degrades or collapses.
Thrashing occurs when a system spends more time processing page faults than executing
transactions. While processing page faults is necessary in order to appreciate the benefits
of virtual memory, thrashing has a negative effect on the system. As the page fault rate
increases, more transactions need processing from the paging device. The queue at the
paging device increases, resulting in increased service time for a page fault.
7. What is Buffer?
A buffer is a memory area that stores data being transferred between two devices or
between a device and an application.
21. State the main difference between logical and physical address space?
22. How does dynamic loading aid in better memory space utilization?
With dynamic loading, a routine is not loaded until it is called. This method is especially
useful when large amounts of code are needed in order to handle infrequently occurring
cases such as error routines.
23. What are overlays?
The concept of overlays is that whenever a process is running it will not use the complete
program at the same time, it will use only some part of it. Then overlay concept says that
whatever part you required, you load it and once the part is done, then you just unload it,
which means just pull it back and get the new part you required and run it. Formally, “The
process of transferring a block of program code or other data into internal memory,
replacing what is already stored”.
30. What is the best page size when designing an operating system?
The best paging size varies from system to system, so there is no single best when it
comes to page size. There are different factors to consider in order to come up with a
suitable page size, such as page table, paging time, and its effect on the overall efficiency
of the operating system.
The program does not have The process has its own control
6. any control block. block called Process Control
Block.
71. What are the necessary conditions which can lead to a deadlock in a system?
● Mutual Exclusion: There is a resource that cannot be shared.
● Hold and Wait: A process is holding at least one resource and waiting for another
resource, which is with some other process.
● No Preemption: The operating system is not allowed to take a resource back from
a process until the process gives it back.
● Circular Wait: A set of processes waiting for each other in circular form.
72. What are the issues related to concurrency?
● Non-atomic: Operations that are non-atomic but interruptible by multiple
processes can cause problems.
● Race conditions: A race condition occurs of the outcome depends on which of
several processes gets to a point first.
● Blocking: Processes can block waiting for resources. A process could be blocked
for a long period of time waiting for input from a terminal. If the process is required
to periodically update some data, this would be very undesirable.
● Starvation: It occurs when a process does not obtain service to progress.
● Deadlock: It occurs when two processes are blocked and hence neither can
proceed to execute
Disadvantages
● Hash collisions are practically unavoidable. when hashing a random subset of a
large set of possible keys.
● Hash tables become quite inefficient when there are many collisions.
● Hash table does not allow null values, like a hash map.
● Define Compaction.
Effective access time = (1-p) x Memory access time + p x page fault time