Operating Systems is one of the core subjects for a computer science student. As such a lot of important questions are asked on this subject in interviews. Let’s take a look at some of the most important questions on OS for interviews.
If you want to learn about OS before going through its interview questions here is a resource for you: Operating System Cheatsheet
1. What do you understand about operating systems? Give 10 examples of OS.
Ans: An operating system is a software that helps the users to interact with the computer’s hardware while simultaneously acting as the interface between the user and the hardware. Without the OS, the computer system would just be another dumb hardware machine. The OS deals with all other application programs in the PC and makes things easier for the user.
Examples: Microsoft Windows, Mac OS, Ubuntu, Fedora, Linux, Solaris, Debian, CentOS, Free BSD, Chrome OS.
2. State some basic functions of the OS?
3. State the different types of OS.
4. What are the advantages of a multiprocessing operating system?
5. What is kernel?
Ans: Kernel is basically the core component of an OS which acts as the bridge between the applications and the data processing being done at hardware level. Kernel is the interface between the hardware and the applications.
6. Differentiate between Kernel and OS.
7. Differentiate between microkernel and monolithic kernel.
8. What is Thrashing?
Ans: Thrashing is the situation when the performance of the computer system collapses. This occurs when the system spends more time processing page faults than executing transactions. Thrashing inhibits the majority of the application-level processing that eventually causes computer performance to degrade.
9. What is a Thread?
Ans: A thread can be described as a flow of execution through the process code, with its own program counter that keeps track of which instruction to execute next. Threads allow the utilisation of multiprocessing architectures and provide concurrency within a process. A thread can be classified into -
User level threads,
Kernel level threads.
10. How can we handle thrashing?
Ans: We can handle thrashing by -
Working set model is based on the concept of Locality Model. It refers to a set of pages in a recent T time. The pages that have completed their T amount of time in the working set are then automatically dropped from it. Thus the accuracy depends on the value of T chosen. It is efficient in avoiding thrashing and in keeping the degree of multiprogramming as high as possible.
It is known that in thrashing there are fewer frames, and in the opposite situation(when it is not thrashing) it implies there is an excess of frames, based on this data an upper and lower bound is assigned for the desired page fault rate. Then, according to the page fault rate we allocate and remove pages. If the page fault rate is more than the upper bound; several pages are allocated to the system. Similarly if the number of pages is lower than the lower bound then pages are removed, the suspended process is restarted later on. By implementing this technique we can handle thrashing.
11. Difference between a process and a thread.
12. When does a page fault occur?
Ans: A page fault occurs when a program tries to access a code or data that is in its address space but absent in the system RAM.
13. What is a deadlock?
Ans: A Deadlock is a typical situation where each of the computer processes waits for a resource which is being assigned to some other process. In this situation, none of the processes gets executed as the resource it requires is being held by some other process which is also waiting for some other resource to be released.
14. Is it possible to have a deadlock involving only a single process?
Ans: No it isn’t possible.
A deadlock situation occurs when all the four conditions hold simultaneously in the system -
It is impossible to have a circular wait condition with only a single process. This implies that we can’t have a deadlock involving only a single process.
15. What is starvation?
Ans: Starvation is generally a problem that usually occurs when a process has not been able to get the required resources it needs for its execution for a long period of time. During starvation, low priority processes get blocked and only high priority processes proceed towards completion. In this condition, low priority processes suffer from lack of resources.
16. What is aging in OS?
Ans: Aging is a technique that is used to overcome the problem of starvation. It simply increases the priority of processes that wait in the system for resources for a long period of time. Aging ensures that low-level processes complete their execution.
17. What are semaphores? List some of their advantages.
Ans: A semaphore is a mechanism used to implement the synchronisation of tasks. They always hold a non negative integer variable value.
18. What is Banker’s algorithm?
Ans: Banker’s algorithm is used for avoiding a deadlock situation. Just like a bank never allocates available cash in an incoherent manner such that it fails to satisfy customer demands, this algorithm allocates resource in a manner to avoid possible deadlocks.
19. What is a Zombie Process?
Ans: A zombie process is a process that has been completed and is in the terminated state but still has its entry in the process table. It implies that the resources are held by the process and are not free.
20. What is memory management?
Ans: Memory Management is the most common way of controlling and organising PC memory, appointing segments known as blocks to different running projects to advance the general execution of the framework. It assists processes with moving back and forward between the primary memory and execution circle. It assists the OS with monitoring each memory area, irrespective of whether it is distributed to some interaction or it stays free.
21. What is paging?
Ans: Paging is generally a memory management technique that allows the OS to retrieve processes from secondary storage into main memory. It is a non-contiguous allocation technique that divides each process in the form of pages.
22. Differentiate between segmentation and paging.
23. What is turn around time?
Ans: Turn around time is basically the interval between the submission of a job and its completion.
24. What is response time?
Ans: Response time is the time interval between the submission of request and the first response to that particular request.
25. State the differences between multiprocessing and multitasking in OS.
26. What is a scheduling algorithm?
Ans: Scheduling algorithms are those algorithms which schedule processes on the processor in an efficient manner. They actually help in maximizing the CPU output by increasing thoroughput.
27. What do you understand about Belady's Anomaly?
Ans: In the OS, process data is loaded in fixed-sized chunks referred to as page. The processor loads these pages in fixed-sized chunks of memory called frames. Belady’s Anomaly is the phenomenon in which if we increase the number of frames in memory, the number of page faults also increases. It is generally experienced when we use the FIFO (First in First out) page replacement algorithm.
28. Differentiate between main and secondary memory.
Examples of main memory: RAM, ROM.
Examples of secondary memory: Hard disk, Magnetic tapes.
29. What are the methods for handling deadlock?
Ans: The three methods for handling deadlocks are -
30. What do you understand by the terms “critical section” and “remainder section”?
Ans: Critical section - The portion of the code in the program where the shared variables are accessed and/or updated is known as the critical section.
Remainder section: The remaining part of the program excluding the critical section is termed as the remainder section.
31. What do you understand by spooling?
Ans: Spooling is a process in which the data is temporarily gathered to be used and executed by a device, program or the system. It is generally associated with printing. When different applications send output to the printer at the same time, spooling keeps
these all jobs into a disk file and queues them accordingly for the printer to execute.
32. Explain the three variable partition schemes of memory management.
Ans: The three variable partition schemes are -
33. Write a short note on different types of page replacement algorithms.
34. Explain different types of disk scheduling algorithms in short.
35. What do you understand about Re-entrancy?
Ans: Often used for multi programmed time sharing systems, Re-entrancy enables multiple users to share a single copy of a program in the same time period. Note that, the program code cannot modify itself and the local data for each user process must be stored separately in these scenarios.
36. What does demand paging specify?
Ans: Demand paging specifies that if an area of memory is not currently being used,it is swapped to the disk to make room for an application's need.
37. What do you mean by a process?
Ans: A Process is basically a program in execution. Unlike the program, a process is said to be an active entity.
38. State the differences between a program and a process.
39. What is the difference between internal commands and external commands?
40. Differentiate between Logical and Physical address space.
41. What is GUI?
Ans: GUI stands for Graphical User Interface. It is a visual representation of communication presented to the user for easy interaction with the machine. The actions in a GUI are performed through direct manipulation of various graphical elements like buttons, icons, windows, etc. Communication in GUI is performed by interacting with these icons rather than the usual text-based or command-based communication.
42. Explain Round Robin scheduling algorithm.
Ans: Round Robin scheduling algorithm can be said to be a preemptive version of the first come first serve scheduling process. The Algorithm focuses on Time Sharing wherein every process gets executed in a cyclic way. A certain time slice is defined in the system which is called time quantum. Each process present in the ready queue is assigned to the CPU for that time quantum, if the execution of the process is completed during that time then the process will terminate else the process goes back to the ready queue awaiting the next turn to complete its execution. Note that higher the time quantum, higher will be the response time in the system - deciding the perfect time quantum value is extremely difficult.
43. Explain the pros and cons of a command line interface.
44. What is cache memory?
Ans: Cache memory is a high-speed memory, which is small in size but faster than the main memory (RAM). The CPU can access it more quickly than the primary memory. It generally stores the data and programs which are frequently used by the CPU - thereby making them instantly available to the CPU whenever required. In other words, it acts as a buffer between the RAM and CPU thereby speeding the CPU performance.
45. What is context switching?
Ans: Context Switching refers to the storing of the context or state of a process so that it can be reloaded when and where required and the execution is resumed from the earlier point. This is a feature of a multitasking operating system and allows a single CPU to be shared by multiple processes.
Note: Context Switching is triggered by any of the three -
If you're looking to prepare for a job in the tech industry, Data Structures and Algorithms (DSA) are essential to master. Practising problems on plat......
Each and every programmer needs a strong grasp in DSA to write efficient and optimised codes. However, DSA has a reputation of being one of the most f......
Its that time round the calendar again, but different for you all as for the first time now. You all will be facing the on campus placement season.Wit......
WHAT IS WEB3?Web3 is the catch-all term for the vision of an upgraded version of the internet aimed at giving power back to the users. It is truly the......
Cognizant helps organizations remain ahead of the competition by modernizing technology, reinventing processes, and redefining customer experiences. I...
Getting started with cloud computing ?The words "cloud" and "web" will be interchangeable. What kind of business operates today without the internet? ...
SOFTWARE MAINTENANCE:Software Maintenance can be defined as the process of modifying a software product after its delivery. The main purpose of softwa...
A quick summary upto what we did this far from this series:Software EngineeringSoftware engineering is a discipline of engineering concerned wit...
Capgemini is a global leader in consulting, digital transformation, technology, and engineering services. In the rapidly evolving world of cloud, digi...
Technical Round :Candidates who pass the online test will be invited to the technical interview...
About Mindtree:Mindtree Ltd, located in Bangalore, India, is a prominent Indian multinational information technology and outsourcing company. The ...
TCS NQT Interview kicks off with the aptitude test. The test follows the following pattern : TCS uses the TCS-iON software for their online aptit...
Increased competition for fewer jobs in the current economy means that just being right for the role on paper, is not enough on its own anymore. You h...
About TCS NinjaTCS administers the NQT to select candidates for a variety of positions (National Qualifier Test). Tens of thousands of people apply fo...
Introduction:Understanding time complexity of a function is imperative for every programmer to execute a program in the most efficient manner. Time co...
Software MethodologyA software methodology (which is also known as software process) is a set of related development Phases that leads to the pr...
About TCS DigitalTCS selects applicants for a variety of jobs by conducting the NQT (National Qualifier Test). About 10,000-15,000 job applicants subm...
Software Engineering is a subject that requires when you are a software developer as well as when you are in your college preparing for a semester or ...
Are you getting ready for your SQL developer job interview?You've come to the correct place.This tutorial will assist you in brushing up on your SQL s...
Introduction: What is SQL?To understand SQL, we must first understand databases and database management systems (DBMS).Data is essentially a collectio...
TCS Recruitment ProcessInterview RoundsInterview round 1: TCS NQTTCS NQT (National Qualifier T...
TCS NQT Aptitude has three sections, namely the Numerical Ability, Verbal Ability, and Reasoning Abi...
About TCS NQTTCS NQTs, also known as TCS National Qualifier Tests or Tata Consultancy Services Natio...
Networking: Importance in real life!Using a computer for work, as well as for personal use, ha...
ER-DiagramWhat are ER Models ?An Entity Relationship Diagram (ERD) is a visual representation of dif...
What is actually DBMS?A Database Management System (DBMS) is system software used to manage the orga...
Nowadays students tend to go more for off campus placements rather than on campus placements.One of ...
C CHEATSHEETINTRODUCTION:C programming language was developed by Dennis Ritchie of Bell Labs in 1972...
C is a general purpose high-level language most popular amongst coders, it is the most compatible, e...
What is GenC and GenC Next?GenC stands for Generation Cognizant. It basically means the fresher hiri...
C++ programming language has templates which basically allows functions and classes to work with gen...
C++ was conceived in the late 1970s to overcome the limitations of C. It is an extension of th...
Interview Questions are a great source to test your knowledge about any specific field. But remember...
The most popular high-level, multipurpose programming language right now is Python.Python supports p...
IntroductionPython is a high-level programming language with dynamic binding and high-level inherent...
Interview Questions are a great source to test your knowledge about any specific field. But remember...
Object-Oriented Programming or better known as OOPs is one of the major pillars of Java that has lev...
Java is a high-level programming language known for its robustness, object-oriented nature, enhanced...
Placements are an important part of engineering life, and while everyone hopes to be placed in a reputable company, only a few are successful. This is primarily due to a...